From Multi Theft Auto: Wiki
Jump to navigation Jump to search

Used to enable or disable specific sound effects. Use a player element to control a players voice with this function.


bool setSoundEffectEnabled ( element theSound/thePlayer, string effectName, bool bEnable )

OOP Syntax Help! I don't understand this!

Method: sound:setEffectEnabled(...)

Required Arguments

  • sound: a sound element or a player element which will affect the voice broadcast.
  • effectName: the effect you want to enable or disable
  • gargle
  • compressor
  • echo
  • i3dl2reverb
  • distortion
  • chorus
  • parameq
  • reverb
  • flanger
  • bEnable: true if you want to enable the effect, false if you want to disable it.


Returns true if the effect was set successfully, false otherwise.


This example creates a sound and set's the flanger sound effect enabled.

addCommandHandler("flanger", function(cmd, enabled)
	if isElement(waterSplashes) then
		setSoundEffectEnabled(waterSplashes, cmd, enabled)
		waterSplashes = playSound("splashes.mp3", true)
		setSoundEffectEnabled(waterSplashes, cmd, enabled)
end, true) --set it case sensitive as we are going to get the command name and use it in the setSoundEffectEnabled


Version Description
1.3.2 Added player element for voice control

See Also

BETA: NEW FEATURE (BUILD: 1.5.8 r20914)
BETA: NEW FEATURE (BUILD: 1.5.8 r20785)
BETA: NEW FEATURE (BUILD: 1.5.8 r20914)
BETA: NEW FEATURE (BUILD: 1.5.8 r20785)