SetWorldTime to your own time possible? - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: SetWorldTime to your own time possible? (
/showthread.php?tid=111884)
SetWorldTime to your own time possible? -
Meebly - 04.12.2009
Hi guys,
I was wondering if its possible to set the WorldTime on your server to your real time?
Example: When its 9:00 PM at your country, how do i set that in-game too?
Thank you,
Meebly.
Re: SetWorldTime to your own time possible? -
Meebly - 04.12.2009
Quote:
Originally Posted by Seif_
gettime will get the host's time. Check his location and find out his GMT, then find out yours and do the math.
|
Well i have checked a Roleplay script that includes it, but is it right?
I got this at the moment:
Код:
if (realtime)
{
new tmphour;
new tmpminute;
new tmpsecond;
gettime(tmphour, tmpminute, tmpsecond);
FixHour(tmphour);
tmphour = shifthour;
SetWorldTime(tmphour);
}
return 1;
}
Its from SAGC.
Re: SetWorldTime to your own time possible? -
RyDeR` - 04.12.2009
ex.:
Код:
tmphour+=1;
tmphour-=1;
If it's 12am for ex. it will make 1pm the other one make 11 am..
Re: SetWorldTime to your own time possible? -
Meebly - 04.12.2009
Thanks guys i got the SetWorldTime to the real time working.
It works very fine.