This post has been marked by the post author as the answer.
use this one to play sound in zone1
-- Pcs
function play_sound1_init(e)
St_sound1 = 0
end
function play_sound1_main(e)
if g_Entity[e]['plrinzone']==1 then
LoopSound(e)
--SetSound(e,0)
--SetSoundVolume(70)
ActivateIfUsed(e)
else
if St_sound1 == 1 then
StopSound(e)
end
end
end
Then use this one to stop sound in zone1 and play sound in zone2
-- Pcs
function st_sound1_init(e)
end
function st_sound1_main(e)
if g_Entity[e]['plrinzone']==1 then
LoopSound(e)
--SetSound(e,0)
--SetSoundVolume(70)
ActivateIfUsed(e)
St_sound1 = 1
end
end
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11