ID:270112
 
Is there any way to tap a verb into the audio on/off on the preferences options?
You could make a verb that toggles a "sound flag"

Whenever a sound is played, you should make it check if the sound flag is on before playing it.

There are probably a bunch of other ways but I can't think atm... its 3 am.
Specifically, no. This was probably done so that the game can't be abusive and change the client's options(if they didn't want sounds on, and the game kept turning it on, that'd be bad). You can control in-game whether the player should hear sounds or not with the method described by D4RK3(sorry if it's misspelled, I'm not l337 like that).

Hiead
In response to Hiead
mob/Move()
if(usr.sound==0)
return
else
view()<<'footsteps.wav'
..()

well this is my code for the one sound i cant stop. Every time i try, it errors out

and yes i know, there are probebly so many things wrong with this code. But it works and thats all i care about.
In response to Dark Krow
Well, it doesn't work. usr is not what you use there. Change the
    if(usr.sound==0)
return

to
    if(!sound)
return ..()

And I think it should run pretty cleanly.
Edit:
Oh, and view() should change to view(src).

Hiead
In response to Hiead
You forgot something, Hiead. =) ..() needs to be called even when sound is turned off, and because Move()'s return value is important you also need to return what ..() returns:

mob/Move()
if(src.sound)
view(src)<<'footsteps.wav'
return ..()


Also note that this version only needs one return statement. It's cleaner with just one.
In response to Crispy
Heh, oops. Overlooked that'n. =D

And yeah, I knew that it would be cleaner but I didn't really have time to explain it(had to take a shower, which for me takes a half hour, and then had to get to school..so I really shouldn't have even been on the forums at that time =P), but I was just pointing out the error in the way of him using the var==0 thing there, as it was obviously a boolean variable.

Hiead