OnMarkerHit: Difference between revisions
Jump to navigation
Jump to search
(Minor changes + example) |
No edit summary |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Server event}} | {{Server event}} | ||
This event is triggered when | This event is triggered when an element enters a marker created using [[createMarker]]. | ||
==Parameters== | ==Parameters== |
Revision as of 20:32, 3 November 2009
This event is triggered when an element enters a marker created using createMarker.
Parameters
player hitElement, bool matchingDimension
- hitElement: The element that hit the marker
- matchingDimension: True if the element is in the same dimension as the marker he hit
Source
The source of this event is the marker that got hit by the element.
Example
This will output 'hi' in the chatbox when the marker is hit.
local myMarker = createMarker( -2596.6259765625, 579.3583984375, 15.626741409302, 'cylinder', 2.0, 255, 0, 0, 150 ) function MarkerHit( hitElement, matchingDimension ) if getElementType( hitElement ) == "player" then outputChatBox( "Player inside myMarker", getRootElement(), 255, 255, 0 ) elseif getElementType( hitElement ) == "vehicle" then outputChatBox( "Vehicle inside myMarker", getRootElement(), 255, 255, 0 ) end end addEventHandler( "onMarkerHit", myMarker, MarkerHit )
See Also
Marker events
Event functions
- addEvent
- addEventHandler
- cancelEvent
- cancelLatentEvent
- getEventHandlers
- getLatentEventHandles
- getLatentEventStatus
- removeEventHandler
- triggerEvent
- wasEventCancelled