Hello There, Guest! Login or Register


Time on commands
#2
Use the function, GetTickCount();

Code:
new WaitDelay[MAX_PLAYERS],
    String[32];

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (!strcmp(cmdtext,"/test"))
    {
        new waittime = gettime() - WaitDelay[playerid];

        if (waittime < 5)
        {
            format(String, sizeof(String), "You need to wait %d seconds!", 5 - waittime);
            SendClientMessage(playerid, 0xFF0000FF, String);
        }
        else
        {
            SendClientMessage(playerid, 0x00FF00FF, "Ok!");
            WaitDelay[playerid] = gettime();
        }
        return true;
    }
    return false;
}
Reply


Messages In This Thread
Time on commands - by Dimplex - 05-01-2008, 01:33 AM
Re: Time on commands - by Jay - 05-01-2008, 01:55 PM