06.01.2017, 00:37
You could do this:
Hope i understood your needs.
PHP код:
new connectTick[MAX_PLAYERS];
public OnGameModeInit()
{
SetTimer("paydaycheck", 3600000/*1 Hour*/, true);
}
public OnPlayerConnect(playerid)
{
connectTick[playerid] = GetTickCount();
}
forward paydaycheck();
public paydaycheck()
{
foreach(new player : Player)
{
new tickDifference = getTickDiff(GetTickCount(), connectTick[playerid]);
if(tickDifference >= 1500000/*25 Minutes*/)
{
PAYDAY();
}
}
}
stock getTickDiff(newTick, oldTick)
{
if (oldTick < 0 && newTick >= 0) {
return newTick - oldTick;
} else if (oldTick >= 0 && newTick < 0 || oldTick > newTick) {
return (cellmax - oldTick + 1) - (cellmin - newTick);
}
return newTick - oldTick;
}