GetSoundEffects: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
m (simple ex.)
Line 28: Line 28:
==See Also==
==See Also==
{{Client_audio_functions}}
{{Client_audio_functions}}
[[Category:Needs_Example]]

Revision as of 13:56, 14 March 2013

Returns the states of all effects of a sound.

Syntax

table getSoundEffects ( element sound )

Required Arguments

Returns

Returns a table with the effect names as the keys, and their states as the values if successful. Otherwise, it returns false.

Sound effect names:

  • gargle
  • compressor
  • echo
  • i3dl2reverb
  • distortion
  • chorus
  • parameq
  • reverb
  • flanger

Example

function switchEffects(sound)
	for _,v in ipairs(getSoundEffects(sound)) do -- Go through the whole list of sound effects for the sound
		if v == "gargle" then -- If the sound effect is 'gargle', proceed
			setSoundEffectEnabled(sound, "gargle", false) -- Disable the 'gargle' -effect
		end
	end
end

See Also