setFogDistance | Multi Theft Auto: Wiki Skip to content

setFogDistance

Client-side
Server-side
Shared

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


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 )
Required Arguments
  • distance: MISSING_PARAM_DESC

Returns

  • bool: value

Returns true if the distance changed successfully, false if bad arguments were passed.

Code Examples

shared

This 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

World Functions