When a player goes into a car dealership, then teleports across the map to see the vehicles via a resource like jg-advancedgarages, the vehicle they once had will be gone… This only applies to stolen cars it seems. This issue does not occur if they actually own the vehicle. Is there any way to prevent this? I’m using the QBCore framework.
Thank you.
Hey 
There are many factors to consider regarding vehicle persistence. It mostly depends on how you spawn a vehicle.
- Ambient spawn (like an NPC vehicle)? These will usually be gone if you are not close.
- client side through script? Can exist a little longer, doesn’t necessarily have to
- server side RPC native
CreateVehicle? Same as client side
- server side native
CreateVehicleServerSetter? Enables “persistence” for that vehicle. (This is not perfect but it prevents a lot of despawns)
- using
SetEntityOrphanMode server side? Nearly the same as the setter but it allows setting this “persistence” state after the vehicle has been spawned through other means.
Afaik jg-advancedgarages supports both client and server side (with the setter) spawning and with the latter automatically enables some persistence.
Tl’dr: You need a resource that does this for you and especially for all the problems that persistence still has even when using the correct native functions.
There are lots of persistence resources out there that allow saving vehicles even across server restarts, though most of them are paid. I do offer one myself:
https://forum.cfx.re/t/advancedparking/2099582 (shameless plug, I know
)
There are others though, so feel free to look around.
1 Like
I didn’t fully copy the documentation at first, so that’s my bad, so hoping this will be fixed next restart… It seems all vehicles are not deleting. I added the shared script to the QBCore manifest and hoping that will fix this issue…
I’ve seen you bought my script, thanks a lot

If you run into any issues please contact us in Discord (it’s linked in the readme, store etc). Answers will be faster and more detailed.
But yea, make sure to check the docs first. There is quite a lot in there by now 