Kartik Scripts

GetPropertyGarageSlots

local used, total = exports['kartik-properties']:GetPropertyGarageSlots(garageId, cid)

๐Ÿ”น Description

Returns how full a property garage is for one citizen. Use it to refuse a park that the property itself would refuse, so your garage script respects the deed's slot cap.


๐Ÿ”ง Parameters

NameTypeRequiredDescription
garageIdstringโœ…A property garage id, e.g. kp_prop_12.
cidstring | numberโœ…The citizen id.

๐Ÿ“ค Returns

#TypeDescription
1numberused: the citizen's vehicles currently parked there.
2numbertotal: the deed's slot count. 0, 0 for an unknown garage.

๐Ÿง  Example Usage

local used, total = exports['kartik-properties']:GetPropertyGarageSlots(garageId, cid)
if used >= total then
    return lib.notify(source, { description = 'This garage is full', type = 'error' })
end

๐Ÿ“Œ Notes

On this page