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
| Name | Type | Required | Description |
|---|---|---|---|
garageId | string | โ | A property garage id, e.g. kp_prop_12. |
cid | string | number | โ | The citizen id. |
๐ค Returns
| # | Type | Description |
|---|---|---|
| 1 | number | used: the citizen's vehicles currently parked there. |
| 2 | number | total: 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
- This export does not check access. Call
CanUsePropertyGaragefirst.