OnMarkerLeave: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
(Minor changes + example) |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Server event}} | {{Server event}} | ||
This event is triggered when | This event is triggered when an element leaves the area of a marker created using [[createMarker]]. | ||
==Parameters== | ==Parameters== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
player | player leftElement, bool matchingDimension | ||
</syntaxhighlight> | </syntaxhighlight> | ||
*'''leftPlayer''': The | *'''leftPlayer''': The element that left the marker's area | ||
*'''matchingDimension''': True if the | *'''matchingDimension''': True if the element is in the same dimension as the marker he left | ||
==Source== | ==Source== | ||
Line 15: | Line 15: | ||
==Example== | ==Example== | ||
This example shows a message in the | 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"> | ||
function markerLeave ( | |||
outputChatBox ( " | 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 | end | ||
addEventHandler("onMarkerLeave", | addEventHandler( "onMarkerLeave", myMarker, markerLeave ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{See also/Server event|Marker events}} | {{See also/Server event|Marker events}} |
Revision as of 20:36, 3 November 2009
This event is triggered when an element leaves the area of a marker created using createMarker.
Parameters
player leftElement, bool matchingDimension
- leftPlayer: The element that left the marker's area
- matchingDimension: True if the element is in the same dimension as the marker he left
Source
The source of this event is the marker that the player 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
- addEvent
- addEventHandler
- cancelEvent
- cancelLatentEvent
- getEventHandlers
- getLatentEventHandles
- getLatentEventStatus
- removeEventHandler
- triggerEvent
- wasEventCancelled