SetFarClipDistance: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
Line 18: Line 18:
<section name="Server" class="server" show="true">
<section name="Server" class="server" show="true">
The function which is adjusting visibility range of the game world.
The function which is adjusting visibility range of the game world.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">addEventHandler("onResourceStart",resourceRoot,function()
function onResourceStart(resource)
setFarClipDistance(3000) -- we adjust visibility range on 3000 metres
setFarClipDistance(3000) -- we adjust visibility range on 3000 metres
end)
end addEventHandler("onResourceStart",getResourceRootElement(getThisResource()),onResourceStart)
</syntaxhighlight>
</section>
<section name="Client" class="client" show="false">
The function which is adjusting visibility range of the game world.
<syntaxhighlight lang="lua">addEventHandler("onClientResourceStart",resourceRoot,function()
setFarClipDistance(3000) -- we adjust visibility range on 3000 metres
end)
</syntaxhighlight>
</syntaxhighlight>
</section>
</section>

Revision as of 21:18, 27 April 2012

This template is no longer in use as it results in poor readability.

This function is used to set the distance of render.

Syntax

bool setFarClipDistance ( float distance )

Required Arguments

  • distance: A float specifying the distance of render.

Returns

Returns true if the distance was set correctly, false if invalid arguments were passed.

Example

Click to collapse [-]
Server

The function which is adjusting visibility range of the game world.

addEventHandler("onResourceStart",resourceRoot,function()
	setFarClipDistance(3000) -- we adjust visibility range on 3000 metres
end)
Click to expand [+]
Client

See Also