AdvancedParking v4.11.1 - Persistent vehicles! [ESX] [QB] [QBOX] [OX] [Standalone]

Experimental Update v4.12.0e

Huge performance update and a couple of smaller changes and fixes!

  • Performance improvements:
    • Completely reworked spawning/updating of vehicles into a Quadtree for heavily optimized performance.
    • Reading player data is much more optimized now.
    • Spawning and updating vehicles further optimized.
    • Added onPlayerBucketChange event instead of reading bucket through native.
    • Added update limit per server tick to prevent too many vehicles being updated at once.
    • Prevention for multiple client side updates in a very short timeframe.
  • Complete overhaul to all SQL queries.
  • Added physics collision request on client side before setting any properties to potentially prevent vehicles falling through terrain etc.
  • Added headlight state to extra values.
  • Added executing resource name to debug lines of several exports.
  • Added native support for hrs_fuel.
  • Added Cleanup.onServerStart config option: If cleanup should run on server start only.
  • Added Cleanup.onScriptRestart config option: If cleanup should run on every script start.
  • Removed Cleanup.onScriptStart option.
  • Removed unused oldPlate parameter from UpdatePlate export.
  • Removed plate data check on spawn to add reliability and prevent duplicate spawns.
  • Removed the currently unused "attachment" related code.
  • Changed spawn timeout to 15 seconds.
  • Fixed vehicle being updated multiple times through CEventNetworkPlayerEnteredVehicle game event.
  • Fixed Tried to access invalid entity error when saving a vehicle using the saveOnlyOwnedVehicles config option.
  • Fixed /apdv command to be case-insensitive.
  • Fixed calling onEntityBucketChange event on vehicle spawn in bucket 0.
  • Fixed errors when other fuel resources used provide entry for LegacyFuel (and other resources).
1 Like

I have a suggestion.

Please add an option to cleanup all non owned vehicles after not being moved for x hours.

Separate settings for (un)owned vehicles are planned already :slight_smile:

Experimental Update v4.13.0e

  • Added vehicle being stored on /apdv command.
  • Added config options for each individual extra value.
  • Removed engine and headlight state from extra values as they were causing problems on server side.
  • Allow client side circumvention of blacklist when vehicle is already considered saved.
  • Fixed client and server timeout for spawning being too low (now 30 seconds). Should prevent vehicle duplication on spawn.
  • Fixed unnecessary damage updates being triggered while inside a vehicle.
  • Fixed day range for cleanup in config.

Experimental Update v4.13.1e

  • Shortened several debug lines.
  • Added additional check before spawning a vehicle.
  • Fixed race condition that could lead to duplicate spawns or other problems with deleted vehicles.
  • Fixed unnecessary query execution on failed spawn.

Experimental Update v4.13.2e

  • Added pool size warning threshold for CNetObjVehicle.
  • Added extra debug values to delete and update functions.
  • Fixed ap_id state bag vanishing causing duplicate vehicles.

Experimental Update v4.13.3e

  • Added “AP:updateVehicle” event to client side.
  • Fixed log system not sending Cfx id.
  • Removed lua54 entry from fxmanifest.

Experimental Update v4.13.4e

  • Added network id as fallback identifier to prevent duplicate vehicles.
  • Fixed printing of unnecessary Quadtree debug message.

Experimental Update v4.13.5e

  • Fixed native invocation error that could break the spawn/update loop.

Experimental Update v4.13.6e

  • Added missing debug logs to missing state bag issue.
  • Fixed wrong return values in missing state bag issue.

Experimental Update v4.13.7e “oopsie”

  • Fixed error when saving new vehicle.

Experimental Update v4.13.8e

  • Fixed major issue in optimisation layer.
  • Added debug command qtdebug for the optimisation (displays quadtree nodes and entities).
1 Like

Currently have an issue I believe may be due to another script… After restarts vehicle are out but players don’t get keys to the vehicle and jg-advancedgarages shows them as left out… Players then need to lockpick and hotwire to return vehicle to the garage… I know its something small I may be missing… Thx in advance.!!

Hey :wave:

Many key script only cache keys when e.g. they are given by the garage but this data will be lost upon restart.

There are several entries in the FAQ regarding key scripts.
But this entirely depends on what you are using of course.

If you require additional help, please join our Discord :slight_smile:

Is there an alternative to Kimi_callbacks ?

Nope. However you can get rid of it but you won’t be able to use the client side GetVehiclePosition(s) export.

There is not really a reason to get rid of it. It does not use any performance on its own. It’s just for the callbacks.

Did some kind of requirement change in the last few experimental versions? I updated to take advantage of the performance optimization, but everytime I’ve tried to update since then the script completely fails to run, complaining in the F8 console about every single .lua file being unable to run- some of them warn me about them containing “binary chunks”, iirc. Been having to stick with the same version that I downloaded in early October since then.

I can double check the exact errors when I have access to my other computer, but I thought it was worth checkin in incase it’s another case of something obvious.

You need to make sure to copy every single file to your server. This kinda sounds like it could be missing the fxap file.

While both versions are still compatible at the moment (upwards/downwards wise) you should consider completely removing the folder and just adding the new one. Do not just overwrite files etc.

(there were some problems with escrow recently and scripts were re-encrypted on the portal automatically, so make sure all files are up-to-date)

Can you tell me where the car tuning settings are stored?

There’s a problem with rcore_tuning

i Buy Buffalo, its black.

Change color to red

Restart server, and all perfect

I park the car in the garage
and then take the car out of the garage
Color and tuning default.

but when I get into the car, tuning is loading

Can you add compatibility with rcore_tuning or some help with fix.

When you park the car in a garage and you take it out, some tuning is missing… then it is the garage that does not save whatever rcore is doing there.

AdvancedParking basically saves everything including state bags (which could be why its working with AP itself; I don’t know if rcore is using state bags).

I assume that when you get the vehicle out of the garage and then you enter it, rcore checks its own tuning data and applies the stuff if it wasn’t on there in the first place.

I suggest first contacting rcore with whatever garage you are using. Maybe they have something for that one already.
AP’s data is all saved in the database in the table vehicle_parking. The format is very different from other scripts though. State bags are saved in a separate column.

1 Like

…see, that’s what really confuses me- since I’m paranoid and want to be able to easily revert back, I only change versions via the method you describe. I’m fairly certain I’ve even tried using it with and without the _experimental suffix to see if it changed anything. I thought for sure it was an issue of the fxap file being missing as well…

Either way, I’ll double check the errors the next time I’m able to, and sanity-check a full re-install on the offchance that I spaced and missed something in the process before.

1 Like

Feel free to contact us on Discord if the issue persists and I’ll be able to look directly.