|
Junior Member
|
10-06-2009
, 06:39
Re: Loading Music II v1.2.9
|
#127
|
I have used most of the mp3 files on the server through another plugin.
Quote:
#include <amxmodx>
// change maxsounds # to equal number of songs to randomly play
#define Maxsounds 6
// # of songs listed here MUST be equal to # in maxsounds
new soundlist[Maxsounds][] = {"Beer1","Beer2","Beer3","Beer4","game","shor tbodies"}
// downloads files to clients if they not have it
// be sure to add another line if you add more songs
public plugin_precache() {
precache_sound("misc/game.mp3")
precache_sound("misc/Beer2.mp3")
precache_sound("misc/Beer1.mp3")
precache_sound("misc/shortbodies.mp3")
precache_sound("misc/Beer3.mp3")
precache_sound("misc/Beer4.mp3")
return PLUGIN_CONTINUE
}
// DONT TOUCH CODE BELOW THIS - Initialization
public plugin_init() {
register_plugin("Random Connect Songs","76.0","TatsuSaisei")
return PLUGIN_CONTINUE
}
//plays one of the songs randomly
public client_connect(id) {
new i
i = random_num(0,Maxsounds-1)
client_cmd(id,"MP3Volume 1.0")
client_cmd(id,"mp3 play sound/misc/%s",soundlist[i])
return PLUGIN_CONTINUE
}
|
__________________
|
|
|
|