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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: clock (/showthread.php?tid=201224)



clock - stix - 20.12.2010

i got a real life time

and i dont mean the time in game is the time is where the server is being hosted at

i want that each time the server restart it sets the time to 6 am and each 30 seconds IG is 1 min IRL

so i did it

but i cant fix the clock, it gets my real life time and shows it in the textdraw instead game time

so how to fix

heres the FS:

public UpdateTime()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
new Hour, Min;
gettime(Hour,Min);
new string[16];
format(string, sizeof(string), "%02d:%02d", Hour, Min);
SetPlayerTime(i, Hour, Min);
TextDrawSetString(Clock[i], string);
}
return 1;
}


Re: clock - admantis - 20.12.2010

gettime gets the SERVER time not the GAME time. What you can do is sync them bot

public UpdateTime()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
new Hour, Min;
gettime(Hour,Min);
SetWorldTime(Hour);
new string[16];
format(string, sizeof(string), "%02d:%02d", Hour, Min);
SetPlayerTime(i, Hour, Min);
TextDrawSetString(Clock[i], string);
}
return 1;
}

so time will be same as ServerTime


Re: clock - stix - 20.12.2010

Thank you for your cooperation, sir.

but still it didnt work

clock still says real life time