Handling +use
Hi,
does some1 know, how 2 handle USE key for each player? Is there an event for this?? Thnx |
There's a function in the engine include and its called force_use(pPlayer, pEntity) where pEntity could be a hostage, or another player.
|
alien what exactly do you mean handle it? like stop it?
|
Oh, is he talking about blocking an event, I don't know I just thought he asked how to make a use command and all.
|
I mean, hook a function to that event. If there is any. Sorry for mismatch explanation :)
|
public client_PreThink(id)
{ new buttons = get_user_button(id) if(buttons & IN_USE)... } |
To disable it:
Code:
Hooking it normally: Code:
|
:(
I tried. It executes client_PreThink hundred times a second. Thats what I don't want. Watch this: Code:
It makes repeat_check_use( ) function called every CHECK_USE_PERIOD second. repeat_check_use( ) checks if player's pressing a button. That's what I'm trying to avoid ... because it's useless to check each player repeately whether he is trying to press E on his keyboard, if so, whether he is standing near the button. client_PreThink( ) does the same. I still believe, there is possibility to invoke an event when player presses USE key, but I have found none in meta game list. :( Can you help me? |
Oh, okay.. Then do this:
Code:
|
:(
Im sorry, my English sucks ... I'll ask simple: how to write something into print_chat when some1 presses USE key? :D |
| All times are GMT -4. The time now is 14:29. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.