Skip to content

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.

ex_extended/client/functions.lua — line 570
lua
TriggerEvent('cd_garage:AddKeys', exports['cd_garage']:GetPlate(vehicle))

okok-vehicleshop

Add the line of code exactly as seen in the screenshot below.

okokVehicleShop/cl_utils.lua — line 33 (approx)
lua
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.

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.

esx_policejob/server/main.lua — line 377
sql
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.

esx_policejob/server/main.lua — line 377
sql
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
qb-phone/server/garage.lua — line 45
lua
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.

es_extended/client/functions.lua — line 23
lua
TriggerServerEvent('cd_garage:RemovePersistentVehicles', exports['cd_garage']:GetPlate(vehicle))

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.

esx_boat/client/main.lua — line 122
lua
TriggerEvent('cd_garage:UpdateGarageType')

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.

lua
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.

qb-vehicleshop/client/main.lua — approx. line 657
lua
TriggerEvent('cd_garage:UpdateGarageType')

Hello!