Skip to main content

qb-garages

For qb-garages v2.0​

Comment qb-garages:client:houseGarageConfig event part just like the one below

qb-garages/client/main.lua
-- RegisterNetEvent('qb-garages:client:houseGarageConfig', function(houseGarages)
-- for _, garageConfig in pairs(houseGarages) do
-- local formattedHouseName = string.gsub(string.lower(garageConfig.label), ' ', '')
-- if garageConfig.takeVehicle and garageConfig.takeVehicle.x and garageConfig.takeVehicle.y and garageConfig.takeVehicle.z and garageConfig.takeVehicle.w then
-- Config.Garages[formattedHouseName] = {
-- houseName = house,
-- takeVehicle = vector3(garageConfig.takeVehicle.x, garageConfig.takeVehicle.y, garageConfig.takeVehicle.z),
-- spawnPoint = {
-- vector4(garageConfig.takeVehicle.x, garageConfig.takeVehicle.y, garageConfig.takeVehicle.z, garageConfig.takeVehicle.w)
-- },
-- label = garageConfig.label,
-- type = 'house',
-- category = Config.VehicleClass['all']
-- }
-- end
-- end
-- TriggerServerEvent('qb-garages:server:syncGarage', Config.Garages)
-- end)

Add This in your client

qb-garages/client/main.lua
RegisterNetEvent('qb-garages:client:removeHouseGarage', function(house)
local formattedHouseName = string.gsub(string.lower(house), ' ', '')
local zoneName = 'house_' .. formattedHouseName
if ZoneExists(zoneName) then
RemoveHouseZone(zoneName)
end
Config.Garages[formattedHouseName] = nil
end)

In the Server Side Replace this line

qb-garages/server/main.lua
if type == 'house' and not exports['qb-houses']:hasKey(Player.PlayerData.license, Player.PlayerData.citizenid, Config.Garages[garage].houseName) then

with

qb-garages/server/main.lua
if type == 'house' and not exports['bcs_housing']:HasKey(garage, Player.PlayerData.citizenid) then

For default qb-garages before v2.0​

In the create callback qb-garage:server:checkOwnership replace this around line 99

Replace

qb-garages/server/main.lua
                local hasHouseKey = exports['qb-houses']:hasKey(result[1].license, result[1].citizenid, house)
if hasHouseKey then
cb(true)
else
cb(false)
end

with

qb-garages/server/main.lua
                local hasHouseKey = exports['bcs_housing']:HasKey(house, result[1].citizenid)
if hasHouseKey then
cb(true)
else
cb(false)
end

Comment this part out in client/main.lua

qb-garages/client/main.lua
-- RegisterNetEvent('qb-garages:client:houseGarageConfig', function(garageConfig)
-- Config.HouseGarages = garageConfig
-- end)

Add This

qb-garages/client/main.lua
RegisterNetEvent('qb-garages:client:removeHouseGarage', function(house)
Config.HouseGarages[house] = nil
end)

For JonasDev17 qb-garages​

Replace the ones below elseif garageType == "house" then

qb-garages/server/main.lua
    elseif garageType == "house" then     --House garages only for player cars that have keys of the house
MySQL.query('SELECT * FROM player_vehicles WHERE plate = ?', {plate}, function(result)
local hasHouseKey = exports.bcs_housing:HasKey(garage, pData.PlayerData.citizenid)
if result[1] and hasHouseKey then
cb(true)
else
cb(false)
end
end)

Comment this part out in client/main.lua

qb-garages/client/main.lua
-- RegisterNetEvent('qb-garages:client:houseGarageConfig', function(garageConfig)
-- for _,v in pairs(garageConfig) do
-- v.vehicleCategories = Config.HouseGarageCategories
-- end
-- Config.HouseGarages = garageConfig
-- HouseGarages = garageConfig
-- end)

Add This

qb-garages/client/main.lua
RegisterNetEvent('qb-garages:client:removeHouseGarage', function(house)
Config.HouseGarages[house] = nil
HouseGarages[house] = nil
RemoveHousePoly(house)
end)