SetSoundEffectEnabled: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
Line 16: Line 16:


==Example==  
==Example==  
<syntaxhighlight lang="lua">
This example creates a sound and set's the flanger sound effect enabled.
-- TODO
<syntaxhighlight lang="lua">addCommandHandler("flanger",function(cmd,enabled)
if(isElement(waterSplashes))then
setSoundEffectEnabled(waterSplashes,cmd,enabled)
else
waterSplashes = playSound("splashes.mp3",true)
setSoundEffectEnabled(waterSplashes,cmd,enabled)
end
end)
</syntaxhighlight>
</syntaxhighlight>



Revision as of 22:21, 27 May 2012

Used to enable or disable specific sound effects.

Syntax

bool setSoundEffectEnabled ( element sound, string effectName, bool bEnable )

Required Arguments

  • sound: a sound element.
  • 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

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

Example

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)
	else
		waterSplashes = playSound("splashes.mp3",true)
		setSoundEffectEnabled(waterSplashes,cmd,enabled)
	end
end)

See Also