SA-MP Forums Archive
How I Can Synchronize Server Gametime? - 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: How I Can Synchronize Server Gametime? (/showthread.php?tid=510179)



How I Can Synchronize Server Gametime? - spykidz01 - 30.04.2014

hello ! i got a problem in my server, when i quit for example the time is 7:00 and join again, the time go back away to start 0:00 , how can i sync to just continue its time even i quit the server?


Re: How I Can Synchronize Server Gametime? - SickAttack - 30.04.2014

Post your code, or we can't help you.


Re: How I Can Synchronize Server Gametime? - spykidz01 - 30.04.2014

hm, what is the name of that code in my gamemode?


Re: How I Can Synchronize Server Gametime? - SickAttack - 30.04.2014

lol who knows, it's yours so you should know.


Re: How I Can Synchronize Server Gametime? - itsCody - 30.04.2014

Is it a custom clock?


Re: How I Can Synchronize Server Gametime? - AndySedeyn - 30.04.2014

This should do.

pawn Код:
new timeshift = -1;
new shifthour;

forward FixHour(hour);
public FixHour(hour)
{
    hour = timeshift+hour;
    if(hour < 0) { hour = hour+24; }
    else if(hour > 23) { hour = hour-24; }
    shifthour = hour;
    return 1;
}



Re: How I Can Synchronize Server Gametime? - spykidz01 - 30.04.2014

no, it is with the gamemode...

where im gonna put it bible?


Re: How I Can Synchronize Server Gametime? - AndySedeyn - 30.04.2014

This should do.

place this on top of your script.
pawn Код:
new timeshift = -1;
new shifthour;
Place this somewhere at the bottom of your script under the standard publics.
pawn Код:
forward FixHour(hour);
public FixHour(hour)
{
    hour = timeshift+hour;
    if(hour < 0) { hour = hour+24; }
    else if(hour > 23) { hour = hour-24; }
    shifthour = hour;
    return 1;
}



Re: How I Can Synchronize Server Gametime? - spykidz01 - 30.04.2014

ok i'll try!


Re: How I Can Synchronize Server Gametime? - spykidz01 - 30.04.2014

i got this warning!
Код:
C:\Users\Louis Alcosaba\Desktop\SAMP GAMEMODES\MWCNR\Most Wanted Cops and Robbers v1.1\gamemodes\MWCNR.pwn(1600) : warning 204: symbol is assigned a value that is never used: "shifthour"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
line 1600

Код:
shifthour = hour;