SetFarClipDistance: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
DREFTHUN (talk | contribs)
Undo revision 69618 by DREFTHUN (talk)
Tag: Undo
IManGaaX (talk | contribs)
No edit summary
 
Line 2: Line 2:
{{Server client function}}
{{Server client function}}
This function is used to set the distance of render. Areas beyond the specified distance will not be rendered.
This function is used to set the distance of render. Areas beyond the specified distance will not be rendered.
[[File:Far.png|thumb|example for function]]


==Syntax==
==Syntax==
Line 7: Line 8:
bool setFarClipDistance ( float distance )
bool setFarClipDistance ( float distance )
</syntaxhighlight>
</syntaxhighlight>
[[File:Far.png|thumb|example for function]]


===Required Arguments===  
===Required Arguments===  
*'''distance:''' A float specifying the distance of render. '''Setting this less than 5 will cause problems to the client.'''
*'''distance:''' A float specifying the distance of render. '''Setting this less than 5 will cause problems to the client.'''
===Returns===
===Returns===
Returns ''true'' if the distance was set correctly, ''false'' if invalid arguments were passed.
Returns ''true'' if the distance was set correctly, ''false'' if invalid arguments were passed.


==Example==
==Example==
Line 31: Line 19:
This example adjusts the visibility range of the game world.
This example adjusts the visibility range of the game world.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
addEventHandler( "onResourceStart", resourceRoot,
addEventHandler("onResourceStart", resourceRoot,
function( )
    function()
setFarClipDistance( 3000 ) -- We adjust visibility range to 3000 metres
        setFarClipDistance(3000) -- We adjust visibility range to 3000 metres
end
    end
)
)
</syntaxhighlight>
</syntaxhighlight>
</section>
</section>
<section name="Client" class="client" show="false">
<section name="Client" class="client" show="true">
This example adjusts the visibility range of the game world.
This example adjusts the visibility range of the game world.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
addEventHandler( "onClientResourceStart", resourceRoot,
addEventHandler("onClientResourceStart", resourceRoot,
function( )
    function()
setFarClipDistance( 3000 ) -- We adjust visibility range to 3000 metres
        setFarClipDistance(3000) -- We adjust visibility range to 3000 metres
end
    end
)
)
</syntaxhighlight>
</syntaxhighlight>

Latest revision as of 00:29, 6 October 2026

This function is used to set the distance of render. Areas beyond the specified distance will not be rendered.

example for function

Syntax

bool setFarClipDistance ( float distance )

Required Arguments

  • distance: A float specifying the distance of render. Setting this less than 5 will cause problems to the client.

Returns

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

Example

Click to collapse [-]
Server

This example adjusts the visibility range of the game world.

addEventHandler("onResourceStart", resourceRoot,
    function()
        setFarClipDistance(3000) -- We adjust visibility range to 3000 metres
    end
)
Click to collapse [-]
Client

This example adjusts the visibility range of the game world.

addEventHandler("onClientResourceStart", resourceRoot,
    function()
        setFarClipDistance(3000) -- We adjust visibility range to 3000 metres
    end
)

See Also