I'm starting the sound for env_sprite entity like this:
Code:
emit_sound(ent, CHAN_STATIC, "ambience/alien_beacon.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
The sound loops all the time, it's fine for me.
But before deleting the entity, I want the sound to stop playing, so I use:
Code:
emit_sound(ent, CHAN_STATIC, "ambience/alien_beacon.wav", VOL_NORM, ATTN_NORM, SND_STOP, PITCH_NORM)
But that does not work, the sound still plays.
Also tried this:
Code:
message_begin(MSG_BROADCAST, SVC_STOPSOUND)
write_short(ent)
message_end()
Doesn't work either (maybe I use it wrong?)
The only thing that worked was client_cmd(0, "stopsound"), but that is not suitable for me because it stops other sounds.
So how to stop the sound?