OnElementColShapeHit: Difference between revisions
Jump to navigation
Jump to search
m (→Parameters) |
No edit summary |
||
Line 27: | Line 27: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | |||
===Element events=== | |||
{{Element_events}} | |||
===Event functions=== | |||
{{Event functions}} |
Revision as of 02:06, 27 September 2018
This event is triggered when an player or vehicle element collides with a colshape.
Parameters
colshape theColShape, bool matchingDimension
- theColShape: the colshape that this element collided with.
- matchingDimension: a boolean representing if the element and the colshape are in the same dimension.
Source
The source of this event is the player or vehicle that collided with the colshape.
Example
This example prints type of the element which entered the created colshape to chatbox.
colArea = createColCircle( 1400.0, -700.0, 5.0 ) -- create the colshape function elementColShapeHit( colShapeHit ) if colShapeHit == colArea then -- if element entered the created colshape outputChatBox( getElementType( source ) .. " entered the colCircle!" ) -- print the type of the element to chatbox end end addEventHandler( "onElementColShapeHit", getRootElement(), elementColShapeHit ) -- add a handler function for the event
See Also
Element events
- onElementClicked
- onElementColShapeHit
- onElementColShapeLeave
- onElementDataChange
- onElementDestroy
- onElementDimensionChange
- onElementInteriorChange
- onElementModelChange
- onElementStartSync
- onElementStopSync
Event functions
- addEvent
- addEventHandler
- cancelEvent
- cancelLatentEvent
- getEventHandlers
- getLatentEventHandles
- getLatentEventStatus
- removeEventHandler
- triggerEvent
- wasEventCancelled