29.11.2009, 19:55
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++;
if(counter == 0)
GameTextForAll("3", 500, 3);
else if(counter == 1)
GameTextForAll("2", 500, 3);
else if(counter == 2)
GameTextForAll("1", 500, 3);
else if(counter == 3)
GameTextForAll("1", 500, 3);
else if(counter == 4)
{
GameTextForAll("GO!", 500, 3);
counter = 0;
KillTimer(countTimer);
}
return true;
}
If it done 2 times in maximum 2 second the countdown will repeat for ever, it stops only if I close/restart server, Need help!
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++;
if(counter == 0)
GameTextForAll("3", 500, 3);
else if(counter == 1)
GameTextForAll("2", 500, 3);
else if(counter == 2)
GameTextForAll("1", 500, 3);
else if(counter == 3)
GameTextForAll("1", 500, 3);
else if(counter == 4)
{
GameTextForAll("GO!", 500, 3);
counter = 0;
KillTimer(countTimer);
}
return true;
}
If it done 2 times in maximum 2 second the countdown will repeat for ever, it stops only if I close/restart server, Need help!