10.11.2011, 22:37
Hey there,
I got a /report CMD that when a player uses it he must wait 15 minutes to use it again, heres what I got so far.
And heres the timer
Now my problem is, if I simply do such thing as
under the report CMD it'll call the timer without delay, directly, and if I repeat the time:
It will be called after the certain time I used above but it keeps on repeating and it's like impossible to kill it,
if theres a way to kill it or a better way to use a delay timer i'd be thankful if you post it here..
Thanks.
I got a /report CMD that when a player uses it he must wait 15 minutes to use it again, heres what I got so far.
pawn Код:
CMD:report(playerid,o[])
{
new msg[80],str[128],pname[MAX_PLAYER_NAME];
if(sscanf(o,"s[80]",msg)) return SCM(playerid,COLOR_LIGHTBLUE,"USAGE:/report [text]");
if(rcd[playerid] == 1) return SCM(playerid,COLOR_LIGHTBLUE,"You must wait 15 seconds in order to send another report!");
else
{
GetPlayerName(playerid,pname,sizeof(pname));
format(str,sizeof(str),"Report from %s(%i): %s",pname,playerid,msg);
SAM(COLOR_AQUA,str);
SCM(playerid,COLOR_YELLOW,"Your report has been sent to the administrators online.");
rcd[playerid] = 1;
delay:rtimer(playerid);
}
return 1;
}
pawn Код:
timer rtimer[10000](playerid)
{
rcd[playerid] = 0;
SCM(playerid,COLOR_GREEN,"You may send another report now!");
}
pawn Код:
rtimer(playerid);
pawn Код:
repeat rtimer(playerid);
if theres a way to kill it or a better way to use a delay timer i'd be thankful if you post it here..
Thanks.