GetVehiclesLODDistance: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
 
(3 intermediate revisions by one other user 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|
Returns the distance of vehicles LOD.
Returns the distance of vehicles LOD.
Line 14: Line 14:


==Example==
==Example==
This example shows the LOD distance of vehicles, helicopters and trains when the client resource started
This example shows the lod distance of vehicles
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
addEventHandler("onClientResourceStart",resourceRoot,function()
addEventHandler("onClientResourceStart",resourceRoot,function()
local vehicle,planes_trains = getVehiclesLODDistance()
local vehicles,planes_trains = getVehiclesLODDistance()
outputChatBox("LOD Distance of Vehicles: "..math.floor(vehicle),0,255,0)
outputChatBox("general distance of most vehicles: "..math.floor(vehicles),0,255,0)
outputChatBox("LOD Distance of Planes and Trains: "..math.floor(planes_trains),0,255,0)
outputChatBox("distance of planes and trains: "..math.floor(planes_trains),0,255,0)
end)
end)
</syntaxhighlight>
</syntaxhighlight>
Line 26: Line 26:
* [[engineGetModelLODDistance]]
* [[engineGetModelLODDistance]]
* [[engineSetModelLODDistance]]
* [[engineSetModelLODDistance]]
{{World functions}}
{{Client world functions}}

Latest revision as of 23:17, 22 July 2018

Returns the distance of vehicles LOD.

Syntax

float, float getVehiclesLODDistance ( )

Returns

  • float: general distance used for most vehicles
  • float: distance used for trains and planes

Example

This example shows the lod distance of vehicles

addEventHandler("onClientResourceStart",resourceRoot,function()
	local vehicles,planes_trains = getVehiclesLODDistance()
	outputChatBox("general distance of most vehicles: "..math.floor(vehicles),0,255,0)
	outputChatBox("distance of planes and trains: "..math.floor(planes_trains),0,255,0)
end)

See Also