ts-lib to help you manage persisted vehicles in-game.
Permissions for these commands are fully configurable in
Config.Server.permissions inside shared/config.lua./persistence
Syntax
Description
Reloads the entire persistence system:- Unloads all currently spawned persisted vehicles.
- Reloads all vehicles from the database.
- Re-sends the vehicle grid to connected players (if your framework bridge supports it).
Permissions
Controlled byConfig.Server.permissions.reload(source).By default this uses the framework bridge (QBCore / ESX / etc.) and can be overridden in
shared/config.lua.
/bringvehicle
Syntax
Description
Teleports a persisted vehicle to the admin who ran the command:- Looks up the vehicle in
Server.Main.Vehiclesusing its persistence ID. - Updates its position and heading to match the admin’s current coordinates.
Parameters
| Name | Type | Description |
|---|---|---|
vehicleId | number | The persistence ID of the vehicle. |
Permissions
Controlled byConfig.Server.permissions.bringVehicle(source).
/setvehicleasTemp
Syntax
Description
Toggles whether a persisted vehicle should be considered temporary:- When set to temporary, the vehicle is removed from the database and tracked only in memory.
- When set back to permanent, it is re-inserted into the database with a new ID if needed.
Server.Main.Vehicle.SetTemp helper.
Parameters
| Name | Type | Description |
|---|---|---|
vehicleId | string | The current persistence ID of the vehicle. |
isTemp | boolean | true to mark as temporary, false for normal. |
Permissions
Controlled byConfig.Server.permissions.setVehicleTemp(source).