GetPropertyGarages
exports['kartik-properties']:GetPropertyGarages(cid)๐น Description
Lists every property garage a citizen can use: garages on properties they own personally, plus garages on properties they hold a live key for. Use it to add a player's home garages to your garage list.
๐ง Parameters
| Name | Type | Required | Description |
|---|---|---|---|
cid | string | number | โ | The citizen id. |
๐ค Returns
| Type | Description |
|---|---|
table[] | Array of garage records (same shape as GetPropertyGarage). Empty when there are none. |
๐ง Example Usage
lib.callback.register('my-garages:server:list', function(source)
local cid = exports.qbx_core:GetPlayer(source).PlayerData.citizenid
local list = {}
for _, g in ipairs(exports['kartik-properties']:GetPropertyGarages(cid)) do
list[#list + 1] = { id = g.garageId, label = g.label, coords = g.coords }
end
return list
end)๐ Notes
- Access through a company or job (for example, a realtor's stock) is not included. That check needs the player's live job/company, and this export only takes a citizen id.
- Expired keys are ignored.