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
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
__NOTOC__  
__NOTOC__  
{{Client function}}
{{Client function}}
<!--
{{New feature/item|3.0156|1.5.5|13771|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.


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


==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>


==See also==
==See also==
* [[engineGetModelLODDistance]]
* [[engineSetModelLODDistance]]
{{Client world functions}}
{{Client world functions}}

Latest revision as of 02:19, 23 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