View Single Post
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 01-06-2017 , 16:57   Re: Ham_Touch spam issue
Reply With Quote #5

like that:
PHP Code:
// Here we insert the current times + the necesary time to wait
new g_Time[33];


public 
touchid )
{
    
// here we get the exact current seconds passed from map/server start.
    
new iCurrentTime floatroundget_gametime() );

    
// We check if 'now' is bigger or equal with the g_Time, wich means if he past 10 seconds.
    
if( iCurrentTIme >= g_Timeid ] )
    {
        
// Times passed, you can use now!
        // your code here ...


        // Also we update the time:
        // +10 , how many seconds he need to wait until he can use again the command.
        
g_Timeid ] = iCurrentTime 10;
    }

    else
    {
        
client_printid print_chat"wait %i seconds before use again this command!"g_Timeid ] - iCurrentTIme );    
    }


__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor