Skip to main content
You can verify if the script is running by checking for the resource state:

Warning

Networked Vehicles

All vehicle entities must be networked in order to be persisted. If a non-networked vehicle is passed, the script will return nil or indicate failure.

Exports

IsVehiclePersistenceDisabled

Check if persistence is disabled for a vehicle.
Returns:
  • boolean: true if persistence is disabled, false otherwise.

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, nil otherwise.

UpdateVehicle

Manually update the persistence data for a vehicle.
Returns:
  • boolean | nil: true if successful, nil otherwise.

GetVehiclePersistenceId

Get the persistence ID of a vehicle.
Returns:
  • string | nil: The persistence ID if found, nil otherwise.

GetVehiclePersistenceData

Get the full persistence data for a vehicle.
Returns:
  • table | nil: The vehicle data table if found, nil otherwise.
The returned table contains information such as:
  • netId: Network ID
  • plate: Vehicle plate
  • coords: Position
  • hash: Model hash
  • model: Model name
  • props: Vehicle properties (mods, colors)
  • trailer: Trailer data
  • doorStatus: Door locks
  • damageData: Health and fuel
  • deformation: 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: true if successful, false otherwise.
Last modified on March 5, 2026