isAmbientSoundEnabled | Multi Theft Auto: Wiki Skip to content

isAmbientSoundEnabled

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 allows you to check if some background sound effects are enabled.

Syntax

bool isAmbientSoundEnabled ( string theType )
Required Arguments
  • theType: The type of ambient sound to test. Can be either "gunfire" or "general".

Returns

  • bool: value

Returns true if the ambient sound is enabled, false if it is disabled or invalid values were passed.

Code Examples

shared

This command checks if the type of ambient sound is enabled or not. /check

addCommandHandler("check",function(_,_type)
if isAmbientSoundEnabled(_type) then
outputChatBox(_type.." is enabled!",0,255,0)
else
outputChatBox(_type.." is disabled!",255,0,0)
end
end)

See Also

World Functions