🎉 Driving School is released. Read more →
Paid Scripts
Housing
Integrations
Phone Scripts
Qb Phone

qb-phone

Find GetPlayerHouses NUI Callback and replace it with these

qb-phone/client/main.lua
RegisterNUICallback('GetPlayerHouses', function(_, cb)
    local houses = exports.bcs_housing:GetOwnedHomes()
    for i = 1, #houses do
        houses[i].label = houses[i].properties.name
        houses[i].name = houses[i].identifier
        houses[i].tier = 1
        houses[i].coords = houses[i].properties.entry
        houses[i].garage = houses[i].properties.data.garage
        houses[i].keyholders = exports.bcs_housing:GetKeyHolders(houses[i].identifier)
    end
    cb(houses)
end)
 
RegisterNUICallback('GetPlayerKeys', function(_, cb)
    local houses = exports.bcs_housing:GetHouseKeys()
    local keys = {}
    for i = 1, #houses do
        houses[i].label = houses[i].properties.name
        houses[i].adress = houses[i].properties.name
        houses[i].name = houses[i].identifier
        houses[i].tier = 1
        houses[i].coords = houses[i].properties.entry
        houses[i].garage = houses[i].properties.data.garage
        houses[i].keyholders = exports.bcs_housing:GetKeyHolders(houses[i].identifier)
        keys[#keys + 1] = {
            HouseData = houses[i]
        }
    end
    cb(keys)
end)
 
RegisterNUICallback('SetHouseLocation', function(data, cb)
    exports.bcs_housing:SetWaypoint(data.HouseData.HouseData.name)
    QBCore.Functions.Notify("GPS has been set to " .. data.HouseData.HouseData.adress .. "!", "success")
    cb("ok")
end)
 
RegisterNUICallback('RemoveKeyholder', function(data, cb)
    exports.bcs_housing:RemoveKeyHolder(data.HouseData.name, data.HolderData.citizenid)
    cb("ok")
end)