Kartik Scripts

GetPlayerProperties

exports['kartik-properties']:GetPlayerProperties(cid)

๐Ÿ”น Description

Returns the raw kp_properties rows a citizen owns, straight from the database. Unlike GetCitizenProperties, this does not normalise the shape, does not resolve owner names, and does not include leased units, it is a thin, low-level query.

Prefer GetCitizenProperties for display; use this when you need the exact database columns.


๐Ÿ”ง Parameters

NameTypeRequiredDescription
cidstring | numberโœ…The owning citizen id.

๐Ÿ“ค Returns

TypeDescription
table[]Raw kp_properties rows where owner_type = 'citizen' and owner_id = cid. Empty table if none.

๐Ÿง  Example Usage

local rows = exports['kartik-properties']:GetPlayerProperties('ABC12345')
for _, row in ipairs(rows) do
    print(row.id, row.label, row.price, row.listing)
end

๐Ÿ“Œ Notes

  • Columns match the kp_properties table (id, label, shell, owner_type, owner_id, price, listing, โ€ฆ). JSON columns such as entrance are returned as encoded strings.
  • Only citizen-owned properties are returned, company and state stock are excluded.

On this page