GetTime function - 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: GetTime function (
/showthread.php?tid=542634)
GetTime function -
Blademaster680 - 20.10.2014
Hi.
I need a function that gives me the current time in a different timezone. Now I have a function that sets the time according to the timezone... So that all works perfectly fine. but now I am trying to make a function that will give me the time so I can easily get the time of that timezone.
I dont exactly know how to make a function like this and was hoping you guys can help with this.
I need it to return the hour, minutes and seconds.
This is what I have so far:
Код:
forward GetTime(hour, minute, second);
public GetTime(hour, minute, second);
{
gettime(hour, minute, second);
hour-9;
if(hour < 0)
{
hour+15;
}
else
{
hour-9;
}
return hour, minute, second;
}
Re: GetTime function -
TwinkiDaBoss - 21.10.2014
Why dont you let player choose the country on the beggining. Lets say for example they pick Serbia, just add +2 to their time and thats it.
Re: GetTime function -
Neil. - 21.10.2014
Quote:
Originally Posted by TwinkiDaBoss
Why dont you let player choose the country on the beggining. Lets say for example they pick Serbia, just add +2 to their time and thats it.
|
If you've watched the Computerphile video, it's a lot more complicated than just adding or subtracting hours to the GMT.