Kartik Scripts

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

NameTypeRequiredDescription
cidstring | number✅The citizen identifier to query.

📤 Returns

TypeDescription
table[]Array of phone housing records (empty array if no properties found or invalid cid).

📦 Returned Housing Object Shape

FieldTypeDescription
houseIdstringUnique property ID (tostring(id)).
labelstringProperty display label or address (e.g. "Vinewood Hills #2").
coordstableEntrance coordinates { x = 0.0, y = 0.0, z = 0.0 }.
keyholderstable[]Array of keyholders { name, identifier, isowner }.
ownerstringCitizen ID of the property owner.
lockedbooleantrue 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

On this page