SA-MP Forums Archive
Using GetTime to form synced time. - 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: Using GetTime to form synced time. (/showthread.php?tid=360094)



Using GetTime to form synced time. - Kyle - 16.07.2012

Hi, Slice said to use this to get synced time but it's sort of incomplete:

He said place this under ongamemodeinit:
pawn Код:
g_ReferenceTime = gettime();
and then this under a function which calls every second:
pawn Код:
TimeHour = (gettime() - g_ReferenceTime) / 60 % 24;
TimeMinute = (gettime() - g_ReferenceTime) / 60;
He said the variables will now hold the time in which the setplayertime is, which makes them synced.

But what is wrong here?