setElementStreamable | Multi Theft Auto: Wiki Skip to content

setElementStreamable

Client-side
Server-side
Shared

Pair: isElementStreamable

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function can be used to disable streaming for an element. This will make sure the element is not virtualized (streamed out from GTA) when the player moves far away from it. This function only works in elements with a physical representation in the world (entities), such as players, peds, vehicles and objects.

Tip

Always use this function with caution . Not doing so can cause the following problems: There is a limit of elements that can be streamed in safely for every GTA entity type. If you bypass said limit by using this function, the client can experience problems of disappearing objects and unstability when trying to stream in new elements of that type. In general, if you disable too many elements (of the same type or not) to stream out, GTA will always try to render them, so it can cause a noticeable FPS drop.

Syntax

setElementStreamable ( )

Code Examples

client

This example creates anobjectat the center of the map which will always be streamed in when the resource which contains it starts.

local function testNonStreamableObjects()
local object = createObject ( 1097, 0, 0, 5 )
setElementStreamable ( object, false ) -- Make the object always be streamed in
end
addEventHandler ( "onClientResourceStart", resourceRoot, testNonStreamableObjects )

See Also

Element Functions