10.11.2011, 23:12
Sorry but that didn't work the way I expected, I've done everything the way I should and heres what I got.
I still can spam the command, any solution?
pawn Код:
CMD:report(playerid,o[])
{
new rcd[MAX_PLAYERS];
new ctime = gettime();
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] || rcd[playerid] >= ctime + 15)
{
rcd[playerid] = ctime;
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 online administrators.");
}
else
{
SCM(playerid,COLOR_LIGHTBLUE,"You must wait 15 seconds in order to send another report!");
}