How to get The Key Down And Up Event
Hi, I Need To Get The +USE and -USE Events... I tried to make something like this
register_clcmd("+use","cl_used",0); register_clcmd("-use","cl_useu",0); but it isn't work.. please Help Me |
Re: How to get The Key Down And Up Event
Fakemeta way:
Code:
static button |
Re: How to get The Key Down And Up Event
I know how to check if is a Key but I need to react when a User Press Key "E" and When He Release it
:( |
Re: How to get The Key Down And Up Event
It may helps a little : http://forums.alliedmods.net/showthread.php?t=56872
and with : Quote:
|
Re: How to get The Key Down And Up Event
To check if button is pressed:
Code:
public plugin_init()*edit* Greenberet have the better version..0o *edit* greetz regalis |
Re: How to get The Key Down And Up Event
alka isnt far away.
fakemeta: Code:
@regalis your version has the problem that +use will allways be executed as long as it got pressed |
Re: How to get The Key Down And Up Event
0o...huh :P...you'r right Greenberet! :wink:
|
Re: How to get The Key Down And Up Event
BIG THX TO ALL FOR HELP... thx Greenberet
but i how to get rid of that warning message Warning: Loose indentation on line 15 public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) // Add your code here... register_forward(FM_PlayerPreThink, "prethink",0) //LINE 15 (WARNING) } public prethink( id ) { static button,oldbuttons; button = pev( id, pev_button ); oldbuttons = pev( id, pev_oldbuttons ); if(button & IN_USE && !(oldbuttons & IN_USE)) { console_print(id,"USE DOWN"); } else if( oldbuttons & IN_USE && !(button & IN_USE)) { console_print(id,"USE UP"); } } |
Re: How to get The Key Down And Up Event
You have to indent your code properly.
Code:
|
Re: How to get The Key Down And Up Event
Ouch.. Works )) thx
|
| All times are GMT -4. The time now is 21:30. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.