- Documentation
- Shared functions
- 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
isElementWithinMarkerChecks whether an element is inside a marker.onClientMarkerHitAn element entered a marker, in this game. Works for markers from the server and ones created on the client. Players, vehicles, peds, objects, pickups and other markers are checked every 100 ms. Acheckpointmarker is a circle with no height limit, the other types are a sphere with a radius equal to the marker size.