Day of Defeat Plugins Community
This site is an archive — everything is readable and downloadable, nothing can be posted. Admin
Archive › Old Forum Threads › General › Requests for DoD Plugins › Music when u connect to server
22 posts, 7 people · 11,686 views Thread Rating: ★★★★★
closedMusic when u connect to server
Started by johnnyskid on 11-17-2006, 11:27 PM
johnnyskid
started this thread
Posts: 66
Threads: 14
Joined: Aug 2006
11-17-2006, 11:27 PM #1

hello,rnrni know that there is a few plugins out there that allow you to hear music when you connect to a server.rnrnrnWhere can I find the best one?

diamond-optic
posted here
Posts: 2,068
Threads: 103
Joined: May 2005
11-18-2006, 12:58 AM #2

search around the amxmodx.org forums for non-dod specific stuffers... you'll find a few different versions of a plugin called something like 'loadingsong' or 'loadingsound' something like that...

=|[76AD]|= TatsuSaisei
posted here
Posts: 794
Threads: 54
Joined: May 2005
11-18-2006, 10:40 AM #3
hello,n ni know that there is a few plugins out there that allow you to hear music when you connect to a server.n n nWhere can I find the best one?
n n
 n#include <amxmodx> n#include <engine> npublic plugin_init() { nregister_plugin("The Box - Connect Song","76.0","TatsuSaisei") nreturn PLUGIN_CONTINUE n} npublic plugin_precache() { nprecache_generic("sound/mp3s/theboxbit.mp3") nreturn PLUGIN_CONTINUE n} npublic client_connect(id) { nclient_cmd(id,"MP3Volume 1.0")nclient_cmd(id,"mp3 play sound/mp3s/theboxbit.mp3") nreturn PLUGIN_CONTINUE n} n
n nThis is as "simple" as you can get.....n nbut hey, how about a random song from a list ?n n
 n#include <amxmodx>n n// change maxsounds # to equal number of songs to randomly playn#define Maxsounds 4n n// # of songs listed here MUST be equal to # in maxsoundsnnew soundlist[Maxsounds][] = {"bodies","disturbed","comfortablynumb","systemofthedown"}n n// downloads files to clients if they not have itn// be sure to add another line if you add more songsnpublic plugin_precache() { nprecache_generic("sound/misc/bodies.mp3") nprecache_generic("sound/misc/disturbed.mp3") nprecache_generic("sound/misc/comfortablynumb.mp3")nprecache_generic("sound/misc/systemofthedown.mp3") nreturn PLUGIN_CONTINUE n}n//  DONT TOUCH CODE BELOW THIS - Initializationnpublic plugin_init() {nregister_plugin("Random Connect Songs","76.0","TatsuSaisei")nreturn PLUGIN_CONTINUEn}n//plays one of the songs randomlynpublic client_connect(id) {nnew ini = random_num(0,Maxsounds-1)nclient_cmd(id,"MP3Volume 1.0")nclient_cmd(id,"mp3 play sound/misc/%s",soundlist[i])nreturn PLUGIN_CONTINUEn}n
=|[76AD]|= TatsuSaisei
posted here
Posts: 794
Threads: 54
Joined: May 2005
11-22-2006, 01:53 AM #4

btw, if your MP3Volume is set to 0 you will never hear any mp3s playing... I altered code to "fix" this for now by manually setting it to a value...

diamond-optic
posted here
Posts: 2,068
Threads: 103
Joined: May 2005
11-22-2006, 08:09 PM #5

you should have it check that its set to 0 first :-

=|[76AD]|= TatsuSaisei
posted here
Posts: 794
Threads: 54
Joined: May 2005
11-22-2006, 11:45 PM #6
you should have it check that its set to 0 first :-
n nyou know... I never had any luck with that function working for me (query_client_cvar) but the other day I did run across a function that might serve the same function and work.. but I had not gotten to it yet...

diamond-optic
posted here
Posts: 2,068
Threads: 103
Joined: May 2005
11-23-2006, 12:56 AM #7

hmm really?nni have it in the shell shock plugin.. and it seems to be working in most cases (except the occasional person says it doesnt work)

