How I Can Synchronize Server Gametime?
#1

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?
Reply
#2

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

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

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

Is it a custom clock?
Reply
#6

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;
}
Reply
#7

no, it is with the gamemode...

where im gonna put it bible?
Reply
#8

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;
}
Reply
#9

ok i'll try!
Reply
#10

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;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)