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