Raised This Month: $57 Target: $400
 14% 

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 , 03: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 , 04: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 TELEGRAM or STEAM
or Discord Franc1sco#7876
| You like my work? 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 , 09: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.
If you like my work, feel free to donate in appreciation with PayPal or CSGO Skins.

Total Donated: 10$
eyal282 is offline
Rohanlogs
Senior Member
Join Date: Nov 2015
Old 10-11-2018 , 17: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 06:42.


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