if(strcmp(cmd, "/countdown", true) == 0)
{
if (PlayerInfo[playerid]
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /coutdown [seconds(3-60)]");
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);
AdminLog(string);
}
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);
AdminLog(string);
}
}
return 1;
}
|