GetPropertyHousingData
exports['kartik-properties']:GetPropertyHousingData(propertyId)🔹 Description
Returns detailed, normalized housing data for a specific property by its ID. Formatted for phone app detail pages, displaying entrance coords, lock status, owner citizen ID, and a list of all keyholders.
🔧 Parameters
| Name | Type | Required | Description |
|---|---|---|---|
propertyId | number | string | ✅ | The property ID to query. |
📤 Returns
| Type | Description |
|---|---|
table | nil | Formatted phone housing record (or nil if property does not exist). |
📦 Returned Housing Object Shape
| Field | Type | Description |
|---|---|---|
houseId | string | Unique property ID (tostring(id)). |
label | string | Property display label or address. |
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 property door is currently locked. |
🧠 Example Usage
local house = exports['kartik-properties']:GetPropertyHousingData(12)
if house then
print(('Property %s has %s keyholders'):format(house.label, #house.keyholders))
for _, k in ipairs(house.keyholders) do
print((' - %s (%s) [Owner: %s]'):format(k.name, k.identifier, tostring(k.isowner)))
end
end