IsElementStreamable: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
m (Removed "needs example")
 
(7 intermediate revisions by 4 users not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
{{Client function}}
{{Client function}}
{{Needs Checking|Does this return true for vehicles the player is inside as they can't stream out?}}
This function checks whether an [[element]] is streamable as set by [[setElementStreamable]] or not.
This function checks whether an [[element]] is streamable as set by [[setElementStreamable]] or not.


Line 8: Line 7:
bool isElementStreamable ( element theElement )
bool isElementStreamable ( element theElement )
</syntaxhighlight>
</syntaxhighlight>
{{New feature/item|3.0141|1.4.0|6987|{{OOP||[[element]]:isStreamable|streamable|setElementStreamable}}}}


===Required Arguments===
===Required Arguments===
Line 16: Line 16:


==Example==
==Example==
This clientside function destroys all local radar blips.
<section name="Client" class="client" show="true">
Check if
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
function onClientColShapeHit(theElement, matchingDimension)
if(isElementStreamable(theElement)) then  -- Checks whether the element is streamable
outputChatBox( "Element is streamable")
else
outputChatBox( "Element not streamable")
end
end
addEventHandler("onClientColShapeHit", root, onClientColShapeHit)
</syntaxhighlight>
</syntaxhighlight>
</section>


==See Also==
==See Also==
{{Client element functions}}
{{Client element functions}}

Latest revision as of 16:36, 31 May 2020

This function checks whether an element is streamable as set by setElementStreamable or not.

Syntax

bool isElementStreamable ( element theElement )

OOP Syntax Help! I don't understand this!

Method: element:isStreamable(...)
Variable: .streamable
Counterpart: setElementStreamable

Required Arguments

  • theElement: The element to check the streamability of.

Returns

Returns true if the passed element is streamable like normal, false if this element must always be streamed in.

Example

Click to collapse [-]
Client

Check if

function onClientColShapeHit(theElement, matchingDimension)
	if(isElementStreamable(theElement)) then  -- Checks whether the element is streamable
		outputChatBox( "Element is streamable")
	else
		outputChatBox( "Element not streamable")
	end
end
addEventHandler("onClientColShapeHit", root, onClientColShapeHit)

See Also