OnClientElementDestroy: Difference between revisions
Jump to navigation
Jump to search
(The fact that this event triggers on source's parents does not make any sense. I guess it wanted to say "children") |
m (→Parameters) |
||
Line 4: | Line 4: | ||
==Parameters== | ==Parameters== | ||
No parameters. | |||
==Source== | ==Source== |
Revision as of 22:25, 2 April 2018
This event is triggered when an element gets destroyed by destroyElement or when the creator resource is stopping. It is also triggered when a children element of this element is destroyed.
Parameters
No parameters.
Source
The source of this event is the element that is being destroyed.
Example
This example prints a message in the chat box when the vehicle that you are in gets destroyed.
addEventHandler("onClientElementDestroy", getRootElement(), function () if getElementType(source) == "vehicle" and getPedOccupiedVehicle(getLocalPlayer()) == source then outputChatBox("The vehicle that you were in has been destroyed by the script") end end)
See Also
Client element events
- onClientElementColShapeHit
- onClientElementColShapeLeave
- onClientElementDataChange
- onClientElementDestroy
- onClientElementDimensionChange
- onClientElementInteriorChange
- onClientElementModelChange
- onClientElementStreamIn
- onClientElementStreamOut
Client event functions
- triggerLatentServerEvent
- triggerServerEvent
- Shared
- addEvent
- addEventHandler
- cancelEvent
- cancelLatentEvent
- getEventHandlers
- getLatentEventHandles
- getLatentEventStatus
- removeEventHandler
- triggerEvent
- wasEventCancelled