SetVehiclesLODDistance: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(→‎See Also: +engineGet/SetModelLODDistance)
No edit summary
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Client function}}{{Needs Example}}__NOTOC__
{{Client function}}__NOTOC__
{{New feature/item|3.0154|1.5.3|11199|
{{New feature/item|3.0154|1.5.3|11199|
Sets the distance of vehicles LOD.
Sets the distance of vehicles LOD.
Line 6: Line 6:
==Syntax==
==Syntax==
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
bool setVehiclesLODDistance ( float vehiclesDistance, float trainsAndPlanesDistance = vehiclesDistance * 2.14 )
bool setVehiclesLODDistance(float vehiclesDistance [, float trainsAndPlanesDistance = vehiclesDistance * 2.14])
</syntaxhighlight>
</syntaxhighlight>
===Required Arguments===  
===Required Arguments===  
*'''vehiclesDistance:''' general distance used for most vehicles, this value is clamped to 0 – 500
*'''vehiclesDistance:''' general distance used for most vehicles, this value is clamped to 0 – 500
===Optional Arguments===
 
===Optional Arguments===  
{{OptionalArg}}
*'''trainsAndPlanesDistance:''' distance used for trains and planes, this value is clamped to 0 – 500
*'''trainsAndPlanesDistance:''' distance used for trains and planes, this value is clamped to 0 – 500
== Returns ==
This function returns ''true'' if arguments are valid. Returns ''false'' otherwise.
==Example==
<syntaxhighlight lang="lua">
addEventHandler("onClientResourceStart",resourceRoot,function()
setVehiclesLODDistance(10)
end)
</syntaxhighlight>


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

Latest revision as of 21:21, 7 October 2022

Sets the distance of vehicles LOD.

Syntax

bool setVehiclesLODDistance(float vehiclesDistance [, float trainsAndPlanesDistance = vehiclesDistance * 2.14])

Required Arguments

  • vehiclesDistance: general distance used for most vehicles, this value is clamped to 0 – 500

Optional Arguments

NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use. For more information on optional arguments, see optional arguments.

  • trainsAndPlanesDistance: distance used for trains and planes, this value is clamped to 0 – 500

Returns

This function returns true if arguments are valid. Returns false otherwise.

Example

addEventHandler("onClientResourceStart",resourceRoot,function()
	setVehiclesLODDistance(10)
end)

See Also