IsElementLowLOD: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "__NOTOC__ {{Server client function}} {{New items|3.0120|1.2| '''Available only in MTA SA 1.2''' }} This function reveals if an element is low LOD. ==Syntax== <syntaxhighlight lang="lua"> bool ...")
 
(Remove obsolete Requirements section)
 
(17 intermediate revisions by 7 users not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
{{Server client function}}
{{Server client function}}
{{New items|3.0120|1.2|
'''Available only in MTA SA 1.2'''
}}
This function reveals if an element is low LOD.
This function reveals if an element is low LOD.
{{Note|See [[setLowLODElement]] for the list of valid element types that can be assigned with that function.}}


==Syntax==
==Syntax==
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
bool isLowLODElement ( element theElement )
bool isElementLowLOD ( element theElement )
</syntaxhighlight>  
</syntaxhighlight>  
{{OOP||[[element]]:isLowLOD||}}


===Required Arguments===  
===Required Arguments===  
Line 18: Line 18:


==Example==
==Example==
<section name="Serverside example" class="server" show="true">
<section name="Clientside" class="client" show="true">
This example is not done yet:
This example will show how many low lods objects is around you.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
addCommandHandler("lowlod",function ()
    local lowlods = 0
    for i, obj in ipairs(getElementsByType("object",root,true)) do
        if isElementLowLOD(obj) then
            lowlods = lowlods + 1   
        end
    end
    outputChatBox("Was found "..lowlods.." lowlod objects around you.",255,255,0)
end)
</syntaxhighlight>
</section>


<section name="Serverside" class="server" show="false">
This example will show how many low lods objects is around all the world.
<syntaxhighlight lang="lua">
addCommandHandler("lowlod",function ()
    local lowlods = 0
    for i, obj in ipairs(getElementsByType("object")) do
        if isElementLowLOD(obj) then
            lowlods = lowlods + 1   
        end
    end
    outputChatBox("Was found "..lowlods.." lowlod objects around you.",root,255,255,0)
end)
</syntaxhighlight>
</syntaxhighlight>
</section>
</section>

Latest revision as of 15:39, 7 November 2024

This function reveals if an element is low LOD.

[[{{{image}}}|link=|]] Note: See setLowLODElement for the list of valid element types that can be assigned with that function.

Syntax

bool isElementLowLOD ( element theElement )

OOP Syntax Help! I don't understand this!

Method: element:isLowLOD(...)


Required Arguments

  • theElement: The element whose low LOD status we want to get.

Returns

Returns true if the element is low LOD, false otherwise.

Example

Click to collapse [-]
Clientside

This example will show how many low lods objects is around you.

addCommandHandler("lowlod",function ()
    local lowlods = 0
    for i, obj in ipairs(getElementsByType("object",root,true)) do
        if isElementLowLOD(obj) then
            lowlods = lowlods + 1    
        end
    end
    outputChatBox("Was found "..lowlods.." lowlod objects around you.",255,255,0)
end)
Click to expand [+]
Serverside

See Also