SA-MP Forums Archive
/report timer - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /report timer (/showthread.php?tid=320149)



/report timer - Dripac - 21.02.2012

//alright, thanks


Re: /report timer - mitchboy - 21.02.2012

I should just do this:
When the player logs on: reportallowed = 1
when the player uses the command, the timer starts and reportallowed = 0
when timer finishes: reportallowed = 1
Sorry for the fact that i didn't write the code.


Re: /report timer - Vince - 21.02.2012

Don't use a timer for something banal like this; add this at the top in the body of the command:
pawn Код:
static
    lastReport[MAX_PLAYERS]; // note: static! That is very important

if((gettime() - lastReport[playerid]) < 60)
    return SendClientMessage(playerid, COLOR_RED, "Please wait at least 60 seconds.");

lastReport[playerid] = gettime();



Re: /report timer - mitchboy - 21.02.2012

Best option Vince, nice solution .