23.01.2015, 09:23
Код:
SetTimerEx("<TimerName>", <time (1s is 1000)>, <boolean(can be called multiple times)>, "i", playerid<playerthatgetsthis>);
Код:
forward <TimerName>(playerid); public <TimerName>(playerid); { // insert code here that you want to put, this code appears after the timer has passed, so SendClientMessage(playerid, -1, "The timer has passed and you may report once more!.");
}
Hope this helps you with it, I don't understand timers so well either, so apologies if there are mistakes!
Actually I didn't read yours very well, so here's one I use for my own reports -----------
Add this to the top first:
Код:
new PlayerHasReported[MAX_PLAYERS]; // this is just a thing that indicates if the player has reported
Код:
if(PlayerHasReported[playerid] == 1) // this gets if the player has /report'ed in the last 10 seconds { SendClientMessage(playerid, COLOR_GREY, " Wait 10 seconds after sending a next report ! "); // self explainatory return 1; } // code here SetTimerEx("ReportReset", 10000, false, "i", playerid); // timer that stops you from reporting again in 10 seconds PlayerHasReported[playerid] = 1; // this is to say that they have reported in the last 10 seconds
Код:
forward ReportReset(playerid); public ReportReset(playerid) { if(IsPlayerConnected(playerid)) // checks if player is connected { if(PlayerHasReported[playerid] == 1) PlayerHasReported[playerid] = 0; // if player's 10 seconds cooldown is over then it allows them to report again } }
Sorry if I made any mistakes, I just woke up.