AR/setSoundEffectEnabled: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(setSoundEffectEnabled)
 
mNo edit summary
 
(One intermediate revision by one other user not shown)
Line 17: Line 17:
Returns ''true'' if the effect was set successfully, ''false'' otherwise.
Returns ''true'' if the effect was set successfully, ''false'' otherwise.


==Example==  
==مثال==  
This example creates a sound and set's the flanger sound effect enabled.
This example creates a sound and set's the flanger sound effect enabled.
<syntaxhighlight lang="lua">addCommandHandler("flanger",function(cmd,enabled)
<syntaxhighlight lang="lua">addCommandHandler("flanger",function(cmd,enabled)
Line 35: Line 35:
==أنظر أيضاً==
==أنظر أيضاً==
{{AR/Audio_functions}}
{{AR/Audio_functions}}
[[pt-br:setSoundEffectEnabled]]

Latest revision as of 01:32, 19 August 2021

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

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.

مثال

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,true) --set it case sensitive as we are going to get the command name and use it in the setSoundEffectEnabled

Changelog

Version Description
1.3.2 Added player element for voice control

أنظر أيضاً