Cars despawn when player gets far

Well, I just updated my server to the latest artifact and a strange bug appeared. Many players report that their vehicles despawn when they get away from them. That itself ain’t bad cause I understand that improves performance. The problem is that they despawn

  1. even if the player stays close
    2)almost instantly, so the bug practically renders teleporters useless.

Anyone has any idea on how to increase the time it takes to despawn or remove the feature completely. Also, I should mention that along with the artifact I updated my vMenu so that may be the issue.

Thanks in Advance

If no player is nearby, an entity gets deleted - this has always been the case except for a number of builds at some point where client-spawned script entities would be persistent, but that led to lots of issues where abuse scripts or badly-written spawn scripts would lead to persistent client crashes.

If you want a vehicle to remain persistent, spawn it on the server. A flag on the server to make a client-spawned vehicle persistent may be offered in the future, too.

I tried to spawn them on the server-side but It didn’t work

I have the same problem here, I am using version 2949 latest, how do I do what you say on the server side?

The native responsible for creating vehicles is now available on server side.


I tested it and they still despawn

I noticed on latest artifact with onesync infinity if a vehicle is spawned on the client it will persist even if the player gets out the the vehicle’s scope and nobody is around, but if the player leaves the server it will despawn. Is this intended behaviour?

I keep disappearing …

how do you use onesync?
+set onesync on
onesync_enabled true
onesync legacy

how do you use it?

set onesync on

I now switch to onesync legacy, and for now it works as long as I don’t disconnect from the server.

And if I am next to a car and the person disconnects, I cannot get in the car, it is bugged.

I use the code below for spawning vehicles and they despawn never.
Even if the player leaves the server, the vehicle don’t despawn.
I think that there is no more than this possible when it comes to despawning vehicles.

example.lua (client)

local vehicle = CreateVehicle(model, coords.x, coords.y, coords.z + 1.0, heading, true, false)

SetVehicleNeedsToBeHotwired(vehicle, false)
SetVehicleHasBeenOwnedByPlayer(vehicle, true)
SetEntityAsMissionEntity(vehicle, true, true)
SetVehicleIsStolen(vehicle, false)
SetVehicleIsWanted(vehicle, false)
SetVehRadioStation(vehicle, 'OFF')


set onesync_distanceCullVehicles true
set onesync_forceMigration true

this doesn’t work