[Release] Additional Server Synchronization and ACL [1.0.6]

How do you set the time? With the commands provided, or with the reborn trainer/lambda menu? Any other mods that could possibly intervene with the time commands?

Already looking into the night issue, however if you set the time with the /time command then this should apply for everybody, even to newly connected players.

@MJRamon
In the server’s additional-sync.lua, change the third line to:
local secondOfDay = (ASData.time.h * 3600) + (ASData.time.m * 60) + ASData.time.s

It will fix your issue. Or update to 1.0.6.

1 Like

Updated to v1.0.6:

  • Time set in common/vars.lua will now be the default start time.
  • Config files are unaltered since last patch.
2 Likes

It did the trick. Thank you so much.

I change time on server with your command. /time NOON by example.
It works for everybody already here, but newly arrived players are still under night and have to pop the day again for everybody.

@MsQuerade
So, if I put crowd = 0 - there are no peds, as I wanted, but police (cops) are still there. How do I disable them too?

That’s beyond the scope of this script, but if you want a quick fix for that, get the lambda menu.

Hey, so i downloaded this script and everything was working fine.
Then something happened, the whitelist doesn’t work and none of the in game commands work either

Here is an image of what happens when someone connects to the server
https://gyazo.com/44633d8efa9cd3517811116875a0ad68

Any help is much appreciated

@MsQuerade

Hello Here,

Whitelist is working fine here. But just a stupid question,

How do you find your steamid like steam:1100001baadface ??

I mean i’m using https://steamid.io/ to find my steamid64 or other steamid information but how to convert to the format used by five m ???

edit : PROBLEM SOLVE (steamid64 --> hex)

It also shows in your server window/log when you try to connect and you get denied.

@the_welsh_vader
Hmm. Is that an old version you’re running, or are the files tampered with? I see warnings that shouldn’t be there in the first place. Is this something you can reproduce? Also please try the new version (you can likely keep your config files).

@MsQuerade

So this is what happens when I use this script,

I put the folders inside a folder called whitelisted in the resource folder and leave the config as is when downloaded.
I then go to citmp-server and add it to the list so the server knows its there, I start the server and the server is whitelisted and i’m unable to join. I then shut the server down and add an IP/steam id, delete the cache and restart the server. Then when someone who isn’t whitelisted on the server manages to join and I get that error every time someone does join.

Like I said before the script was working wonderfully and then something happened and now it doesn’t work at all. Do I need essential mode on the server for this script to work?

You don’t need essential mode. Do you know what that “something” is that happened? Would you mind zipping your folder and upload it, then send it to me (private message so any private data such as IPs won’t be public)? (Or for good measure, upload every resource you have if it’s not too big)

Good day,
@MsQuerade
I am currently having an issue… when i black out the server i am unable to “stop the blackout”…
Using “blackout 1” vs “blackout 0” changes nothing.
*I am running the commands in IceCon - everything appears to be working except the blackout argument in regards to stopping the blackout.
Any suggestions would be greatly appreciated!

Yep, I looked at the code and I can immediately see why.

Anyway, for the time being, you can use /blackout without any arguments to turn it off again.

If you or anyone want to make the change to make the argument work, change:

ASData.blackout = not not tonumber( table.remove( args, 1 ) )

to

ASData.blackout = tonumber( table.remove( args, 1 ) ) ~= 0 and true or false

1 Like

Thanks for the reply, Your suggestion worked!

I am now attempting to create a script which would check what time it is (in game) and @ 7am i want to script to trigger a event.

So far i have added only 1 .lua in the client folder which contains the following script:

RegisterNetEvent(‘MSQPlaySound’)
local MSQPlaySound = true

AddEventHandler(‘MSQPlaySound’, function(time)
Citizen.CreateThread(function()
while true do
Citizen.Wait(1)
if ASData.time.h = 7 then
TriggerEvent(‘example’)
end
end)
end)

**If anyone has the time, can you please review the above and let me know what im missing?

Remove that function entirely. Go to the client’s additional-sync.lua, find the thread function -- In-game Clock Manipulation Loop. You’ll want it to look something like the following:

-- In-game Clock Manipulation Loop
Citizen.CreateThread( function()
	while not hasBeenInitialised do
		Wait( 500 )
	end
	
	local timeBuffer = 0.0
	local triggered7amToday = false
	local triggered8amToday = false
	
	while true do
		Wait( 33 ) -- (int)(GetMillisecondsPerGameMinute() / 60)
		
		if not ASData.time.frozen then
			local gameSecond = 33.333 / ASData.time.rates.night
			
			if secondOfDay >= 19800 and secondOfDay <= 75600 then
				gameSecond = 33.333 / ASData.time.rates.day
			end
			
			timeBuffer = timeBuffer + round( 33.0 / gameSecond, 0 )
			
			if timeBuffer >= 1.0 then
				local skipSeconds = math.floor( timeBuffer )
				
				timeBuffer = timeBuffer - skipSeconds
				secondOfDay = secondOfDay + skipSeconds
				
				if secondOfDay >= 86400 then
					secondOfDay = secondOfDay % 86400
				end
			end
		end
		
		-- Apply time
		ASData.time.h = math.floor( secondOfDay / 3600 )
		ASData.time.m = math.floor( (secondOfDay - (ASData.time.h * 3600)) / 60 )
		ASData.time.s = secondOfDay - (ASData.time.h * 3600) - (ASData.time.m * 60)
		
		NetworkOverrideClockTime( ASData.time.h, ASData.time.m, ASData.time.s )
		
		-- Trigger time based events
		if ASData.time.h == 7 and ASData.time.m == 0 and triggered7amToday == false then
			triggered7amToday = true;
			TriggerEvent( "My7amEvent" );
		elseif ASData.time.h == 7 and ASData.time.m > 0 then
			triggered7amToday = false;
		end
		
		if ASData.time.h == 8 and ASData.time.m == 0 and triggered8amToday == false then
			triggered8amToday = true;
			TriggerEvent( "My8amEvent" );
		elseif ASData.time.h == 8 and ASData.time.m > 0 then
			triggered8amToday = false;
		end
	end
end)

It’s coded like this because you probably want the event to fire only once, and with the time rate in mind, it’s possible to skip seconds, that’s why you reset the variable when it’s safe to do so (when the minute has passed) so it won’t get called twice that day. You’ll still have to make your “My7amEvent” etc. yourself…

1 Like

Hi !

With es_roleplay, i have a weird and unconfortable bug. The game “blink” and “flash” sometimes ( like all the 20 sec), when i disable ACL, it’s gone.

Someone can help me with that ? I really need this script for whitelisting with SteamID

Update ! I tried to record the bug, and i think with what i found can help me to resolve the problem. The time set to to night like 0.3ms, and i don’t know why. I remove all the sync related in es_roleplay, but still happenning. I REALLY need you’re help guys ! :confused:

Video proof : https://www.youtube.com/watch?v=M0vtEf-MCBc

Screen taken in the record :

1 Like

Good day,

I wanted to ask if you could please point me to what string is syncing time as players are stating they are not syncing.

EDIT: My server is currently running 1.0.6

I’m assuming its the MSQASInit ?

Thanks in advance!

@Ryload I don’t know anything about es_roleplay but if it’s doing its own synchronization you really do need to disable that entirely (video is unavailable for me).

@J_Sickness Players should be syncing. The leading variable on the server is secondsOfDay. You are correct that MSQASInit initializes the client on spawn.

1 Like

Oh yeah sorry about the video, private Youtube shit… Well i tried to disable everything about sync in es_roleplay but even with that it didn’t work :frowning: