timer after command
#3

Simple. Create a variable, which saves the time of using the command.

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;
}
Don't forgot to reset variable after quit. (OnPlayerDisconnect)
Reply


Messages In This Thread
timer after command - by kingcrome - 16.11.2013, 19:30
Re: timer after command - by Diogo123 - 16.11.2013, 19:35
AW: timer after command - by Skimmer - 16.11.2013, 19:37

Forum Jump:


Users browsing this thread: 1 Guest(s)