function Play3DSound takes string sndstring, location l, real mindist, real maxdist, real cutoff returns nothing
local sound snd
set snd = CreateSound(sndstring, false, true, true, 10, 10, "DefaultEAXON")
call SetSoundChannel(snd, 0)
call SetSoundDistances(snd, mindist, maxdist)
call SetSoundDistanceCutoff(snd, cutoff)
call SetSoundDuration(snd, GetSoundFileDuration(sndstring))
call SetSoundVolume(snd, 127)
call SetSoundConeAngles(snd, 0.0, 0.0, 127)
call SetSoundConeOrientation(snd, 0.0, 0.0, 0.0)
call SetSoundPitch(snd, 1.0)
call SetSoundPosition(snd, GetLocationX(l), GetLocationY(l), GetLocationZ(l))
call StartSound(snd)
call KillSoundWhenDone(snd)
set snd = null
set sndstring = null
endfunction
function PlayGlobalSound takes string sndstring returns nothing
local sound snd
set snd = CreateSound(sndstring, false, true, true, 10, 10, "DefaultEAXON")
call SetSoundChannel(snd, 0)
call SetSoundDistances(snd, 0, 250000.00)
call SetSoundDistanceCutoff(snd, 250000.00)
call SetSoundDuration(snd, GetSoundFileDuration(sndstring))
call SetSoundVolume(snd, 127)
call SetSoundConeAngles(snd, 0.0, 0.0, 127)
call SetSoundConeOrientation(snd, 0.0, 0.0, 0.0)
call SetSoundPitch(snd, 1.0)
call SetSoundPosition(snd, GetLocationX(udg_GlobalSoundPoint), GetLocationY(udg_GlobalSoundPoint), 0)
call StartSound(snd)
call KillSoundWhenDone(snd)
set snd = null
set sndstring = null
endfunction