Player Vehicles Randomly Despawning

It could be the setmissionentity thing. I have no script that cleans up/deletes vehicles. I’m looking through the code, and I do check to see if the vehicle exists before setting it.

First off - I’d try looking for where you are setting as mission entity and make sure you are properly defining what entity it is. Not all natives return specifically an entity ID. What native are you using to define what entity you are setting as mission?

I’m using C# and the methods included with it. https://github.com/citizenfx/fivem/blob/5db7a5cee1ae1de65b98ffc8c9a19521d7567352/code/client/clrcore/External/Player.cs#L587

Couple things I would try:

Comment out the usage of SetMissionAsMissionEntity to see if that stops the problem

Also - try using GET_VEHICLE_PED_IS_USING to get the entity ID?

Hello. Did you find a solution?

I use this one [Release] Simple Vehicle Control Script and same problem, I spawn a car, and I was driving down joshua and bam car was gone… I also noticed that cars are deleting while your next to them! So gay!

I have this problem too, not sure whats problem…

Locking script this one has a problem with saving the vehicle to a player. He has removed saving in his last release until he can figure out what is going on.

any fixes yet ive been on this issue for the last 5 days and running out of ideas literraly.

has there been a fix for this in any way we’re having the same problem

Nothing that I know of :confused:

alright so we tried removing the locksystem and to no prevail cars still poof out of existence even while driving it :confused:

do you have the newest version of es_extended?

yes we are running the latest version of es_extended

How to stop the vehicles from despawning that are spawned it by a script?
more specifically in mapmanager_client.lua a veh_generator script
CreateScriptVehicleGenerator(x, y, z, heading, 5.0, 3.0, hash, color1, color2, -1, -1, true, false, false, true, true, -1)

That is unrelated to this. You need to set them as a mission entity, unless you are having this bug, too.

where do i edit that

I use:
SetNetworkIdCanMigrate(id, true)
SetEntityAsMissionEntity(vehicle, true, true)
SetVehicleHasBeenOwnedByPlayer(vehicle, true)

And it is not working, vehicles stil despawning :frowning:

is there here a sollution for???
Here the same, walking in to a store come back outside car gone… People driving a car also despawning t he car while driving

I have a similar problem that vehicle despawns when a user goes little far away like after parking the car near farms like weed, coca etc. What can i do ?