18.04.2014, 23:51
Why do you need an timer that checks if an hour passed?
Just create a timer who gets called each hour
To sycn it with the clock you just calculate the remaining seconds and call than the timer
Just create a timer who gets called each hour
pawn Код:
SetTimer("EachHour", 1000 * 60 * 60, true);
pawn Код:
// OnGameModeInit
HourTimer();
// global
forward HourTimer();
public HourTimer() {
// code
new
hour,
minute,
second
;
gettime(hour, minute, second);
SetTimer("HourTimer", (3599 - minute * 60 - seconds) * 1000, false);
}