Raised This Month: $51 Target: $400
 12% 

Loadingsong (play a song during the connection to server)


Post New Thread Reply   
 
Thread Tools Display Modes
beebster
Junior Member
Join Date: Dec 2004
Old 04-19-2005 , 15:24   help?
Reply With Quote #121

i dont wanna sound stupid and i dont know if this question has already been asked but is it possible to have a first download url and after it is done getting the files that it needs there, if the server still needs mor files it can get it from a second url.
beebster is offline
beebster
Junior Member
Join Date: Dec 2004
Old 04-19-2005 , 15:58   haha
Reply With Quote #122

haha i worded it soo wrong but i recently figured out that once the server is done getting ALL the files it needs from the URL if there is still files it checks the servers files.
beebster is offline
robbob4
Senior Member
Join Date: Jan 2005
Old 04-19-2005 , 18:00  
Reply With Quote #123

yep 1 url to dl any existing files and then dles from the server the rest.
robbob4 is offline
beerman
Junior Member
Join Date: Apr 2005
Old 04-22-2005 , 06:27  
Reply With Quote #124

Well, first off, I AM NEW AT THIS... When you download the files, what do you do?? Where do you copy and paste them?? I need to know all the details please!!!!
beerman is offline
beerman
Junior Member
Join Date: Apr 2005
Old 04-25-2005 , 06:44  
Reply With Quote #125

help?
beerman is offline
[FPS]dirtyjob
Junior Member
Join Date: Jan 2005
Old 04-25-2005 , 19:26   this works but
Reply With Quote #126

i used this code previuosly posted by someone here IT IS NOT MY CODE AND I DONT CLAIM IT TO BE and it works to play one tune durin connect for clients...copy and compile for the amxx plugin..use the compiler on this site..heres the code:


/*
* Play a sound during the connection.
*
* Random code part taken from plugin
* connectsound by White Panther
*
* v1.0
*
*/

#include <amxmodx>


public plugin_precache() {
precache_sound("misc/mysound.mp3")
return PLUGIN_CONTINUE
}


public client_connect(id) {

client_cmd(id,"mp3_volume 255")
client_cmd(id,"mp3 play sound/misc/mysound.mp3")
return PLUGIN_CONTINUE
}

public plugin_init() {
register_plugin("Loading Sound","1.0","Amxx User")
return PLUGIN_CONTINUE
}


make sure your mp3 is renamed mysound.mp3 and make a folder called sound in your mod root and a folder called misc in that sound folder ..place the mp3 you renamed mysound.mp3 in this misc folder....use downloadurl for fast transfer to the client or it will take time to dl it to the clien ..same as maps


now for a question from me: How can we make it so this will play random mp3s from the misc folder...the same connect tune gets old and im tired of changin it manually.
[FPS]dirtyjob is offline
Wolfbane
New Member
Join Date: May 2005
Old 05-10-2005 , 19:12  
Reply With Quote #127

Hmm....

Im having another problem. I first found this mod on another server and then talked to the server owner and so on.

Anyway... I have tried a few things on my own server.
I tried first with same songs as other owner hade and it worked fine.

Now I tried to add a few own songs of my own. And the old files work but not the new ones.

So I think I have problems with upploading songs to the player client. So I think the problem might be related to ports and so on. What ports must be open to upload things to clients.

Also ripped a song. Made it crap quality and mono. Would that effect it all ?

And if not that... can anyone els help me out what could be wrong.

Quote:
Originally Posted by The script
/*
* Play a sound during the connection.
*
* Random code part taken from plugin
* connectsound by White Panther
*
* v1.01
*
*/

#include <amxmodx>
#define Maxsounds 4

// sounds localized in gcf cache (valve/media)
// you can add more song if you want.
new soundlist[Maxsounds][] = {"hamster.mp3","austin.mp3","shut.mp3","vadfa n.mp3"}


