From Multi Theft Auto: Wiki
Revision as of 16:59, 19 October 2009 by 50p (talk | contribs)

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.


The source of this event is the element that streamed out


This example shows you how to tell player that a marker was streamed out and the distance between player and the marker.

addEventHandler( "onClientElementStreamOut", getRootElement( ),
    function ( )
        if getElementType( source ) == "marker" then
            local myPosTab = { getElementPosition( getLocalPlayer( ) ) };
            local markerPosTab = { getElementPosition( source ) };
            local distance = getDistanceBetweenPoints3D( unpack( myPosTab ), unpack( markerPosTab ) );
            outputChatBox( "A marker has just streamed out. Distance to the marker: " .. tostring( distance ) .."." );

See Also

Client element events

Client event functions