Difference between revisions of "SetAmbientSoundEnabled"

From Multi Theft Auto: Wiki
m (Linked two similar named functions in the notebox until (if?) one is deprecated)
Line 2: Line 2:
 
{{Client function}}
 
{{Client function}}
 
This function allows you to disable some background sound effects.
 
This function allows you to disable some background sound effects.
 +
 +
{{Note box|See Also: [[setWorldSoundEnabled]]}}
  
 
==Syntax==
 
==Syntax==

Revision as of 17:25, 6 September 2012

This function allows you to disable some background sound effects.

This template is no longer in use as it results in poor readability.

Syntax

bool setAmbientSoundEnabled( string theType, bool enable )

Required Arguments

  • theType: The type of ambient sound to toggle. Can be either "gunfire" or "general".
  • enable : Set false to turn off, true to turn on

Returns

Returns true if the ambient sound was set correctly, false if invalid values were passed.

Example

This example turns off the ambient water and gunfire sounds:

setAmbientSoundEnabled( "general", false )
setAmbientSoundEnabled( "gunfire", false )

See Also

BETA: FROM VERSION 1.5.7 r20450 ONWARDS