Kartik Scripts

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

NameTypeRequiredDescription
cidstring | numberโœ…The citizen id.

๐Ÿ“ค Returns

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

On this page