OnMarkerLeave

From Multi Theft Auto: Wiki
Revision as of 13:48, 24 February 2021 by Srslyyyy (talk | contribs) (Improved example.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This event is triggered when an element leaves the area of a marker created using createMarker.

Parameters

element leftElement, bool matchingDimension

Source

The source of this event is the marker that the element left.

Example

This example shows a message in the chat box when element (in this case a player) leaves a marker.

local myMarker = createMarker(-2596.6259765625, 579.3583984375, 15.626741409302, "cylinder", 2.0, 255, 0, 0, 150)

function markerLeave(leaveElement, matchingDimension)
	local elementType = getElementType(leaveElement)

	if elementType == "player" then
		outputChatBox("Player has left a marker.", root, 255, 255, 0)
	end
end
addEventHandler("onMarkerLeave", myMarker, markerLeave)

See Also

Marker events


Event functions