Raised This Month: $404 Target: $400
 101% 

csgo player need to press +use and +lookatweapon to trigger a Command


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
iFusion
Junior Member
Join Date: Oct 2018
Old 10-11-2018 , 02:24   csgo player need to press +use and +lookatweapon to trigger a Command
Reply With Quote #1

Hello there, need a script to trigger a Command example, PrintToChat(client, "Text") when player press +use AND +lookatweapon Key. If player press only one of this nothing will happen.

Thank you
iFusion is offline
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Old 10-11-2018 , 03:14   Re: csgo player need to press +use and +lookatweapon to trigger a Command
Reply With Quote #2

This should works:
PHP Code:
#include <sourcemod>
#include <sdktools>

public void OnPluginStart()
{
    
AddCommandListener(Command_Look"+lookatweapon");
}

public 
Action Command_Look(int client, const char[] commandint argc)
{
    if(
GetClientButtons(client) & IN_USE)
        
PrintToChat(client"Text");

__________________
Veteran SourceMod Coder
Taking paid requests -> Add me in STEAM or TELEGRAM
If you like my work you can DONATE ME

Franc1sco is offline
Send a message via MSN to Franc1sco Send a message via Skype™ to Franc1sco
eyal282
Veteran Member
Join Date: Aug 2011
Old 10-11-2018 , 08:16   Re: csgo player need to press +use and +lookatweapon to trigger a Command
Reply With Quote #3

Quote:
Originally Posted by Franc1sco View Post
This should works:
PHP Code:
#include <sourcemod>
#include <sdktools>

public void OnPluginStart()
{
    
AddCommandListener(Command_Look"+lookatweapon");
}

public 
Action Command_Look(int client, const char[] commandint argc)
{
    if(
GetClientButtons(client) & IN_USE)
        
PrintToChat(client"Text");

What if you press use and then lookatweapo
__________________


Accepting private work. Contact me if you're interested.
eyal282 is offline
Rohanlogs
Senior Member
Join Date: Nov 2015
Old 10-11-2018 , 16:48   Re: csgo player need to press +use and +lookatweapon to trigger a Command
Reply With Quote #4

If you want a script which hooks when you release +use and shortly after do +lookatweapon (under 0.47s), this should do it.

Spoiler
__________________
Rohanlogs is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:14.


Powered by vBulletin®
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Theme made by Freecode