Warning
Networked Vehicles
All vehicle entities must be networked in order to be persisted. If a non-networked vehicle is passed, the script will returnnil or indicate failure.
Exports
IsVehiclePersistenceDisabled
Check if persistence is disabled for a vehicle.
Returns:
boolean:trueif persistence is disabled,falseotherwise.
SetVehiclePersistenceDisabled
Enable or disable persistence for a vehicle.CreateVehicle
Manually create persistence data for a vehicle. This is usually handled automatically, but can be forced if needed.
Returns:
string|nil: The persistence ID if successful,nilotherwise.
UpdateVehicle
Manually update the persistence data for a vehicle.
Returns:
boolean|nil:trueif successful,nilotherwise.
GetVehiclePersistenceId
Get the persistence ID of a vehicle.
Returns:
string|nil: The persistence ID if found,nilotherwise.
GetVehiclePersistenceData
Get the full persistence data for a vehicle.
Returns:
table|nil: The vehicle data table if found,nilotherwise.
netId: Network IDplate: Vehicle platecoords: Positionhash: Model hashmodel: Model nameprops: Vehicle properties (mods, colors)trailer: Trailer datadoorStatus: Door locksdamageData: Health and fueldeformation: Visual deformation (if plugin enabled)
You can find the detailed breakdown of the returned data structure in the Data Structure page.
ForgetVehicle
Forget the persistence entry for a vehicle, completely removing it from the persistent system and the database.
Returns:
boolean:trueif successful,falseotherwise.