public plugin_precache() {
precache_sound("misc/hamster.mp3")
precache_sound("misc/austin.mp3")
precache_sound("misc/shut.mp3")
precache_sound("misc/vadfan.mp3")
return PLUGIN_CONTINUE
}

public client_connect(id) {
new i
i = random_num(0,Maxsounds-1)
client_cmd(id,"mp3 play sound/misc/%s",soundlist[i])
return PLUGIN_CONTINUE
}


public plugin_init() {
register_plugin("loadsound","0.99","Wolfbane" )
return PLUGIN_CONTINUE
}
Location of my songs are ---> C:\Games\HLServer\cstrike\sound\misc

TNX in advance for all who reply with hints and tipps.

I still belive my problem is with uploading songs to the clients itself.

EDIT: I also looked into my Sound/misc folder and found the 4 files that I scripted for the program to loadsound hade created some other file "vadfan.mp3.ztmp", "shut.mp3.ztmp", "hamster.mp3.ztmp", "austin.mp3.ztmp"

Anyone have any clue what this is... and maybe if can help me solve my little problem.
__________________
Wolfbane is offline
meowmeow
Member
Join Date: Sep 2004
Old 05-12-2005 , 10:13  
Reply With Quote #128

If I want it to play Half-Life01 and Half-Life17 ONLY, then what should I do?
meowmeow is offline
Buzzaard
Member
Join Date: Apr 2005
Location: Florida
Old 05-15-2005 , 21:16  
Reply With Quote #129

Look at Odins post on the first page.
I have a DOD server and wanted some war music to play on client loading.
I found 6 songs, Hogans heros theme, The Great Escape theme, Vrodin a german marching song, Rommels March, MASH Theme, The Bridge over the river Kwai Theme,
I then renamed the mp3's to hogansheros.mp3, greatescape.mp3, , vrodin.mp3, rommel.mp3, mash.mp3, riverkwai.mp3.

Then I just changed each mysong to the name of one of my songs and chamged the max songs from 5 to 6 because I have 6 songs

