Persistent Vehicles

Persistent Vehicles is a simple resource to handle vehicle spawning (relatively efficiently) within your server. This resource is a dependency for current and future TebIT resources.

Setup

Config

  • There are no config options available for this resource.

  • The database is contained within the db/vehicles.json file. Consider creating a backup file before making any changes.

Dependencies

Conflicting Resources

  • Any other persistent vehicle resource that performs automatic clean-up of spawned vehicles.

  • Will not work by default with resources such as qb-vehiclekeys that require constant registration of player owned vehicles on spawn (works by default with `ti_vehicleKeys`).

Example

All events are prefixed with "ti_persistentVehicles:", and exports are registered under the same namespace without the prefix.

RegisterCommand("removeVehicle",function(source,args)    
    local vehiclePlate = args[1] or "ABC 123"

    exports["ti_persistentVehicles"]:removeVehicle(vehiclePlate)
    -- Or
    TriggerEvent("ti_persistentVehicles:removeVehicle",vehiclePlate)
end)    

Last updated