=|[76AD]|= TatsuSaisei
posted here
Posts: 794
Threads: 54
Joined: May 2005
11-23-2006, 02:54 AM #8
hmm really?n ni have it in the shell shock plugin.. and it seems to be working in most cases (except the occasional person says it doesnt work)
nThat is where I originally got the idea to check a clients setting... and I am one of those people it did not work for, nor any of the others I asked... I actually even made a few test lines of code that would simply report back what the setting was in chat... everyone I asked who saw their message come up stated that the message was telling them it was always zero...

| |OnEHiTwOnDeR|SoCal
posted here
Posts: 320
Threads: 37
Joined: Mar 2007
04-14-2007, 09:19 PM #9

i realize im like reopening a thread from yrsss ago but would this make the client have t0 download the sound(mp3)

diamond-optic
posted here
Posts: 2,068
Threads: 103
Joined: May 2005
04-14-2007, 11:12 PM #10

yeah it would..

| |OnEHiTwOnDeR|SoCal
posted here
Posts: 320
Threads: 37
Joined: Mar 2007
04-15-2007, 02:44 AM #11

thanks d - o

meathead
posted here
Posts: 337
Threads: 23
Joined: Aug 2007
09-20-2007, 03:15 PM #12

Hey,rnUsing this plugin and it is working but with 3 problems.rn rnserver failed to download 1 of the mp3s. I changed the list and it did it again to a different mp3.rnrnMissing wave file riff chunks (this message is repeated about 6 times)rnrnWhen the precache is finished the song switches to a different song.rnrnAny way to fix?rnrnOr any plugins that work better? All the plugins on alliedmodders are followed by pages of problems. :(

=|[76AD]|= TatsuSaisei
posted here
Posts: 794
Threads: 54
Joined: May 2005
09-20-2007, 05:00 PM #13
nMissing wave file riff chunks (this message is repeated about 6 times)n
nchange precache_sound to precache_generic n n(i edited my above post to reflect these changes)

meathead
posted here
Posts: 337
Threads: 23
Joined: Aug 2007
09-21-2007, 03:37 AM #14

Server fails to dowload any of the files. I deleted them from my pc and tried again, still the same. Music still plays, if you had the files. Still changes songs between precahe and game but no missing riff wave chunks.nnNo, I just noticed I didn't update the code correctly. Sorry. Trying again!

diamond-optic
posted here
Posts: 2,068
Threads: 103
Joined: May 2005
09-21-2007, 11:12 PM #15

which switching from precache_sound to precache_generic you need to add the /sound/ or whatever part of the directory to the file name

meathead
posted here
Posts: 337
Threads: 23
Joined: Aug 2007
09-22-2007, 02:17 AM #16

Yes, I saw that finally and fixed it. Thanks Diamond.rnNow I get 1 of the mp3 files failed to download. Checking my script again for a typo. Its always the same one,(Jump), so it must be a typo. Then I get error messages that all the map sound files on the fast html failed to upload. They are already on my pc, so I go to game no problem. Next, I am now having lag in game. Appears to be whenever they're sounds being made. The sound stutters badly, and I see a severe stutter when trying to move around. Could be a separate issue caused by all the new steam stuff. Don't know yet.rnDo I need to change my mp3s to just short snippets? Right now they are full size. Cut back from 12 to 8 songs today, but saw no improvement.rnDoes the cache get cleared out on its own, or do I just need to minimize the amount of the files?rnrnThanks GuysrnSorry to be a pain and appreciate your help very much!!!!! rnMeatheadrnrn#include <amxmodx>rn rn// change maxsounds # to equal number of songs to randomly playrn#define Maxsounds 8rn rn// # of songs listed here MUST be equal to # in maxsoundsrnnew soundlist[Maxsounds][] = {"Spirit","Freak","Mtv","Girls","Mother","Fantasy","Mudshovel","Jump"}rn rn// downloads files to clients if they not have itrn// be sure to add another line if you add more songsrnpublic plugin_precache() { rnprecache_generic("sound/misc/Spirit.mp3") rnprecache_generic("sound/misc/Freak.mp3") rnprecache_generic("sound/misc/Mtv.mp3")rnprecache_generic("sound/misc/Attack.mp3")rnprecache_generic("sound/misc/Girls.mp3")rnprecache_generic("sound/misc/Mother.mp3")rnprecache_generic("sound/misc/Jump.mp3")rnprecache_generic("sound/misc/Fantasy.mp3")rnprecache_generic("sound/misc/Mudshovel.mp3")rnrn rnreturn PLUGIN_CONTINUE rn}rn// DONT TOUCH CODE BELOW THIS - Initializationrnpublic plugin_init() {rnregister_plugin("Random Connect Songs","76.0","TatsuSaisei")rnreturn PLUGIN_CONTINUErn}rn//plays one of the songs randomlyrnpublic client_connect(id) {rnnew irni = random_num(0,Maxsounds-1)rnclient_cmd(id,"MP3Volume 1.0")rnclient_cmd(id,"mp3 play sound/misc/%s",soundlist[i])rnreturn PLUGIN_CONTINUErn}

=|[76AD]|= TatsuSaisei
posted here
Posts: 794
Threads: 54
Joined: May 2005
09-22-2007, 08:08 AM #17
Next, I am now having lag in game. Appears to be whenever they're sounds being made. The sound stutters badly, and I see a severe stutter when trying to move around. Could be a separate issue caused by all the new steam stuff. Don't know yet.nDo I need to change my mp3s to just short snippets?
n nThis "plugin" will not cause any lag during the game. The sounds ONLY play upon entering server UNLESS fast downloads are not working properly, in which case the "lag" could be when a player joins the server and is getting the files directly from the game server as opposed to from the fast download host server... in which case EVERYONE will notice the lag at the same time...n nand it doesn't matter how long or short the songs are... size will only affect the amount of time required to download the files...

Garion
posted here
Posts: 93
Threads: 9
Joined: Nov 2005
09-22-2007, 02:45 PM #18

here's the plugin I use on my server to play music while people are connecting.nnhttp://forums.alliedmods.net/showthread.php?t=46636&highlight=loading+soundnnwith that you just put the mp3 files in the correct folder and it will auto-download them and play them.nTho I do have 1 sound that won't play but that may just simply be something wrong with that file.

meathead
posted here
Posts: 337
Threads: 23
Joined: Aug 2007
09-24-2007, 12:42 PM #19

Thanks for the help. I might try that one. That would be less work if I change a song. Still using Tatsu's plugin for now. I am using the precache_sounds. rnIt has worked ever since I installed it. The missing riff wave chunks only shows up in console. No big deal. If I use the precache_generic, get way more failed to download messages for map items, (in console only). It works either way.rnThe 2 mp3's that wouldn't download must be incompatible with HL.rnAnother satisified customer!!!!rnThanks!rnMeathead hobo

TigerMan4
posted here
Posts: 317
Threads: 37
Joined: Aug 2006
11-14-2007, 10:19 AM #20

I have to put my 2cents in on this plugin.rnrnI played on a server that had the random music at the join screen.rnrnand let me tell you , if you don`t like the music choice of the server owner...you cant wait to either hit "CANCLE" or "join the game"rnrnMe...I hit cancle....omg....not only was the music horrid ! but it was so loud that it about blew my speakers out.rnrnSO CLICK !!!!! next server.rnrnI mean...if you logged onto my server and were stucking listening to a very loud .mp3 of "Thank God I`m a country boy" or "YMCA" , how fast would you want to turn tail and go to another server ?rnrnjust my 2cents.rnrnI know its in here somewhere....but....how the heck to make the .mp3s NOT play ? is it a cl_ command ? or an option ?

diamond-optic
posted here
Posts: 2,068
Threads: 103
Joined: May 2005
11-14-2007, 09:43 PM #21

well "mp3 stop" in console will stop them, but while connecting you cant get to the console...nnotherwise if its a server you play often or such, you could replace the mp3 file with a empty onennn..if you want tho, in options on the audio tab, theres MP3 Volume...

TigerMan4
posted here
Posts: 317
Threads: 37
Joined: Aug 2006
11-14-2007, 11:23 PM #22

I dont play often at all...infact...I`m going to delete the 10 files or whatever it was that it loaded on my pc...what a bunch of crappy songs...gah !

Archive › Old Forum Threads › General › Requests for DoD Plugins › Music when u connect to server
DoD Plugins Archive · Repository · Old Forum Threads · Maps · Admin · built 14 Sep 2026 00:34 UTC