16.05.2020, 19:02
There's an easier way to do that. At first you define a variable which saves the timestamp at the moment where the player used that command.
And when he uses the command again, you simply subtract that value from the current timestamp and check whether the value is less than 10 (for 10 seconds) or not.
And when he uses the command again, you simply subtract that value from the current timestamp and check whether the value is less than 10 (for 10 seconds) or not.
pawn Code:
new lastCommandUsed[MAX_PLAYERS];
YCMD:money(playerid, params[], help)
{
if((gettime() - lastCommandUsed[playerid]) < 10)
return SendFormatMessage(playerid,-1,"Nu poti sa utilizezi aceasta comanda timp de %i secunde",delay[playerid]);
// your code
lastCommandUsed[playerid] = gettime();
return 1;
}