Posts: 762
Threads: 157
Joined: Feb 2009
Reputation:
0
whats the best way to sync the game clock? right now i have a 1000 mil sec (1 sec) timer setting the second ++ every second to make sure all players clocks are synced... but the sky flashes allot and its really annoying... is there any way to fix this / better way to sync the clock?
i also had it synced to every minute before, but within that minute all the cocks get off of sync.....
any ideas?
Posts: 287
Threads: 16
Joined: Nov 2007
Reputation:
0
AFAIK the player clock that is used in single-player can only count minutes as real-life seconds (and hours as real-life minutes) and there's no changing that. So if you wanted it to be real-time, the clock would keep trying to increase 1 minute every second and you would have to reset it constantly for it to be accurate.
That's why I would just disable the player clock, create a textdraw that looks similar to the player clock, and use TextDrawSetString to update it.
I'm not too sure why your sky would flash though. Post your code?
Posts: 438
Threads: 8
Joined: Nov 2007
Reputation:
0
I suggest you not to use SetPlayerTime. SetWorldTime is better, it doesn't need to be synced and the time doesn't go until you do SetWorldTime once again.
Posts: 297
Threads: 47
Joined: Jun 2008
Reputation:
0
How are you suggesting me to use SetWorldTime(hour); since it only has one param ?
Grts Riz
Posts: 438
Threads: 8
Joined: Nov 2007
Reputation:
0
Weather does not actually differ a lot during 1 hour. So you can make your own clock with textdraw and use gettime(); to set minutes and hours(+SetWorldTime) to that textdraw.
Posts: 297
Threads: 47
Joined: Jun 2008
Reputation:
0
Ok, so you're saying, I should just make my own textdraw and each hour(rl minute) set the world time so the weather changes with it?
Fine by me but, anyone has the coцrdinates of a textdraw at the spot of the playertime? (right-top corner)
Grts Riz
Posts: 195
Threads: 16
Joined: Aug 2009
Reputation:
0
Ohai rizzy
I just wonder. Why should your string be posted in the console?
That would spam it alot unneccesary