local spawnedPeds = {}
Citizen.CreateThread(function()
RequestAndWaitModel(`mp_m_freemode_01`)
local pos = GetEntityCoords(PlayerPedId())
for i=1,128 do
local a, b = i, 0
while a >= 10 do
b = b + 1
a = a - 10
end
local ped = CreatePed(4, `mp_m_freemode_01`, pos.x + a * 1.0, pos.y + 1.0 * b, pos.z - 1.0, 0.0, true, true)
SetPedHeadBlendData(ped, math.random(4, 20), math.random(4, 20), math.random(4, 20), math.random(4, 20), math.random(4, 20), math.random(4, 20), 1.0, 0.5, 1.0)
FreezeEntityPosition(ped, true)
SetBlockingOfNonTemporaryEvents(ped, true)
spawnedPeds[#spawnedPeds + 1] = ped
end
RegisterCommand("testReset", function() -- not working
for _,v in pairs(spawnedPeds) do
SetPedDefaultComponentVariation(v)
SetPedHeadBlendData(v)
SetPedComponentVariation(v, 0)
end
end)
end)
AddEventHandler("onResourceStop", function(r)
if r ~= GetCurrentResourceName() then return end
for _,v in pairs(spawnedPeds) do
DeletePed(v)
end
end)
Some people including me described this issue, here is a repro script to get it locally.
My head blend data stuff has been set after (all peds) spawned
I tried several workarounds, like resetting the pedâs blend data but without success (as expected)
But it could be nice (hard?) to add a new native for us, and then we could make a script that reset pedâs blend data once they are far from u
Not possible to fix anyway, putting it âon top of the listâ would mean there wonât ever be any development done on anything as this thing in itself is HIGHLY unlikely to be fixable.
Iâd like to see a work-around for this in ânormalâ OneSync.
We donât wanna go-to BigSync: we use AIâs for our scripts and interaction with these, and also we donât have 128 players (yet), as itâs a whitelisted RP server.
problems is that your character doesnât look like yourself, or rather your haircolor doesnât, when your joining as player 65 or higher. :<
One recent addition to plans is a ~128-240 max player mode with limited compatibility (players would still exist but player peds for them would not - so iteration might be tricky) using player ped culling as @PichotM has apparently successfully been running for quite some time.
If this mode would also set the maximum size of culled player peds to 64 in a radius (which might mean youâll not see players if more than this amount get close, without dynamic culling radiuses being implemented yet), the head blend issue should all but vanish (and there should also be a noticeable performance increase at that!).