29.11.2009, 21:22
pawn Код:
new counter;
new countTimer;
forward timer();
if(!strcmp(cmdtext, "/count", true) || !strcmp(cmdtext, "/countdown", true))
{
if(counter != 0)
return SendClientMessage(playerid, COLOR_YELLOW, "Wait 5 seconds,then try again!");
countTimer = SetTimer("timer", 1000, true);
return true;
}
public timer()
{
counter++;
else if(counter == 1)
GameTextForAll("3", 500, 3);
else if(counter == 2)
GameTextForAll("2", 500, 3);
else if(counter == 3)
GameTextForAll("1", 500, 3);
else if(counter == 4)
{
GameTextForAll("GO!", 500, 3);
counter = 0;
KillTimer(countTimer);
}
return true;
}