GetNearbyProperties
exports['kartik-properties']:GetNearbyProperties(source, radius)🔹 Description
Lists the properties whose entrance is near a player, closest first. Handy for police scripts that need to know which property an officer is standing at, for example before calling RaidProperty. An apartment building returns every unit at that entrance.
🔧 Parameters
| Name | Type | Required | Description |
|---|---|---|---|
source | number | ✅ | Server id of the player. |
radius | number | ❌ | Search distance in metres. Defaults to Config.EntranceMaxDistance. |
📤 Returns
A list (empty when nothing is near). Each entry:
| Field | Type | Description |
|---|---|---|
id | number | Property id. |
label | string | Property name. |
locked | boolean | Whether the front door is locked. |
owner | string | nil | Citizen id of the owner (nil for company or state owned). |
tenant | string | nil | Citizen id of the active tenant, if rented. |
distance | number | Distance from the player to the entrance. |
🧠 Example Usage
for _, p in ipairs(exports['kartik-properties']:GetNearbyProperties(source, 5.0)) do
print(p.id, p.label, p.locked, p.owner)
end