21.03.2016, 15:17
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:
Inside the timer function:
You might want to replace the 600000 ms by a value that represents the duration of VIP.
Btw a timer cannot be local nor a stock, it can only call a public function.
Saving the tick for said moment:
Код:
PlayerGotVIPTick[playerid] = GetTickCount();
Код:
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! { // ... } }
Btw a timer cannot be local nor a stock, it can only call a public function.