Callback being called on hour starts
#4

Why do you need an timer that checks if an hour passed?
Just create a timer who gets called each hour

pawn Код:
SetTimer("EachHour", 1000 * 60 * 60, true);
To sycn it with the clock you just calculate the remaining seconds and call than the timer
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);
}
Reply


Messages In This Thread
Callback being called on hour starts - by Baltazar - 18.04.2014, 21:14
Re: Callback being called on hour starts - by Bingo - 18.04.2014, 21:16
Re: Callback being called on hour starts - by Baltazar - 18.04.2014, 21:19
AW: Callback being called on hour starts - by Nero_3D - 18.04.2014, 23:51

Forum Jump:


Users browsing this thread: 4 Guest(s)