Hello,
before diving into my issue, here’s an overview of my server environment:
Server Environment
OS: Windows
Artifacts: b11535
DLC Level: 3258
Framework: ESX 1.10.10
Startup Arguments: +set sv_enforceGameBuild 3258 +set onesync_population false
OneSync: On (with infinity)
Caching Proxy: Yes
Other configuration variables
set sv_requestParanoia 1
set sv_filterRequestControl 0
set sv_experimentalNetGameEventHandler false
sets sv_pureLevel 1
set rateLimiter_stateBagFlood_rate 350
set rateLimiter_stateBag_rate 350
set rateLimiter_stateBag_burst 450
Problem
For quite some time now, I’ve been experiencing significant issues with multiple garage systems and other resources that utilize the client-side CreateVehicle
native.
Although this issue occurs infrequently, it’s persistent enough to frustrate both players and admins. I haven’t been able to identify the root cause.
Symptoms:
- Occasionally, the
CreateVehicle
function fails to spawn the vehicle entity. - The issue appears to bypass checks such as:
RequestModel(ModelHash)
if not IsModelInCdimage(ModelHash) then return end
and
while not HasModelLoaded(ModelHash) do
Wait(0)
end
These checks return “true” even when the vehicle model does not spawn.
- Players must reconnect to the server to restore vehicle spawning functionality.
- Add-on vehicles are predominantly affected, though vanilla vehicles have also shown this behavior.
Troubleshooting Steps Taken
- checked AntiCheat configuration, disabled any vehicle or entity related checks
- updated artifacts
- updated other resources like ox_lib
- Tested several methods for spawning vehicles and verifying model loading:
using ox_lib
local success, result = pcall(function()
return lib.requestModel(model, 5000)
end)
using native functions
if not IsModelInCdimage(ModelHash) then return end
RequestModel(ModelHash)
while not HasModelLoaded(ModelHash) do -- Waits for the model to load
Wait(0)
end
LKW = CreateVehicle(ModelHash, spawnCoords.x, spawnCoords.y, spawnCoords.z , heading, true, false)
SetModelAsNoLongerNeeded(ModelHash)
or using ESX’s SpawnVehicle functionality
RequestModel(model)
while not HasModelLoaded(model) do
Wait(0)
end
ESX.Game.SpawnVehicle(model, vector3(spawnCoords.x, spawnCoords.y, spawnCoords.z), spawnCoords.w, function(spawnedVeh)
(...)
end)
SetModelAsNoLongerNeeded(model)
I’ve had limited success using CreateVehicleServerSetter
for server-side spawning. However, this is not a viable long-term solution, as it introduces other issues, such as:
- Problems setting vehicle properties.
- Entity ownership changes occurring within a single tick.
So, I am currently really really confused and need urgent help fixing this problem.
I’d greatly appreciate your guidance. Thanks!