Hi , can someone maybe tel me why this script do not work,
but if i use LoopSound(e,0) , instead of PlaySound(e,0) then it play the music.
i am testing this on and empty map.
function play_music_init(e)
end
function play_music_main(e)
PlayerDist = GetPlayerDistance(e)
if PlayerDist < 100 then
SetSoundVolume(100)
PlaySound(e,0)
end
end
edit
ok i have tested again. for some reason it does work but only if i go in side of the 100 range and then when i came out of the 100 range then the sound only starts to play. ??
Ok. my fault. i got it working like so
function play_music_init(e)
play_triger = 0
end
function play_music_main(e)
PlayerDist = GetPlayerDistance(e)
if PlayerDist < 100 and play_triger == 0 then
SetSoundVolume(100)
PlaySound(e,0)
play_triger = 1
end
end
i realize that that it will only play if i use a flag, because the script starts the sound over and over as long as i am in the 100 zone. ( so , no sound )
so my mistake.
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 4GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11