SetCloudsEnabled: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Added setCloudsEnabled)
 
m (Woops)
Line 17: Line 17:
==Example==  
==Example==  
<section name="Server" class="server" show="true">
<section name="Server" class="server" show="true">
This example hides the ammo and weapon displays for players when they join.
This example Disables clouds for all players
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
function disableClouds ()
function disableClouds ()

Revision as of 16:33, 7 June 2009

This function will enable or disable clouds, This is useful for race maps that spawn high up as clouds can cause low FPS.

Syntax

bool setCloudsEnabled( bool Enabled )

Required Arguments

  • Enabled: a bool determining if clouds should be shown (true) to show clouds (false) to hide them

Returns

Returns true if the clouds where shown or hidden 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
-- Make our hudChanger function called when the player joins
addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), disableClouds )