OnMarkerLeave: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 17: Line 17:
This example shows a message in the chat box when element (in this case a player) leaves a marker.
This example shows a message in the chat box when element (in this case a player) leaves a marker.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
local myMarker = createMarker( -2596.6259765625, 579.3583984375, 15.626741409302, "cylinder", 2.0, 255, 0, 0, 150 )
local myMarker = createMarker( -2596.6259765625, 579.3583984375, 15.626741409302, "cylinder", 2.0, 255, 0, 0, 150 )


Line 29: Line 28:
</syntaxhighlight>
</syntaxhighlight>


==See Also==
{{See also/Server event|Marker events}}
===Marker events===
{{Marker_events}}
===Event functions===
{{Event functions}}

Revision as of 02:57, 27 September 2018

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 )
        if getElementType( leaveElement ) == "player" then
          outputChatBox ( "Player has left a marker", getRootElement(), 255, 255, 0 )
        end
end

addEventHandler( "onMarkerLeave", myMarker, markerLeave )

See Also

Marker events


Event functions