Integration Guides
Add Key
es_extended
View the code on GitHub: ex_extended/client/functions.lua
Add the line of code exactly as seen in the screenshot below.
TriggerEvent('cd_garage:AddKeys', exports['cd_garage']:GetPlate(vehicle)).png)
okok-vehicleshop
Add the line of code exactly as seen in the screenshot below.
TriggerEvent('cd_garage:AddKeys', plate)
TriggerEvent('cd_garage:RemoveKeys', plate)
Housing
ps-housing
View the code on GitHub: ps-housing/client/cl_property.lua.
Replace whole function.
.png)
Job Garage
esx_policejob
Personal Owned Job Garage
View the code on GitHub: esx_policejob/server/main.lua
REPLACE the line of code exactly as seen in the screenshot below.
MySQL.insert('INSERT INTO owned_vehicles (owner, vehicle, plate, type, job_personalowned, `stored`) VALUES (?, ?, ?, ?, ?, ?)', { xPlayer.identifier, json.encode(vehicleProps), vehicleProps.plate, type, xPlayer.job.name, true},
Society Owned Job Garage
View the code on GitHub: esx_policejob/server/main.lua
REPLACE the line of code exactly as seen in the screenshot below.
MySQL.insert('INSERT INTO owned_vehicles (owner, vehicle, plate, type, job, `stored`) VALUES (?, ?, ?, ?, ?, ?)', { xPlayer.job.name, json.encode(vehicleProps), vehicleProps.plate, type, xPlayer.job.name, true},
Phone Garage App
qb-phone (renewed)
View the code on GitHub: qb-phone/server/garage.lua
Replace the full code block.
Copy Paste
QBCore.Functions.CreateCallback('qb-phone:server:GetGarageVehicles', function(source, cb)
local Player = QBCore.Functions.GetPlayer(source)
local Vehicles = {}
local vehdata
local result = exports.oxmysql:executeSync('SELECT * FROM player_vehicles WHERE citizenid = ?', {Player.PlayerData.citizenid})
if result[1] then
for _, v in pairs(result) do
local VehicleData = QBCore.Shared.Vehicles[v.vehicle]
local enginePercent = round(v.engine / 10, 0)
local bodyPercent = round(v.body / 10, 0)
local VehicleGarage = "None"
if v.garage_id then
VehicleGarage = exports.cd_garage:GetGarageLabelFromGarageId(v.garage_id)
end
local VehicleState
if v.in_garage == 0 then
VehicleState = "Out"
if v.in_garage == 1 then
VehicleState = "In"
elseif v.in_garage == 2 then
VehicleState = "Impounded"
end
if VehicleData["brand"] then
vehdata = {
fullname = VehicleData["brand"] .. " " .. VehicleData["name"],
brand = VehicleData["brand"],
model = VehicleData["name"],
plate = v.plate,
garage = VehicleGarage,
state = VehicleState,
fuel = v.fuel,
engine = enginePercent,
body = bodyPercent,
paymentsleft = v.paymentsleft
}
else
vehdata = {
fullname = VehicleData["name"],
brand = VehicleData["name"],
model = VehicleData["name"],
plate = v.plate,
garage = VehicleGarage,
state = VehicleState,
fuel = v.fuel,
engine = enginePercent,
body = bodyPercent,
paymentsleft = v.paymentsleft
}
end
Vehicles[#Vehicles+1] = vehdata
end
cb(Vehicles)
else
cb(nil)
end
end)Remove Persistent Vehicle
es_extended
View the code on GitHub: es_extended/client/functions.lua
Add the line of code exactly as seen in the screenshot below.
TriggerServerEvent('cd_garage:RemovePersistentVehicles', exports['cd_garage']:GetPlate(vehicle)).png)
Do vehicles still respawn after deleting them?
- If deleted vehicles still respawn, one of your resources may not be using the ESX delete vehicle function.
- Go to #persistent-vehicles.
- Add the required delete vehicle event to that resource.
Garage Type
esx_boat
Update Garage Type
View the code on GitHub: esx_boat/client/main.lua
Add the line of code exactly as seen in the screenshot below.
TriggerEvent('cd_garage:UpdateGarageType').png)
okok-vehicleshop
Set garage type after a vehicle is purchased (for boats and air vehicles)
Add the line of code exactly as seen in the screenshot below.
TriggerClientEvent('cd_garage:UpdateGarageType', source)
qb-vehicleshop
View the code on GitHub: qb-vehicleshop/client/main.lua
Add the line of code exactly as seen in the screenshot below.
TriggerEvent('cd_garage:UpdateGarageType')