Always check
#3

I'd recommend saving the actual tick (GetTickCount()) of the moment when the player got VIP, then you know exactly when the time is up. A timer will produce slight offsets with each call, since they are never precise.

Saving the tick for said moment:

Код:
PlayerGotVIPTick[playerid] = GetTickCount();
Inside the timer function:

Код:
new curTick = GetTickCount();

for(new i = 0; i < MAX_PLAYERS; i ++)
{
    if(!IsPlayerConnected(i) || IsPlayerNPC(i)) continue; // Skips non-connected players & NPCs

    if(curTick - PlayerGotVIPTick[i] > 600000) // 10 mins passed, but you have to check if that player actually has VIP!
    {
        // ...
    }
}
You might want to replace the 600000 ms by a value that represents the duration of VIP.

Quote:
Originally Posted by Harty
Посмотреть сообщение
Use a global timer + for(new...), then into the timer stock, insert your 'check' functions.
Btw a timer cannot be local nor a stock, it can only call a public function.
Reply


Messages In This Thread
Always check - by Ax3l123 - 21.03.2016, 14:53
Respuesta: Always check - by Harty - 21.03.2016, 14:57
Re: Respuesta: Always check - by NaS - 21.03.2016, 15:17

Forum Jump:


Users browsing this thread: 1 Guest(s)