countdown cmd problem
#1

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:
Код:
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;
}
Thanks in advance.
Reply


Messages In This Thread
countdown cmd problem - by Sojo12 - 24.03.2014, 14:52
Re: countdown cmd problem - by Konstantinos - 24.03.2014, 14:56
Re: countdown cmd problem - by Jefff - 24.03.2014, 15:50
Re: countdown cmd problem - by Hanuman - 24.03.2014, 16:16
Re: countdown cmd problem - by Sojo12 - 25.03.2014, 14:49

Forum Jump:


Users browsing this thread: 1 Guest(s)