Raised This Month: $32 Target: $400
 8% 

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 Coder -> Activity channel
Coding on CS2 and taking paid and free jobs.

Contact: Steam, Telegram or discord ( franug ).

You like my work? +Rep in my steam profile comments or donate.

Franc1sco is offline
Send a message via MSN 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
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
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 18:46.


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