getSoundEffects | Multi Theft Auto: Wiki Skip to content

getSoundEffects

Client-side
Server-side
Shared

Returns the states of all effects of a sound.

OOP Syntax Help! I don't understand this!

  • Method: sound:getEffects(...)

Syntax

table|false getSoundEffects ( sound/player theSound )
Required Arguments
  • theSound: A sound element.

Returns

  • table|false: effects
    • gargle
    • compressor
    • echo
    • i3dl2reverb
    • distortion
    • chorus
    • parameq
    • reverb
    • flanger

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

Code Examples

client
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
break
end
end
end