GetPedsLODDistance: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "__NOTOC__ {{Client function}} <!-- {{New feature/item|3.0156|1.5.5|6948|This function gets the peds LOD distance.}} --> This function gets the peds LOD distance. Default is 6...")
 
mNo edit summary
Line 4: Line 4:
{{New feature/item|3.0156|1.5.5|6948|This function gets the peds LOD distance.}}
{{New feature/item|3.0156|1.5.5|6948|This function gets the peds LOD distance.}}
-->
-->
This function gets the peds LOD distance. Default is 60.
This function gets the peds LOD distance.


==Syntax==  
==Syntax==  
Line 13: Line 13:


==Example==
==Example==
This example adds a ''/testmynearclipdistance'' command which outputs different things deppending of the current near clip distance.  
This example adds a ''/getpedsloddistance'' command which outputs the peds LOD distance to the chatbox.
<syntaxhighlight lang="lua">addCommandHandler( "getpedsloddistance",
<syntaxhighlight lang="lua">addCommandHandler( "getpedsloddistance",
     function( )
     function( )
         local pedsLODDistance = getPedsLODDistance( )
         local pedsLODDistance = getPedsLODDistance( )
         outputChatBox( pedsLODDistance == 60 and "Your peds LOD distance is normal." or ( pedsLODDistance > 60 and "You should be able to see peds farther." or "You shouldn't be able to see peds as far." ) )
         outputChatBox( "Your peds LOD distance is at " .. pedsLODDistance )
     end
     end
)</syntaxhighlight>
)</syntaxhighlight>

Revision as of 23:13, 22 July 2018

This function gets the peds LOD distance.

Syntax

float getPedsLODDistance ( )

Returns

This function returns a float containing the peds LOD distance.

Example

This example adds a /getpedsloddistance command which outputs the peds LOD distance to the chatbox.

addCommandHandler( "getpedsloddistance",
    function( )
        local pedsLODDistance = getPedsLODDistance( )
        outputChatBox( "Your peds LOD distance is at " .. pedsLODDistance )
    end
)

See also