Server Exports

Here you will find all the useful exports for this asset, please read each step and example carefully to better understand how it works, we do not recommend using these if you are not an experienced developer.


impound

Impounds a vehicle by specifying the plate.

-- plate: Select the license plate of the vehicle to seize
exports['qs-advancedgarages']:impound(plate)

SpawnVehicle

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 (player_vehicle > column id)
-- owner: Player identifier
-- vType: Vehicle, boat, plane (player_vehicle > column type)
-- coords: Spawn the car
-- props: Get modifications (player_vehicles > column mods)
-- source: Player source
-- warp: Spawning inside the car or not
exports['qs-advancedgarages']:SpawnVehicle(id, owner, vType, coords, props, source, warp)

setVehicleToPersistent

Give persistence to an external vehicle, spawned through external vehicleshops or spawn assets that you have on your server.

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

removeVehicleFromPersistent

Removes the persistence of one or more vehicles so that they can be removed from the map after native events. You can use it with one or more vehicles.

-- plate: one or more plates
exports['qs-advancedgarages']:removeVehicleFromPersistent(plate)

-- example with more plates
exports['qs-advancedgarages']:removeVehicleFromPersistent(plate1, plate2, plate3)

updateVehiclePlate

Change the old plate for a new one with this export, this allows instant plate change and you should add it in your change plate asset, if you have one, otherwise ignore it.

-- plate: Your actual vehicle plate
-- newPlate: Your new vehicle plate
exports['qs-advancedgarages']:updateVehiclePlate(plate, newPlate)

An example of using this system would be the following.

RegisterCommand('changeplate', function(source)
    local vehicle = GetVehiclePedIsIn(GetPlayerPed(source), false)
    if not DoesEntityExist(vehicle) then return end
    local plate = GetVehicleNumberPlateText(vehicle)
    local newPlate = 'PEPERONI'
    exports['qs-advancedgarages']:updateVehiclePlate(plate, newPlate)
end, false)

Last updated