View Single Post
Lee
AlliedModders Donor
Join Date: Feb 2006
Old 06-26-2008 , 16:50   Re: How long a button has been held?
Reply With Quote #2

Code:
public client_PreThink(id) {     if(!is_user_alive(id))         return;         static Float:pressTime[33];         if(~pev(id, pev_button) & IN_ATTACK)     {         pressTime[id] = 0.0;     }     else if(!pressTime[id])     {         pressTime[id] = get_gametime();     }     else if(get_gametime() < pressTime[id] + 4.0)     {         RunEvent();     } }
__________________
No support via PM.

Last edited by Lee; 06-26-2008 at 16:55.
Lee is offline