What happened?
Found another possible OneSync regression.
I have been struggling with vehicles despawning immediately after being spawned with:
CreateVehicle(model, x, y, z, heading, true, true)
The vehicles could appear briefly and then disappear without DeleteVehicle or DeleteEntity being called.
I traced this to an old server-side entityCreating handler:
AddEventHandler("entityCreating", function(entity)
local model = GetEntityModel(entity)
if model == 0 then
CancelEvent()
end
end)
This handler existed for a long time without causing problems.
After updating FXServer artifacts when the major onesync memory change was implemented (or somewhere around there), GetEntityModel(entity) now intermittently returns 0 for entities created by legitimate connected players.
During one 25 minute race, the condition was triggered 78 times across 13 legitimate players.
Because CancelEvent() was called, those entities were silently rejected. This explains why the affected vehicles appeared and then disappeared without any DeleteVehicle/DeleteEntity diagnostics.
After commenting out CancelEvent(), the model-zero events continued occurring, but the vehicles were no longer rejected.
Expected behavior:
For a valid client-created network entity, GetEntityModel during entityCreating should return its model hash, as it did on the previously used artifact.
Actual behavior:
GetEntityModel intermittently returns 0 during entityCreating. The entity is owned by a valid player and, when not cancelled, continues creation normally.
If model data is no longer guaranteed to be available during entityCreating, please confirm whether this is an intentional behavior change.
I am currently on 30707
Expected result
For a valid client-created network entity, GetEntityModel during entityCreating should return its model hash, as it did on the previously used artifact.
Reproduction steps
- Start a server with OneSync enabled.
- From a client script, load a vehicle model and spawn it using CreateVehicle(..., true, true).
- On the server, monitor the entity using the entityCreating event.
- Call GetEntityModel(entity) inside entityCreating.
- Occasionally, it returns 0 for a legitimate player-created network vehicle.
- Calling CancelEvent() when the model is 0 causes the newly spawned vehicle to disappear without any DeleteVehicle or DeleteEntity call.
- Without CancelEvent(), the entity continues creating normally and its model becomes available afterward.
Importancy
There's a workaround
Area(s)
OneSync
Specific version(s)
FiveM artifacts when the major onesync memory change was implemented or somewhere around there. I was updating artifacts as they come out thinking it was there.
Additional information
No response
What happened?
Found another possible OneSync regression.
I have been struggling with vehicles despawning immediately after being spawned with:
CreateVehicle(model, x, y, z, heading, true, true)
The vehicles could appear briefly and then disappear without DeleteVehicle or DeleteEntity being called.
I traced this to an old server-side entityCreating handler:
This handler existed for a long time without causing problems.
After updating FXServer artifacts when the major onesync memory change was implemented (or somewhere around there), GetEntityModel(entity) now intermittently returns 0 for entities created by legitimate connected players.
During one 25 minute race, the condition was triggered 78 times across 13 legitimate players.
Because CancelEvent() was called, those entities were silently rejected. This explains why the affected vehicles appeared and then disappeared without any DeleteVehicle/DeleteEntity diagnostics.
After commenting out CancelEvent(), the model-zero events continued occurring, but the vehicles were no longer rejected.
Expected behavior:
For a valid client-created network entity, GetEntityModel during entityCreating should return its model hash, as it did on the previously used artifact.
Actual behavior:
GetEntityModel intermittently returns 0 during entityCreating. The entity is owned by a valid player and, when not cancelled, continues creation normally.
If model data is no longer guaranteed to be available during entityCreating, please confirm whether this is an intentional behavior change.
I am currently on 30707
Expected result
For a valid client-created network entity, GetEntityModel during entityCreating should return its model hash, as it did on the previously used artifact.
Reproduction steps
Importancy
There's a workaround
Area(s)
OneSync
Specific version(s)
FiveM artifacts when the major onesync memory change was implemented or somewhere around there. I was updating artifacts as they come out thinking it was there.
Additional information
No response