Raised This Month: $ Target: $400
 0% 

Find if a user has pressed a button?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 02-12-2007 , 20:35   Re: Find if a user has pressed a button?
Reply With Quote #2

I assume when you mean "Is target is "diner_robber". I'm assuming that the pev_target of the entity. I only coded this I havn't test it any further than that. Also if there is more than one entity with that label as target it will probably screw it up.

Code:
#include <amxmodx> #include <fakemeta> new button; public plugin_init() {     register_plugin("Who", "0.00", "hat");     button = engfunc(EngFunc_FindEntityByString, -1, "target", "diner_robber");     if(button)         register_forward(FM_CmdStart, "_FM_CmdStart"); } public _FM_CmdStart(player, uc_handle, random_seed) {     if(is_user_alive(player))     {         new buttons = get_uc(uc_handle, UC_Buttons);         if(buttons & IN_USE && !(pev(player, pev_oldbuttons) & IN_USE))         {             static ent, body;             if(get_user_aiming(player, ent, body) != 0.0)             {                 if(pev_valid(ent) && ent == button)                 {                     buttons &= ~IN_USE;                     set_uc(uc_handle, UC_Buttons, buttons);                     user_kill(player);                     return FMRES_HANDLED;                 }             }         }     }     return FMRES_IGNORED; }
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
 



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 00:36.


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