22.09.2016, 12:48
Quote:
I would rather not use timers. That's why I've got this function this function uses gettime rather than adding another timer
|
A timer with interval of 1 hour would do and then:
pawn Код:
// every 3 hours currently connected:
if (!(((gettime() - gPlayerJoin[playerid]) / 3600) % 3))
{
// level up..
}
pawn Код:
// every 3 hours in total:
PlayerInfo[playerid][TotalTime] = (gettime() - gPlayerJoin[playerid]) + PlayerInfo[playerid][TotalTime];
if (!((PlayerInfo[playerid][TotalTime] / 3600) % 3))
{
// level up..
}