Kartik Scripts

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

NameTypeRequiredDescription
cidstring | numberโœ…The citizen id to look up.

๐Ÿ“ค Returns

TypeDescription
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).

On this page