Custom Server time
#7

1. Declare two variables - one to store the current hour and one to store the current minute.
2. Set a repeating one second timer to increase the current minute. If the current minute reaches 60, set it to 0 and increase the current hour. If the current hour reaches 24, set it to 0.
3. Set a player's time when the spawn or perhaps periodically (once a minute?) to keep players' time in sync.

Note that with TogglePlayerClock enabled, if a player pauses, their clock will pause for the duration they are paused. So perhaps also sync the time when a player unpauses (when no longer paused, detected using OnPlayerUpdate).

Hope this was helpful, unless you are attempting to do something different from this?
Reply


Messages In This Thread
Custom Server time - by NoahAntilles - 21.03.2019, 20:22
Re: Custom Server time - by NoahAntilles - 21.03.2019, 21:43
Re: Custom Server time - by NoahAntilles - 22.03.2019, 09:41
Re: Custom Server time - by Kaliber - 22.03.2019, 09:51
Re: Custom Server time - by NoahAntilles - 22.03.2019, 16:21
Re: Custom Server time - by NoahAntilles - 05.04.2019, 15:49
Re: Custom Server time - by MP2 - 06.04.2019, 15:56
Re: Custom Server time - by NaS - 06.04.2019, 16:54

Forum Jump:


Users browsing this thread: 1 Guest(s)