SA-MP Forums Archive
Clock - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Clock (/showthread.php?tid=419011)



Clock - Fernado Samuel - 27.02.2013

Removed


Re: Clock - Fernado Samuel - 27.02.2013

DUMP


Re: Clock - mamorunl - 27.02.2013

You have to synchronise the clock with SetPlayerTime (run a timer every second to increase your time and virtualise a clock)


Re: Clock - Fernado Samuel - 27.02.2013

Removed


Re: Clock - mamorunl - 27.02.2013

pawn Код:
new gHour, gMin;
onGameModeInit() { SetTimer("Timer", 1000, true); }
public Timer() {
    gMin++;
    if(gMin == 60) {
        gMin = 0;
        gHour++;
        if(gHour == 24) gHour = 0;
    }
    SetTime(gHour, gMin);
}
Not sure about the SetTime part. Can't remember the actual function. Maybe loop through all players and then SetPlayerTime or something. You got to figure that out on your own