SetAmbientSoundEnabled: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "__NOTOC__ {{Server client function}} This function allows you to disable some background sound effects. ==Syntax== <syntaxhighlight lang="lua"> bool setAmbientSoundEnabled( string type, bool e...")
 
mNo edit summary
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
{{Server client function}}
{{Client function}}
{{Note box|See Also: [[setWorldSoundEnabled]]}}
 
This function allows you to disable some background sound effects.
This function allows you to disable some background sound effects.


==Syntax==
==Syntax==
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
bool setAmbientSoundEnabled( string type, bool enable )
bool setAmbientSoundEnabled( string theType, bool enable )
</syntaxhighlight>  
</syntaxhighlight>  


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


Line 23: Line 25:


==See Also==
==See Also==
{{World functions}}
{{Client world functions}}

Revision as of 17:25, 6 September 2012

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

This function allows you to disable some background sound effects.

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