isElementStreamedIn | Multi Theft Auto: Wiki Skip to content

isElementStreamedIn

Client-side
Server-side
Shared

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 checks whether an element is currently streamed in (not virtualized) and are actual GTA objects in the world. You can force an element to be streamed in using setElementStreamable.

Syntax

isElementStreamedIn ( )

Code Examples

client

This command shows you how many objects you have streamed in.

function checkTheObjects ( cmd )
local amount = 0 -- When starting the command, we don't have any objects looped.
for k,v in ipairs ( getElementsByType ( "object" ) ) do -- Looping all the objects in the server
if isElementStreamedIn ( v ) then -- If the object is streamed in
amount = amount + 1 -- It's an object more streamed in
end
end
outputChatBox ( "You have currently " ..amount.. " objects streamed in." ) -- Send the player the amount of objects that are streamed in
end
addCommandHandler ( "checkobjects", checkTheObjects )

See Also

Element Functions