ID:163343
 
    jukebox
icon = 'obj.dmi'
icon_state = "juke"
density = 1
name = "Jukebox"
verb
Play_Song()
set src in view(1)
view() << sound()
view() << sound('r5concert.mid',1)
view() << "[usr] plays the Jukebox!"

Here is a jukebox I want to know how to make it so when it plays to everyone in view it will stop for someone who has the var sound = 0. How can I make it do this?
Hellonagol wrote:
>   jukebox
> icon = 'obj.dmi'
> icon_state = "juke"
> density = 1
> name = "Jukebox"
> verb
> Play_Song()
> set src in view(1)
> view() << sound()
> view() << sound('r5concert.mid',1)
> view() << "[usr] plays the Jukebox!"
>

Here is a jukebox I want to know how to make it so when it plays to everyone in view it will stop for someone who has the var sound = 0. How can I make it do this?

you need to call sound(null), sound() is sound(src) [I think]
In response to Pirion (#1)
ok thx
sound(null) causes a sound to stop. You may also want to work with channels, to only cause specific sounds (such as your jukebox music) to stop playing, rather than stopping all sounds (including non-jukebox-related sounds like explosions and stuff).

-- Data
In response to Android Data (#3)
Jukebox
icon='obj.dmi'
icon_state="juke"
density=1
verb
Play_Song()
set src in oview(1)
for(var/mob/M in oview(src))
if(M.sound==0) M<<sound(null,1)
else M<<sound('r5concert.mid',1)
oview(src)<<"[usr] plays the Jukebox!"

o.O