IsElementLowLOD: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (fix oop syntax)
Line 16: Line 16:
Returns ''true'' if the element is low LOD, ''false'' otherwise.
Returns ''true'' if the element is low LOD, ''false'' otherwise.


==Example==
<section name="Clientside" class="client" show="true">
This example will show how many low lods objects is around you.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
--Example Needed
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>
</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.",255,255,0)
end)
</syntaxhighlight>
</section>


==Requirements==
==Requirements==

Revision as of 02:20, 4 October 2019

Accessories-text-editor.png Script Example Missing Function IsElementLowLOD needs a script example, help out by writing one.

Before submitting check out Editing Guidelines Script Examples.

This function reveals if an element is low LOD.

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.

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

Requirements

This template will be deleted.

See Also