GetCitizenProperties
exports['kartik-properties']:GetCitizenProperties(cid)๐น Description
Returns every property a citizen holds, both owned deeds and active/arrears leases, as normalised shaped property records. Leased units are included with tenant = true so callers can tell ownership from tenancy.
This is the primary export for building a "citizen's properties" panel in an MDT, phone or dashboard.
๐ง Parameters
| Name | Type | Required | Description |
|---|---|---|---|
cid | string | number | โ | The citizen id to look up. |
๐ค Returns
| Type | Description |
|---|---|
table[] | Array of shaped property records. Empty table if cid is missing or holds nothing. |
๐ง Example Usage
local props = exports['kartik-properties']:GetCitizenProperties('ABC12345')
for _, p in ipairs(props) do
print(('%s%s - %s (%s)'):format(
p.label,
p.tenant and ' [leased]' or '',
p.ownerName,
p.district or 'Los Santos'
))
end๐ Notes
- Leases are read live from
kp_leases(status IN ('active','arrears')); everything else comes from the in-memory property cache. - A citizen who both owns and rents the same unit only appears once (the owned record wins).