ID:272303
 
How do i make it so that players who have their canlisten == 1 variable hear sounds in the view ?

view(src)<<sound('punch.wav')

so players who have their sound enabled may hear the sounds.

Thanks!
you have to loop through all the mobs in view()
Sasuke_Kun52 wrote:
How do i make it so that players who have their canlisten == 1 variable hear sounds in the view ?

view(src)<<sound('punch.wav')

Try looping through the view and testing each mob.
for(var/mob/M in view(src))
if(M.canlisten)
M << sound(file)
Check out my new lib, it handles these kind of problems in a more elegant fashion: http://www.byond.com/developer/Rockinawsome/SoundTags
In response to Rockinawsome
Rockinawsome wrote:
Check out my new lib, it handles these kind of problems in a more elegant fashion: http://www.byond.com/developer/Rockinawsome/SoundTags

You have to upload the lib to the hub before anyone can check it out (hence ID:642201). Instead of a download link, your hub just has "Currently unavailable."
In response to Kuraudo
http://www.byond.com/developer/forum/?id=642201

That explains what happens. I'm not stupid enough to think that something is available if it's not uploaded. I have quite a few other items working, hosted, and functional up on BYOND.