10.12.2012, 15:33
you can do like this:
pawn Код:
new Countdown = -1,Timer1;
forward Countdownstart();
public Countdownstart()
{
Countdown --;
new string[128];
format(string,128,"%d~n~Seconds",Countdown);
GameTextForAll(playerid,string,1000,4);
if(Countdown == COMPETITIONTIME) {
GameTextForAll("Competition Finished!",1000,4);
KillTimer(Timer1);
Countdown = COMPETITIONTIME;
return 1;
}
Timer1 = SetTimer("CountdownStart",1000,0);
return 1;
}
CMD:startcountdown(playerid)
{
if(!IsPlayerAdmin(playerid)) return 0;
if(Countdown != COMPETITIONTIME) return SendclientMessage(playerid, -1,"ERROR: Countdown is already started");
Countdown = COMPETITIONTIME;
CountdownStart();
return 1;
}