OnElementColShapeLeave: Difference between revisions
Jump to navigation
Jump to search
JonChappell (talk | contribs) No edit summary |
No edit summary |
||
(7 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
[[ | __NOTOC__ | ||
{{Server event}} | |||
This event is triggered when an player or vehicle element leaves the area of a [[colshape]]. | |||
==Parameters== | |||
== | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
colshape theColShape, bool matchingDimension | |||
</syntaxhighlight> | </syntaxhighlight> | ||
*'''theColShape''': the [[colshape]] that this [[element]] left the area of. | |||
*'''matchingDimension''': a [[boolean]] representing if the [[element]] and the [[colshape]] are in the same [[dimension]]. | |||
==Source== | |||
The [[event system#Event source|source]] of this event is the [[player]] or [[vehicle]] that left colshape. | |||
==Example== | ==Example== | ||
This example | This example prints type of the element which left the created colshape to chatbox. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
- | colArea = createColCircle( 1400.0, -700.0, 5.0 ) -- create the colshape | ||
-- | function elementColShapeLeave( colShapeLeft ) | ||
if colShapeLeft == colArea then -- if element left the created colshape | |||
outputChatBox( getElementType( source ) .. " left the colCircle!" ) -- print the type of the element to chatbox | |||
end | |||
end | |||
addEventHandler( "onElementColShapeLeave", getRootElement(), elementColShapeLeave ) -- add a handler function for the event | |||
</syntaxhighlight> | </syntaxhighlight> | ||
{{See also/Server event|Element events}} |
Latest revision as of 02:56, 27 September 2018
This event is triggered when an player or vehicle element leaves the area of a colshape.
Parameters
colshape theColShape, bool matchingDimension
- theColShape: the colshape that this element left the area of.
- 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 left colshape.
Example
This example prints type of the element which left the created colshape to chatbox.
colArea = createColCircle( 1400.0, -700.0, 5.0 ) -- create the colshape function elementColShapeLeave( colShapeLeft ) if colShapeLeft == colArea then -- if element left the created colshape outputChatBox( getElementType( source ) .. " left the colCircle!" ) -- print the type of the element to chatbox end end addEventHandler( "onElementColShapeLeave", getRootElement(), elementColShapeLeave ) -- 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