Changing IPL loader settings for the whole server mid-session?

Hey, people. I work on an a very modular IPL loader that I would like to release for everyone here, once it will be finished with all ideas and settings I have in mind.

I ran into one problem and that is how to make the loader to be able to switch settings client side even for those that are about to join.

Quick written demonstration - we’re about to race and I’m loading specific obstacles for the whole server in a form of an IPL props. Some late comers, however, need to be also able to register this IPL being switched on for the event.

How would I go about that? I have config.lua as shared file. It works fine for those that are already connected. I’m focusing on those late arrivals now. So, I was trying to come up with something like this.

Another solution might be to compare/replace the client config with whatever comes from the server side upon joining the server in a form of a callback, right? But I think there might be a more elegant solution. Please, correct me, if I’m saying something off, thank you.

QBCore.Commands.Add("cls", "Loads in particular IPL for the whole server (Admin Only)", {{name="IPL name", help="Load in specific IPL (map) for everyone."}}, false, function(source, args)
	local src = source
-- works fine, but only for players that are already in the session
	if args[1] then
		TriggerClientEvent('qb_maploader:ChangeSettings', -1, args[1])
	end
--
-- something like this should take care of the same setup for those that are about to come yet before the server restart
	if Config.IPLs[args[1]].DefaultState4all ~= nil then
		if Config.IPLs[args[1]].DefaultState4all == false then
			Config.IPLs[args[1]].DefaultState4all = true
			print('true')
		else 
			Config.IPLs[args[1]].DefaultState4all = false
			print('false')
		end
	else
		print('Not available')
	end
end, "admin")

Would’ve been more ideal for you to have posted your solution