isElementWithinMarker | Multi Theft Auto: Wiki Skip to content

isElementWithinMarker

Client-side
Server-side
Shared

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


This function is used to determine if an element is within a marker.

OOP Syntax Help! I don't understand this!

  • Method:element:isWithinMarker(...)

Syntax

bool isElementWithinMarker ( element theElement, marker theMarker )
Required Arguments
  • theElement: The element you're checking.
  • theMarker: The marker you're checking.

Returns

  • bool: value

Returns true if the element is within the marker, false otherwise

Code Examples

shared
local dutymarker = createMarker(126.56, 254.98, 78.9, "cylinder", 2.0, 255, 0, 0, 150)
function duty(thePlayer)
if isElementWithinMarker(thePlayer, dutymarker) then
giveWeapon(thePlayer, 22, 100, 1)
else
outputChatBox("You are not at the right place!", thePlayer, 255, 0, 0)
end
end
addCommandHandler("duty", duty)

See Also

Element Functions