23.12.2013, 14:29
newbienoob - There's a method that is much better than that , I will share it to you, you could use the function gettime, to create a timer for a command, I used to use the first method, creating a second timer and loop it, but when the callback gets larger, You will experience lag, but the code below is just amazing
pawn Code:
CMD:healme(playerid, params[])
{
static
HealTimer[ MAX_PLAYERS ] = { 0, ... }
;
if( (gettime( ) - HealTimer[playerid] ) < 60)
return SendClientMessage(playerid, -1, "Please wait 1 minute before using this command again!");
HealTimer[playerid] = gettime();
SetPlayerHealth(playerid, 100);
IsHealed[playerid] = 1;
return 1;
}