if Config.HouseScript ~= "qs-housing" then return end RegisterNuiCallback("gksphone:home:fetchHouseData", function(data, cb) CallBackServerTrigger('gksphone:server:qsHouses', function(houses) local out = {} if type(houses) == 'table' then for _, name in pairs(houses) do -- The list is house names; everything else is on the client. local house = type(name) == 'table' and (name.house or name.name) or name local info = house and exports['qs-housing']:getHouseData(house) or nil local coords = info and (info.coords or info.entry or info.enter) out[#out + 1] = HouseEntry({ id = house, label = (info and (info.label or info.adress)) or house, price = info and info.price or nil, garage = info and info.garage and true or false, coords = coords, canLocate = type(coords) == 'table' and coords.x ~= nil, canTransfer = false, canGiveKey = true, canRemoveKey = true }) end end Debugprint('qs-housing houses', out) cb(out) end) end) RegisterNUICallback('gksphone:home:transferHouse', function(data, cb) cb(false) end) RegisterNUICallback('gksphone:home:houseLocation', function(data, cb) if not HouseWaypoint(data.coords) then exports["gksphone"]:ToastNotification( _T(LastItemData?.info?.phoneLang, "HouseAPP.APP_HOUSE_ERROR_NOTFOUND")) cb(false) return end exports["gksphone"]:ToastNotification( _T(LastItemData?.info?.phoneLang, "HouseAPP.APP_HOUSE_SETGPS")) cb('ok') end) local function QsCallback(event, cb, ...) if Config.Framework == "qb-core" or Config.Framework == "qbx_core" then Config.Core.Functions.TriggerCallback(event, cb, ...) elseif Config.Framework == "es_extended" then Config.Core.TriggerServerCallback(event, cb, ...) else cb(false) end end RegisterNUICallback('gksphone:home:giveKey', function(data, cb) CallBackServerTrigger('gksphone:server:getCizitinIDSource', function(_, target) if not target then cb(false) return end QsCallback('housing:giveKey', function(success) cb(success and 'ok' or false) end, tonumber(target), data.id) end, data.phoneNumber) end) RegisterNUICallback('gksphone:home:removeKey', function(data, cb) if not data.holderId then cb(false) return end QsCallback('housing:takeKey', function(success) cb(success and 'ok' or false) end, data.id, { firstname = '', lastname = '', citizenid = data.holderId }) end) RegisterNUICallback('gksphone:home:toggleLock', function(data, cb) cb(false) end)