First Odins posted sma then mine. My changes are in red
Quote:
Originally Posted by [OSA
Odin's SMA]

Test2

Code:
#include <amxmodx>
#define Maxsounds 5

new soundlist[Maxsounds][] = {"mysong1","mysong2","mysong3","mysong4","mysong5"}


public plugin_precache() {
	precache_sound("misc/mysong1.mp3")
	precache_sound("misc/mysong2.mp3")
	precache_sound("misc/mysong3.mp3")
	precache_sound("misc/mysong4.mp3")
	precache_sound("misc/mysong5.mp3")
	return PLUGIN_CONTINUE
}



public client_connect(id) {
	new i
	i = random_num(0,Maxsounds-1)
	client_cmd(id,"mp3 play sound/misc/%s",soundlist[i])
	return PLUGIN_CONTINUE
}


public plugin_init() { 
   register_plugin("azure demo","2.0","Amxx Newbie") 
   return PLUGIN_CONTINUE 
}
Quote:
Originally Posted by Buzzaard's SMA
#include <amxmodx>
#define Maxsounds 6

new soundlist[Maxsounds][] = {"hogansheros","greatescape","vrodin","rommel ","mash"","riverkwai"}

public plugin_precache() {
precache_sound("misc/hogansheros.mp3")
precache_sound("misc/greatescape.mp3")
precache_sound("misc/vrodin.mp3")
precache_sound("misc/rommel.mp3")
precache_sound("misc/mash.mp3")
precache_sound("misc/riverkwai.mp3")
return PLUGIN_CONTINUE
}

public client_connect(id) {
new i
i = random_num(0,Maxsounds-1)
client_cmd(id,"mp3 play sound/misc/%s",soundlist[i])
return PLUGIN_CONTINUE
}

public plugin_init() {
register_plugin("azure demo","2.0","Amxx Newbie")
return PLUGIN_CONTINUE
}
Then I copied all 6 songs to my dedicated server
dod/sound/misc folder
I the compiled the plugin, put it in my plugins folder.
addons/amxmodx/plugins
Modified the plugin.cfg file to run the plugin
addons/amxmodx/configs/plugin.cfg

I restarted my server and joined it then downloaded real slow.
So then I went to my webserver that I have set up already and added the 6 songs to the sound/misc folder.
After rejoining my server automatically used the files on the webserver and they downlaoded in about 3 seconds on cable modem.

To set up you sv_downloadurl
add a folder on the ROOT directory of your server call it serverdl
then upload all your maps, sounds etc into that folder just the way they are in your steams /mod/ folder. Ie maps go into the maps directory, sounds go int the sound directory, sprites go in the sprites directory, ETC.

So if your website is www.CSRoxorz.com
your sv_downloadurl path in your server.cfg file would then be:
sv_downloadurl "www.CSRoxorz.com/serverdl/"


For the guy that wants to play wav files not mp3's just change the mp3 in the sma to wav like this. I have not tested it so it might not work
Quote:
#include <amxmodx>
#define Maxsounds 5

new soundlist[Maxsounds][] = {"mysong1","mysong2","mysong3","mysong4","mys ong5"}


public plugin_precache() {
precache_sound("misc/mysong1.wav")
precache_sound("misc/mysong2.wav")
precache_sound("misc/mysong3.wav")
precache_sound("misc/mysong4.wav")
precache_sound("misc/mysong5.wav")
return PLUGIN_CONTINUE
}



public client_connect(id) {
new i
i = random_num(0,Maxsounds-1)
client_cmd(id,"wav play sound/misc/%s",soundlist[i])
return PLUGIN_CONTINUE
}


public plugin_init() {
register_plugin("azure demo","2.0","Amxx Newbie")
return PLUGIN_CONTINUE
}
Hopefully this post helped answer about 6 questions

Buzzaard
Buzzaard is offline
Buzzaard
Member
Join Date: Apr 2005
Location: Florida
Old 05-15-2005 , 21:21  
Reply With Quote #130

Quote:
Originally Posted by meowmeow
If I want it to play Half-Life01 and Half-Life17 ONLY, then what should I do?
Quote:
#include <amxmodx>
#define Maxsounds 2

// sounds localized in gcf cache (valve/media)
// you can add more song if you want.
new soundlist[Maxsounds][] = {"Half-Life01",","Half-Life17"}

public client_connect(id) {
new i
i = random_num(0,Maxsounds-1)
client_cmd(id,"mp3 play media/%s",soundlist[i])
return PLUGIN_CONTINUE
}

public plugin_init() {
register_plugin("Loading Sound","1.0","Amxx User")
return PLUGIN_CONTINUE
}
Then compile the plugin and put it on your server and add it to the plugins.cfg file and RESTART your server. Usually you can just change maps instead of restarting.

make sure to put this file in your amxmod.cfg file
exec server.cfg

This execs the server.cfg file at every mapchange
Handy for modifying the server.cfg file as it reloads it at the next mapchange and you dont have to restart.

Quote:
Wolfbane
Did you compile the sma after changing it and replace the old one in the plugins directory. You did everything right.

Also the zmtp file are a zipped version of your songs you can delete them if you want.

Quote:
Originally Posted by beerman
Well, first off, I AM NEW AT THIS... When you download the files, what do you do?? Where do you copy and paste them?? I need to know all the details please!!!!
Not sure what you mean, the server will download them to the proper place when you connect.

But you should UPLOAD them to your servers /mod/sound/misc directory so that a client can download them.
Also upload them to your web server you use for the sv_downloadurl f you are using one. If you have one the server will use the sv_downloadurl location first and if the file doesnot exist it then sends it from your /mod/ server

I.E.
/mod/ = cstrike, dod, tfc, or whatever mod you are running.

example for cstrike
/mod/sound/misc
would be
/cstrike/sound/misc

Getit ? GOOD!
Buzzaard is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:32.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode