Server side

Server side exports

All the mentioned exports are part of the client, therefore it is recommended to use them in the client for general checks on other resources.

Obtain the plate natively

This is a simple copy and paste code to integrate it into your code to obtain the plate.

local model = GetDisplayNameFromVehicleModel(GetEntityModel(veh))
local plate = GetVehicleNumberPlateText(veh)

Impound vehicle

exports['qs-advancedgarages']:impound(plate)

Spawn a vehicle externally

This export is for spawning a vehicle externally so that the persistence value is added to it.

All values requested by the export are sql values, in case of esx from the owned_vehicles table or qbcore player_vehicles table.

-- id: vehicle id (owned_vehicles > column id)
-- owner : identifier del jugador
-- vType : car, boat, plane
-- coords : spawn the car
-- props :get modifications (owned_vehicles > vehicle) 
-- source : the player 
-- warp: Spawning inside the car or not
exports['qs-advancedgarages']:SpawnVehicle(id, owner, vType, coords, props, source, warp)

Give persistence to new vehicle

For a vehicle to be persistent, it must have been in the garage first, this means that if you buy a car from your dealership, it would not have persistence until you have stored it in the garage first.

To solve this, we created a server-side export, which will be added at the time the vehicle spawns.

Please, if you need help, ask your trusted developer for help.

-- vehicle: netId from vehicle
exports['qs-advancedgarages']:setVehicleToPersistent(vehicle)

Last updated