27.02.2012, 13:56
i can do /countdown 1000000 well i dont want that.i want /countdown from 10 seconds!No matter the admin....giving rep
PHP код:
if(strcmp(cmd, "/countdown", true) == 0)
{
if (PlayerInfo[playerid][pAdmin] >= 3)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREEN, "USAGE: /countdown [seconds(3-10)]");
return 1;
}
new countdowns = strval(tmp);
if((countdowns > 60 || countdowns < 3) && PlayerInfo[playerid][pAdmin] < 1337) return SendClientMessage(playerid, COLOR_GREY,"* Seconds must not go above 60 or below 3!");
if(CountdownRunning == 0)
{
CountdownRunning = 1;
CountdownSeconds = countdowns;
CountdownTimer = SetTimer("CountDown",1000,true);
format(string, sizeof(string),"~p~Countdown: ~w~%d",countdowns);
TextDrawSetString(Textdraw46, string);
TextDrawShowForAll(Textdraw46);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Announced a Countdown: [Seconds: %s]",d,m,y,h,mi,s,sendername, countdowns);
}
else
{
KillTimer(CountdownTimer);
TextDrawHideForAll(Textdraw46);
CountdownRunning = 1;
CountdownSeconds = countdowns;
CountdownTimer = SetTimer("CountDown",1000,true);
format(string, sizeof(string),"~p~Countdown: ~w~%d",countdowns);
TextDrawSetString(Textdraw46, string);
TextDrawShowForAll(Textdraw46);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Announced a Countdown: [Seconds: %s]",d,m,y,h,mi,s,sendername, countdowns);
}
}
return 1;
}