16.11.2013, 19:37
Simple. Create a variable, which saves the time of using the command.
Don't forgot to reset variable after quit. (OnPlayerDisconnect)
pawn Code:
new KITVIP_TICKER[MAX_PLAYERS];
pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/kitvip", cmdtext, true, 10) == 0)
{
if((gettime() - KITVIP_TICKER[playerid]) < ((1000 * 60) * 20)) return SendClientMessage(playerid, -1, "Please wait before using this command again.");
KITVIP_TICKER[playerid] = gettime();
// The command
return 1;
}
return 0;
}