Jump to content

Stop Map Music, Play Another Song Command


Fighter
Go to solution Solved by eezstreet,

Recommended Posts

Basically, what I'm trying to do is make a music command (serverside) that will stop the current map music, and play a song specified by an admin from the music folder for everyone on the server that will loop. I've managed to add the ability to play sound likes taunts, screams, etc from the sound folder:

 

http://slexy.org/view/s20agBvF6H

 

However, this won't let me stop the current map music and play a song from the music folder, as when I try to do that, I get an error that the file is stereo.

 

Could someone point me in the right direction on how to stop the current map music and play a stereo sound file for everyone on the server?

 

Thanks.

Link to comment
  • Solution

You need to set the music configstring in order to make it play the music.

trap_SetConfigstring( CS_MUSIC, soundPath );

Best way to check if you're playing music or sound (if you're altering your sound command to play music for each client as well) is to check the beginning of the file name thusly:

if(!Q_stricmpn(soundPath, "sound/", 6)) {

if(!Q_stricmpn(soundPath, "music/", 6)) {

Edited by eezstreet
Fighter likes this
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...