Raised This Month: $ Target: $400
 0% 

Button Pressed in PreThink


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Flipper_SPb
Senior Member
Join Date: Jun 2009
Location: Worldspawn
Old 03-19-2011 , 04:41   Re: Button Pressed in PreThink
Reply With Quote #2

I tried this code. Works fine.

PHP Code:
new  gLastTime[33
new 
gTimeLeft[33]

......

public 
client_PreThink(id)
{    
    if( 
get_user_buttonid ) & IN_USE )
    {
        if( 
get_user_oldbuttonid ) & IN_USE )
        {
            
            if( 
get_systime() - gLastTime[id] < )
                return;
            
            
client_printidprint_center"You are holding use. [%i]"gTimeLeft[id] );
            
            
gTimeLeft[id]--;
            
            
gLastTime[id] = get_systime();
            
            if( 
gTimeLeft[id] == 
            {

                
gTimeLeft[id] = 20;
                return;
            }
        }
        
        else 
gTimeLeft[id] = 20;
    }
    
    return;

I see count back
__________________
Полный похуизм.
Flipper_SPb is offline
Send a message via ICQ to Flipper_SPb
 



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 14:34.


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