ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. getElementsWithinMarker

Function

getElementsWithinMarker

Returns the elements that are inside a marker right now: players, vehicles, peds, objects, pickups and other markers. A checkpoint marker is a circle with no height limit, the other types are a sphere with a radius equal to the marker size. The result can be limited to one type.

Syntax

table getElementsWithinMarker(marker theMarker [, string elementType = nil])

Arguments

theMarkermarker
The marker.
elementTypestring, optional = nil
Element type, e.g. "player" or "vehicle".Not in MTA:SA

Differences from MTA:SA

  • Arguments in a different colour differ from MTA:SA.

In MTA:SA

getElementsWithinMarker(marker theMarker)

Returns

A list of elements or false for a bad marker.

Example

local parking = createMarker(2490, -1670, 12.4, "cylinder", 6, 0, 120, 255, 80)
addCommandHandler("parking", function()
    outputChatBox("Aut na parkingu: " .. #getElementsWithinMarker(parking, "vehicle"))
end)

See also