[Release] server real time resource

The resource will sync the game clock and set game clock same the server clock.
I fixed the flash bug and i improved the code.
Download: Click on me

15 Likes

good joob my guy i wll use it for sure

thank you

Hello, I wanted to know a precision on the resource in question, because the problem that I have to meet with this type of mods is that the time of the customers does not all synchronize at the same time.

ex: Customer1 France = 14h30 Client 2 Algeria = 15h30!

Could you have a way to code cella according to the time of the server?

1 Like

if SetClientRender set to false then the time will be according to the time of the server
if SetClientRender set to true then the time will be according to the client computer time
in the default it false
if SetClientRender set to false then it have full synchronize

nice i made this too. I think mine is better.

if you think your is better then release it

4 Likes

Oh you have client os time…
Very nice.

The server time sync seems to work good for me when I tested! Going to use this! Nice one mate! Thanks!

4 Likes

so how do I do what you are mentioning in post

function SetClientRender(render)
if not render then render = false end
if render then render = true end
clientrender = render
TriggerClientEvent(“realtime:event”, -1, “ClientServer”, clientrender)
end

for full sync

mine didn’t work… I just drag and drop and added line on ctg and nothing changed?

if you want the client render the time then do this: exports.realtime:SetClientRender(true) [in server side]
if you want the server render the time then do this: exports.realtime:SetClientRender(false) [in server side]

You have to put this resource in resources folder did you do this?
Did you add to server.cfg start realtime?

okay thank you
:smiley:

I think im just really stupid but i dont understand how you supposed to get this to work…

I understand everything except

if you want the client render the time then do this: exports.realtime:SetClientRender(true) [in server side]
if you want the server render the time then do this: exports.realtime:SetClientRender(false) [in server side]

Like what am i supposed to do? Add it where? into your script? into esx? to the server.cfg?
like im so confused here… :confused:

example to how use this:
if you want to change it when something happens then you have to use it like this:

RegisterCommand("servertime", function(source, args, rawCommand)
	exports.realtime:SetClientRender(false)
end, false)

RegisterCommand("clienttime", function(source, args, rawCommand)
	exports.realtime:SetClientRender(true)
end, false)

you can put it in which server side that you want

if you want that it change only one time then put this:

SetClientRender(false/true)

in the end of the file in rt_server.lua in the realtime resource

2 Likes

OHHHHH I get it now totally! Right! Well that was simple now, i think you should add what you just said to the top post it would make it a lot more easier for others, like literally i was so confused but now that you said it, it totally makes sense thank you very much <3

1 Like

is there away to make it sync to the server time but then offset it to GMT -6. Reason is time of server will be GMT, however, I would like it set to my time zone which is GMT -6. If it is, what would be the coding to do so.

Could you do some tutorial of really how to add on the server? you put a lot of code and do not give any explanation of where to put them…

I added it to my server and it kept blinking the screen (black)

It is flashing the screen (white flashes)

For me too.

This works really well thank you sir. :smiley: @idan12