Raised This Month: $ Target: $400
 0% 

Detect +USE key


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Orangutanz
Veteran Member
Join Date: Apr 2006
Old 11-10-2007 , 09:58   Re: Detect +USE key
Reply With Quote #4

Quote:
Originally Posted by travo View Post
is there a way to detect if the +USE "e" key is press in the plugin_init()?

what i want to do is, have a function called if anyone press the use key. Is there are way to do this in the init with an event or do i have to do it through client_PreThink?

It is only used to trigger my function so i dont need to know if its held and it isnt going to be pressed over and over, so i dont want it to be check excessively.

thanks
You need to hook:
register_forward( FM_CmdStart, "CmdStart" )
Code:
public CmdStart( const id, const uc_handle, random_seed ) {     if ( !is_user_alive( id ) )         return FMRES_IGNORED     static buttons     buttons = get_uc( uc_handle, UC_Buttons )     if ( buttons & IN_USE )         // Do something here         buttons &= ~IN_USE // Block them from using perhaps?     set_uc( uc_handle, UC_Buttons, buttons ) // Update buttons then supercede     return FMRES_SUPERCEDE }
The above method activates when a user actually presses a button and other things.
__________________
|<-- Retired from everything Small/Pawn related -->|
You know when you've been Rango'd
Orangutanz is offline
 



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 01:13.


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