Skip to content

GetMapObjectsNear

The map objects around a point, nearest first.

GetMapObjectsNear(x, y, z, radius)
Parameter Type
x number metres
y number metres
z number metres
radius number metres

table - a list of GetMapObject’s tables, nearest first, at most 256 (a prefab unit and each of its objects - those with part_of set)

local x, y, z = GetPlayerPos(pid)
SendClientMessage(pid, COLOR_WHITE, #GetMapObjectsNear(x, y, z, 20) .. " placed objects within 20 m")

GetMapObject · the The server’s map group of the index