Using point_servercommand to activate cheats to send client commands to players? EEEek. Yeah dont do that.
You could instead use a trigger that spans across the entire map named something like
SoundscapeT1_Aud (track1), set it to start disabled, and also filter it to people not matching the DJ (
find out how to do pretty much that here). Then also make another map-wide trigger named something like
SoundscapeT1_DJ, starts disabled, that is filtered to only the DJ. Then on both of those add an output like: OnUser1 !self Disable
Then make an env_soundscape named
soundscape_track1 and set the Soundscape keyvalue to MapName.Track1
To create that soundscape, copy this and paste it into a text file named soundscapes_mapname.txt (also include version number) and don't forget to pack the txt file into the map as well at the end.
"MapName.Track1"
{
"dsp" "1"
"playlooping"
{
"volume" ".25"
"pitch" "100"
"wave" "music/track1.wav"
}
}
You will then need to activate the soundscape trigger somehow (I assume you are using a DJ panel with a bunch of func_buttons? Hopefully so cause that's what I'm gonna write up about). So make a func_button named DJButton_T1_All
OnPressed SoundscapeT1_* Enable (enable both soundscape triggers)
OnPressed soundscape_track1 Enable (enable the soundscape)
OnPressed SoundscapeT2_* FireUser1 (turn off any other soundscape trigger if you have any)
etc
So far what should happen is both the players and the DJ will be associated with the soundscape and both will hear whatever music/track1.wav is on loop (you can set it to not loop by editing the soundscript,
lrnmoreabout that here). Now what you can do is make some other button that stops it playing for just the DJ, func_button named DJButton_T1_AudOnly OnPressed SoundscapeT1_DJ Disable
So it's stopped playing for the DJ, but you might still hear it because the track1 soundscape might still be set as your player's soundscape. So you'll need to make another env_soundscape for just the DJ with a small radius so it just surrounds him named
BlankSoundscape, set the soundscape to something like tf2.respawn_room, starts disabled, and make the DJButton_T1_AudOnly also then enable
BlankSoundscape. So now the stop playing for DJ button disables the trigger for Track1 for him and enables the trigger for blank soundscape for him. You'll need to disable the blank soundscape before you play any song for everyone again, can just set every DJ-start-for-everyone button to
BlankSoundscape Disable.
You can then repeat the process making a new MapName.Track in the soundscape txt file, new buttons for DJButton_T_All and DJButton_T_AudOnly, set to FireUser1 on all other Soundscape_T_*, and enable SoundScape_T(numberhere)_*, also enable the env_soundscape for that specific track.
I haven't tested any of this, but I've played around with soundscapes a bunch so it might. If you need help with the triggerable soundscapes Ravidge made a tutorial (with vmf) that shows how to do them
here. If you need help with the soundscape txt file, check the bottom of the
soundscripts page on VDC, if you need help with filtered to only the audience/DJ triggers
check the posts I made here, if you need help with FireUser1
check this page on the VDC. I'll check back later to see if you need any help or if I'm completely wrong.
Edit: Oh, I think I just figured out what you meant, that you have a "stop playing this song for me button" and it does what it's labelled as? (shoulda been more clear on that if that's the case). But you could, instead of making all this DJ separate entity crap, just have the buttons dictate what soundscape trigger across the map is enabled, along with what soundscape entity is enabled, and disable all other track soundscapes. Now, if my assumptions are correct, when a player's soundscape is set, he will keep the soundscape no matter where he goes until you change his soundscape somehow else. So you could also have the buttons on the DJ panel, after a delay, disable the trigger of the current soundscape that is playing. And then also have a separate button somewhere else as your "stop playing" button, and then just have a tiny radius env_soundscape on top of it, that gets enabled by the button and disabled shortly after. (tf2.respawn_room). So that way, the-player-who-hit-stop's soundscape will be set to tf2.respawn_room while everyone else's soundscape will remain as MapName.Track1.