Setting timer in command
#2

Код:
new last[MAX_PLAYERS];
COMMAND:hello(playerid, params[])
{
    new string[256];
    if(GetTickCount() - last[playerid] < 5000)
    {
        new towait = floatround((5000 - (GetTickCount() - last[playerid])) / 1000, floatround_ceil);
        format(string, sizeof(string), "You have to wait %d seconds", towait);
    }
    else
    {
        last[playerid] = GetTickCount();
        //your hello command code
    }
    return 1
}
The keyword would be "GetTickCount" for you https://sampwiki.blast.hk/wiki/GetTickCount
not tried to compiled, so typos or missing brackets might be possible...
Reply


Messages In This Thread
Setting timer in command - by eikzdej - 02.02.2016, 14:20
Re: Setting timer in command - by Sascha - 02.02.2016, 14:34
Re: Setting timer in command - by Mencent - 02.02.2016, 15:58
Re: Setting timer in command - by eikzdej - 03.02.2016, 06:56

Forum Jump:


Users browsing this thread: 4 Guest(s)