qb-garages

  1. Navigate to the qb-garages/client/main.lua

  2. Find the qb-garages:client:setHouseGarage event and replace:

RegisterNetEvent('qb-garages:client:setHouseGarage', function(house) -- event sent periodically from housing
    if not house then return end
    local formattedHouseName = string.gsub(string.lower(house), ' ', '')
    local zoneName = 'house_' .. formattedHouseName
    local hasKey = exports['vms_housing']:HasPermissions(house, 'garage')
    
    if Config.Garages[formattedHouseName] then
        if hasKey and not ZoneExists(zoneName) then
            CreateHouseZone(formattedHouseName, Config.Garages[formattedHouseName], 'house')
        elseif not hasKey and ZoneExists(zoneName) then
            RemoveHouseZone(zoneName)
        end
    else
        if not hasKey then
            return
        end
        local property = exports['vms_housing']:GetProperty(house)
        if not property or not property.metadata or not property.metadata.garage then return end
        local garageCoords = property.metadata.garage
        Config.Garages[formattedHouseName] = {
            houseName = house,
            takeVehicle = vector3(garageCoords.x, garageCoords.y, garageCoords.z),
            spawnPoint = {
                vector4(garageCoords.x, garageCoords.y, garageCoords.z, garageCoords.w)
            },
            label = property.name,
            type = 'house',
            category = Config.VehicleClass['all']
        }
        CreateHouseZone(formattedHouseName, Config.Garages[formattedHouseName], 'house')
    end
end)

  1. Navigate to the qb-garages/server/main.lua

  2. Find the qb-garages:server:getHouseGarage callback and replace:

  1. Find the qb-garages:server:GetGarageVehicles callback and replace:

  1. Find the qb-garages:server:canDeposit callback and replace:

Last updated

Was this helpful?