[How-to] Adapt your script to OneSync and fix your issues

What is your issue

When you hear everyone during loading

what I’ve put should be fine
just pit this code snippet in one of your client script

Okay thanks <3

Hello @PichotM

First thanks for this tuto and time you take!!

I also have a question regarding the PNJ populations and traffic.

Do you have any suggestions to add those PNJ without see the backout ?

I use on my side:


--- Fonction régulation traffic et PNG Fontion 1 mais pas trop de png
Citizen.CreateThread(function()
    while true do
        Citizen.Wait(0) -- prevent crashing

        --These natives have to be called every frame.
        SetVehicleDensityMultiplierThisFrame(0.1) -- set traffic density to 0 
        SetPedDensityMultiplierThisFrame(0.3) -- set npc/ai peds density to 0
        SetRandomVehicleDensityMultiplierThisFrame(0.1) -- set random vehicles (car scenarios / cars driving off from a parking spot etc.) to 0
        SetParkedVehicleDensityMultiplierThisFrame(0.1) -- set random parked vehicles (parked car scenarios) to 0
        SetScenarioPedDensityMultiplierThisFrame(0.1, 0.1) -- set random npc/ai peds or scenario peds to 0
        SetGarbageTrucks(0) -- Stop garbage trucks from randomly spawning
        SetRandomBoats(0) -- Stop random boats from spawning in the water.
        SetCreateRandomCops(true) -- disable random cops walking/driving around.
        SetCreateRandomCopsNotOnScenarios(false) -- stop random cops (not in a scenario) from spawning.
        SetCreateRandomCopsOnScenarios(false) -- stop random cops (in a scenario) from spawning.
		
        
        local x,y,z = table.unpack(GetEntityCoords(PlayerPedId()))
        ClearAreaOfVehicles(x, y, z, 3000, false, false, false, false, false)
        RemoveVehiclesFromGeneratorsInArea(x -3000.0, y - 3000.0, z - 3000.0, x + 3000.0, y + 3000.0, z + 3000.0)
    end
end)
1 Like

Hey, since I turn my server on onesync 64 slots the esx advanced garage stoped working u can store the car but ti wont get deleted, i donnow if there is any snippet to fix this error.

My server runs fine with 100% of the traffic

1 Like

hey u dont solved this?
im having the same issue

Thanks for your answer, you mean that you don’t apply any reduce traffic or something else ?
I yes, about FPS drop have you got any impact? From what I have test, if you don’t reduce traffic or pnj density, the fps will go lower and we will have some explosion etc etc.

Do you use some script like CalmAI or no ?

Really thanks for help,

Didnt solve it D:

Client performances are in the OneSync todo.
In my opinion it is useless to disable IA…

1 Like

Ok thanks for answer.
When IA is not reducing we lost some FPS. (drop about 10-15fps so IG I have 70fps as I can have 135fps)
I need to investigate so if I have script that make any interaction with IA but I pretty sure that I haven’t.

Thanks again!

I think for i = 0, 31 to 255 and for i = 0, 32 to 256, it’s right ?

well now it is better to use https://runtime.fivem.net/doc/natives/#_0xCF143FB9

I’m sorry, but I’m not understand. Can you say more about this?

https://cookbook.fivem.net/2019/06/29/get_active_players-the-replacement-for-player-loops/

so that means I have to find the loop and change it like article?

Yes aa

Question : Can i use the mumble features without enabling onesync globally? I enjoy the audio quality much better than the default GTA:O however i only have needs for EUP and 32 slots lol

So the OneSync voice chat has no directional sound. I assume this is normal, but is there a fix for it? Reading through this thread I don’t see much about it?