24.03.2014, 14:52
I took this code here in the forum itself but when i type the command,it executes properly but it shows 'GO!!"it keeps on repeating that and dont stop.I'm confused and need help from you!
Here is my code:
Thanks in advance.
Here is my code:
Код:
new TimerCount; dcmd_countdown(playerid, params[]) { new string[128]; new pName[24]; GetPlayerName(playerid,pName,24); if(sscanf(params, "i", TimerCount)) return SendClientMessage( playerid, -1, "{FF0099}[ADMIN]{FFFFFF}/countdown [time]" ); if((TimerCount < 1) || (TimerCount > 20)) return SendClientMessage(playerid, -1, "{FF0000}[ERROR]{FFFFFF}You can start a countdown from 20 only!"); TimerCount = SetTimer("DTime", 1000, true); format(string,sizeof(string),"{FF0099}[ADMIN]{FFFFFF}%s has initiated a countdown starting from %d",pName,TimerCount); SendClientMessageToAll(COLOR_ADMIN,string); return 1; } public DTime() { new string[128]; if(TimerCount == 0) { KillTimer(TimerCount); GameTextForAll("~r~GO!!!", 1000, 6); return 1; } format(string, sizeof(string), "~g~%d", TimerCount); GameTextForAll(string, 1000, 6); TimerCount--; return 1; }