GetPlayerHousingData
exports['kartik-properties']:GetPlayerHousingData(cid)🔹 Description
Returns an array of normalized housing records formatted specifically for third-party phone housing apps (such as 17mov Phone, SD-Phone, etc.). This includes all properties the player owns, properties they rent via active leases, and properties they hold keys to.
🔧 Parameters
| Name | Type | Required | Description |
|---|---|---|---|
cid | string | number | ✅ | The citizen identifier to query. |
📤 Returns
| Type | Description |
|---|---|
table[] | Array of phone housing records (empty array if no properties found or invalid cid). |
📦 Returned Housing Object Shape
| Field | Type | Description |
|---|---|---|
houseId | string | Unique property ID (tostring(id)). |
label | string | Property display label or address (e.g. "Vinewood Hills #2"). |
coords | table | Entrance coordinates { x = 0.0, y = 0.0, z = 0.0 }. |
keyholders | table[] | Array of keyholders { name, identifier, isowner }. |
owner | string | Citizen ID of the property owner. |
locked | boolean | true if the front door is currently locked. |
🧠 Example Usage
local homes = exports['kartik-properties']:GetPlayerHousingData('ABC12345')
for _, house in ipairs(homes) do
print(('House #%s: %s (Locked: %s)'):format(
house.houseId,
house.label,
tostring(house.locked)
))
end