IsElementLowLOD: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (Add Example header)
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
{{Server client function}}
{{Server client function}}
{{Needs_Example}}
This function reveals if an element is low LOD.
This function reveals if an element is low LOD.


Line 16: Line 15:
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">
<section name="Clientside" class="client" show="true">
This example will show how many low lods objects is around you.
This example will show how many low lods objects is around you.
Line 41: Line 41:
         end
         end
     end
     end
     outputChatBox("Was found "..lowlods.." lowlod objects around you.",255,255,0)
     outputChatBox("Was found "..lowlods.." lowlod objects around you.",root,255,255,0)
end)
end)
</syntaxhighlight>
</syntaxhighlight>

Latest revision as of 18:27, 12 February 2021

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.

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

Requirements

Minimum server version 1.2
Minimum client version 1.2

Note: Using this feature requires the resource to have the above minimum version declared in the meta.xml <min_mta_version> section. e.g. <min_mta_version server="1.2" client="1.2" />

See Also