Skip to main content

lb_phone

This integration is for lb_phone menu of waypoint, lock, and give/remove key.

V3​

lb-phone\client\apps\framework\home\bcs_housing.lua
CreateThread(function()
if Config.HouseScript ~= "bcs_housing" then
return
end

RegisterNUICallback("Home", function(data, cb)
local action = data.action

if action == "getHomes" then
local ownedHouses = exports.bcs_housing:GetOwnedHomeKeys()

local toSend = {}
for _, v in pairs(ownedHouses) do
if v then
toSend[#toSend + 1] = {
label = v.properties.name .. " (" .. v.identifier .. ")",
id = v.identifier,
uniqueId = v.identifier,
locked = exports.bcs_housing:isLocked(v.identifier),
keyholders = exports.bcs_housing:GetKeyHolders(v.identifier)
}
end
end

cb(toSend)
elseif action == "removeKeyholder" then
cb(exports.bcs_housing:RemoveKeyHolder(data.id, data.identifier))
elseif action == "addKeyholder" then
if exports.bcs_housing:AddKeyHolder(data.id, tonumber(data.source)) then
SetTimeout(500, function()
cb(exports.bcs_housing:GetKeyHolders(data.id))
end)
end
elseif action == "toggleLocked" then
exports.bcs_housing:LockHome(data.id)

SetTimeout(500, function()
cb(exports.bcs_housing:isLocked(data.id))
end)
elseif action == "setWaypoint" then
exports.bcs_housing:SetWaypoint(data.id)
end
end)
end)