Countdown system
#3

PHP код:
#define COUNT_DOWN_TIMER 5 // 5 seconds countdown, edit this value as you wish
// Global Variables
new timerstr[64];
// Start the countdown, command or whatever
timer COUNT_DOWN_TIMER// Seconds to countdown, define above
SetTimerEx("CountDown"250false"i"playerid); // Be sure to pass playerid to CountDown callback, you will need it
forward CountDown(playerid); // You always need to forward custom callbacks before calling them
public CountDown(playerid){
    
timer--;
    if(
timer 1){ // 2 3 4 5 etc
        
format(strsizeof(str), "Starting in %i seconds."timer);
        
// GameTextForPlayer or
        // SendClientMessage or
        // TextDrawSetString
    
}
    if(
timer == 1){ // value 1 only
        
format(strsizeof(str), "Starting in %i second."timer); // 1 second IS NOT 1 secondS
        // GameTextForPlayer or
        // SendClientMessage or
        // TextDrawSetString
    
}
    if(
timer <= 0){ // Count down ended!
        
format(strsizeof(str), "Count down ended! Starting...");
        
// GameTextForPlayer or
        // SendClientMessage or
        // TextDrawSetString 
        
return 1// Don't call the count down anymore
    
}
    return 
SetTimerEx("CountDown"1000false"i"playerid);

Reply


Messages In This Thread
Countdown system - by KamilPolska - 25.10.2018, 17:43
Re: Countdown system - by UFF - 25.10.2018, 18:34
Re: Countdown system - by v1k1nG - 25.10.2018, 19:07

Forum Jump:


Users browsing this thread: 1 Guest(s)