onClientElementStreamOut
This event is triggered whenever a physical element is streamed out. This is triggered for all elements that are streamable, such as players, peds, vehicles, objects and markers when the local player is leaving the element. When this event is triggered, that element is no longer physical and is now virtualized by MTA.
Be aware that this event triggers for local player (as itself being the element that got streamed out) when said local player dies and respawns, as this is the removal & recreation of entity local ped.
This event is not triggered for elements that are streamed-in at the point of a destroyElement call. Use the onClientElementDestroy event in combination with the isElementStreamedIn function to handle such a case.
Parameters
This event does not pass any parameters to the handler function.
Source
element: The source of this event is the element that streamed out.
Code Examples
This example shows you how to tell player that another player was streamed out and the distance between them and said player
addEventHandler( "onClientElementStreamOut", root, function () if getElementType(source) == "player" then local x, y, z = getElementPosition(localPlayer) local xh, xy, xz = getElementPosition(source) local distance = getDistanceBetweenPoints3D(x, y, z, xh, xy, xz ) outputChatBox( "A player has just streamed out. Distance to the player: " .. tostring(distance) .."." ) end end)
See Also
Element Events
- onClientElementColShapeLeave
- onClientElementDestroy
- onClientElementColShapeHit
- onClientElementDataChange
- onClientElementDimensionChange
- onClientElementModelChange
- onClientElementInteriorChange
- onClientElementStreamOut
- onClientElementStreamIn
- onElementClicked
- onElementColShapeLeave
- onElementColShapeHit
- onElementDataChange
- onElementDestroy
- onElementDimensionChange
- onElementInteriorChange
- onElementModelChange
- onElementStartSync
- onElementStopSync
Element Functions
- attachElements
- createElement
- destroyElement
- detachElements
- getAllElementData
- getAttachedElements
- getElementAngularVelocity
- getElementAlpha
- getElementAttachedOffsets
- getElementAttachedTo
- getElementByID
- getElementByIndex
- getElementChild
- getElementChildren
- getElementChildrenCount
- getElementCollisionsEnabled
- getElementData
- getElementDimension
- getElementHealth
- getElementID
- getElementInterior
- getElementMatrix
- getElementModel
- getElementParent
- getElementPosition
- getElementRotation
- getElementType
- getElementVelocity
- getElementsByType
- getElementsWithinRange
- getLowLODElement
- getPedContactElement
- getResourceDynamicElementRoot
- getResourceRootElement
- getRootElement
- hasElementData
- isElement
- isElementAttached
- isElementCallPropagationEnabled
- isElementDoubleSided
- isElementFrozen
- isElementInWater
- isElementLowLOD
- isElementOnFire
- isElementWithinMarker
- setElementAlpha
- setElementAngularVelocity
- setElementAttachedOffsets
- setElementCallPropagationEnabled
- setElementData
- setElementCollisionsEnabled
- setElementDoubleSided
- setElementDimension
- setElementFrozen
- setElementHealth
- setElementID
- setElementInterior
- setElementModel
- setElementOnFire
- setElementParent
- setElementPosition
- setElementRotation
- setElementVelocity
- setLowLODElement
- getElementBoneMatrix
- getElementBonePosition
- getElementBoneQuaternion
- getElementBoneRotation
- getElementBoundingBox
- getElementDistanceFromCentreOfMassToBaseOfModel
- getElementLighting
- getElementRadius
- isElementCollidableWith
- isElementLocal
- isElementOnScreen
- isElementStreamable
- isElementStreamedIn
- isElementSyncer
- isElementWaitingForGroundToLoad
- setElementBoneMatrix
- setElementBonePosition
- setElementBoneRotation
- setElementBoneQuaternion
- setElementCollidableWith
- setElementLighting
- setElementStreamable
- updateElementRpHAnim
- addElementDataSubscriber
- cloneElement
- clearElementVisibleTo
- getElementSyncer
- getElementZoneName
- hasElementDataSubscriber
- isElementVisibleTo
- removeElementData
- removeElementDataSubscriber
- setElementSyncer
- setElementVisibleTo