QBCore
qb-core
Has Keys Check
Vew the code on GitHub: qb-core/client/events.lua
REPLACE the line’s of code exactly as seen in the screenshot below.
if GetResourceState('cd_garage') == 'started' and plate then
hasKeys = exports['cd_garage']:DoesPlayerHaveKeys(plate)
end
Remove Persistent Vehicle
View the code on GitHub: qb-core/client/functions.lua
Add the line of code exactly as seen in the screenshot below.
TriggerServerEvent('cd_garage:RemovePersistentVehicles', exports['cd_garage']:GetPlate(vehicle))
qb-vehicleshop
Update Garage Type
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')
Do vehicles still respawn when deleting them?
If vehicles still respawn when deleting them, most likely, one of your resources does not use the QBCore delete vehicle function, so you will need to refer to #PersistentVehicles and add the event to that resource.
qb-phone
Garage App
View the code on GitHub: qb-phone/server/main.lua
REPLACE the line’s of code exactly as seen in the screenshot below.
v.garage = v.garage_id
qb-phone (renewed)
Garage App
View the code on GitHub: qb-phone/server/garage.lua
Replace this whole function.
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 VehicleGarage = "None"
local enginePercent = round(v.engine / 10, 0)
local bodyPercent = round(v.body / 10, 0)
VehicleGarage = v.garage_id
local VehicleState = "In"
if v.in_garage ~= true then
VehicleState = "Out"
end
if v.impound ~= 0 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)Last updated
Was this helpful?

