03.08.2012, 00:17
(
Последний раз редактировалось Catalyst-; 03.08.2012 в 01:02.
)
Delete:
and replace it with this:
Put this in the /sweepagain command you was talking about:
Also, you no longer need:
If you need to check if the cooldown is over or not, use this:
Sorry if I made things confusing, but this way you don't need to use a timer, and can also see how long of the cooldown is remaining.
pawn Код:
DownSweeper[playerid] = 1;
SetTimer("CoolSweeper", 3600000, false);
pawn Код:
DownSweeper[playerid] = GetTickCount()+3600000;
pawn Код:
if(DownSweeper[playerid] > GetTickCount())
{
new string[60], time=DownSweeper[playerid]-GetTickCount();
time/=1000, time/=60;
if(time > 1)
format(string,sizeof(string),"Please wait %d minutes before using this command again!", time);
else if(time == 1)
format(string,sizeof(string),"Please wait 1 minute before using this command again!");
else
format(string,sizeof(string),"Please wait a few seconds before using this command again!");
SendClientMessage(playerid, 0xFF0000FF, string);
return 1;
}
pawn Код:
public CoolSweeper()
{
DownSweeper[playerid] = 0;
}
pawn Код:
if(DownSweeper[playerid] > GetTickCount())