SetCloudsEnabled: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 21: Line 21:
     setCloudsEnabled ( false )    -- Hide the clouds for all players when the resource starts
     setCloudsEnabled ( false )    -- Hide the clouds for all players when the resource starts
end
end
addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), disableClouds )
addEventHandler ( "onResourceStart", getResourceRootElement(), disableClouds )
</syntaxhighlight>
</syntaxhighlight>
</section>
</section>

Revision as of 16:45, 11 February 2015

This function will enable or disable clouds. This is useful for race maps which are placed high up as clouds can cause low FPS.

Syntax

bool setCloudsEnabled ( bool enabled )

Required Arguments

  • enabled: A boolean value determining if clouds should be shown. Use true to show clouds and false to hide them.

Returns

Returns true if the cloud state was changed succesfully, false if an invalid argument was specified.

Example

Click to collapse [-]
Server

This example Disables clouds for all players

function disableClouds ()
    setCloudsEnabled ( false )    -- Hide the clouds for all players when the resource starts
end
addEventHandler ( "onResourceStart", getResourceRootElement(), disableClouds )

See Also