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

the users, are having access to the spectate and administrator menu.
I’m using es_admin2 and esx_spectate.Thank you

while true do
for i = 1, #doorList do
local playerCoords = GetEntityCoords( GetPlayerPed(-1) )
if doorList[i][“ishash”] == 0 then
hash = GetHashKey(doorList[i][“objName”])
else
hash = doorList[i][“objName”]
end

I need to change this
for i = 1, #doorList do

   for i = 1, 256 #doorList do

?

1 Like

It is your loops, check above

this is not a player loop

1 Like

On the original onesync post they say to change loops from 31 to 255, why u say 256? is better or soemthing?

Read this OneSync+ and future work on OneSync @LIL_QK

ok, thanks, ikm working on a 128 server, do you have discord? so if i need help or something

@PichotM

Credits to @Sonnydg for the fix. This allows GCPhone to use the new mumble talk.

1 Like

I have problem with transactions - everyone get “no player nearby”
why?
I set all loops to 255 :frowning:
Thanks for help

Search for any player loops in this specific resource
Also if you are using ESX/ES you might need to specify “maxplayers” somewhere

I don’t understand where to put this to solve the voice problem :confused:

– 8.0 will be the default range, change it if you want Citizen.CreateThread(function() NetworkSetTalkerProximity(8.0) end)

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,