SetFogDistance: Difference between revisions
Jump to navigation
Jump to search
(Created page with "__NOTOC__ {{Server client function}} ==Syntax== <syntaxhighlight lang="lua"> bool setFogDistance ( float distance ) </syntaxhighlight>") |
m (→Arguments) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Server client function}} | {{Server client function}} | ||
This function changes the distance at which fog appears. Keep in mind that this function doesn't change the distance of render. | |||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua">bool setFogDistance ( float distance )</syntaxhighlight> | |||
===Arguments=== | |||
*'''distance:''' distance in GTA units at which fog will appear. Very short or negative distances will cause graphical bugs to the players. | |||
===Returns=== | |||
Returns ''true'' if the distance changed successfully, ''false'' if bad arguments were passed. | |||
==Example== | |||
<section name="Server" class="server" show="true"> | |||
This example makes any weather very clear when the resource that contains it starts. | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function makeWeatherClear() | |||
setFogDistance(500) -- Set the fog distance to 500 units, so any weather will appear to be extremely clear | |||
end | |||
addEventHandler("onResourceStart", resourceRoot, makeWeatherClear) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
</section> | |||
==See Also== | |||
{{World functions}} |
Latest revision as of 10:16, 18 May 2014
This function changes the distance at which fog appears. Keep in mind that this function doesn't change the distance of render.
Syntax
bool setFogDistance ( float distance )
Arguments
- distance: distance in GTA units at which fog will appear. Very short or negative distances will cause graphical bugs to the players.
Returns
Returns true if the distance changed successfully, false if bad arguments were passed.
Example
Click to collapse [-]
ServerThis example makes any weather very clear when the resource that contains it starts.
function makeWeatherClear() setFogDistance(500) -- Set the fog distance to 500 units, so any weather will appear to be extremely clear end addEventHandler("onResourceStart", resourceRoot, makeWeatherClear)
See Also
- areTrafficLightsLocked
- getAircraftMaxHeight
- getAircraftMaxVelocity
- getCloudsEnabled
- getFarClipDistance
- getFogDistance
- getGameSpeed
- getGravity
- getHeatHaze
- getInteriorSoundsEnabled
- getJetpackMaxHeight
- getMinuteDuration
- getMoonSize
- getOcclusionsEnabled
- getRainLevel
- getSunColor
- getSunSize
- getTime
- getTrafficLightState
- getWeather
- getWindVelocity
- getSkyGradient
- getPlayerBlurLevel
- getZoneName
- isGarageOpen
- removeWorldModel
- resetFarClipDistance
- resetFogDistance
- resetHeatHaze
- resetMoonSize
- resetRainLevel
- resetSkyGradient
- resetSunColor
- resetSunSize
- resetWindVelocity
- restoreAllWorldModels
- restoreWorldModel
- setAircraftMaxHeight
- setAircraftMaxVelocity
- setCloudsEnabled
- setFarClipDistance
- setFogDistance
- setGameSpeed
- setGarageOpen
- setGravity
- setHeatHaze
- setInteriorSoundsEnabled
- setMinuteDuration
- setMoonSize
- setOcclusionsEnabled
- setRainLevel
- setSkyGradient
- setSunColor
- setSunSize
- setTime
- setTrafficLightState
- setTrafficLightsLocked
- setWeather
- setWeatherBlended
- setWindVelocity
- setJetpackMaxHeight
- setPlayerBlurLevel