Have a try.
PHP Code:
#include <amxmodx>
//#include <ColorChat> //Uncomment
#define AMOUNT 11 // Total amount of songs/artists
new bool:DontPlay[33] = false
new const TITLE[AMOUNT][] =
{
"author/title", // 1st song's title and author
"author/title", // 2nd song's title and author
"author/title", // ..
"author/title",
"author/title",
"author/title",
"author/title",
"author/title",
"author/title",
"author/title",
"author/title" // no comma
}
new const MUSIC[AMOUNT][] =
{
"misc/sound.mp3", // 1st song
"misc/sound.mp3", // 2nd song
"misc/sound.mp3", // ...
"misc/sound.mp3",
"misc/sound.mp3",
"misc/sound.mp3",
"misc/sound.mp3",
"misc/sound.mp3",
"misc/sound.mp3",
"misc/sound.mp3",
"misc/sound.mp3" // no comma
}
public plugin_init() {
register_plugin("RoundSound", "1.0", "S!p")
register_logevent("KoniecRundy",1,"1=Round_End")
register_clcmd("say roundsound", "roundsound")
register_clcmd("say /roundsound", "roundsound")
register_clcmd("say_team roundsound", "roundsound")
register_clcmd("say_team /roundsound", "roundsound")
register_clcmd("say roundsound", "roundsound")
register_clcmd("say rs", "roundsound")
register_clcmd("say_team rs", "roundsound")
}
public client_connect(i) DontPlay[i] = false
public KoniecRundy(i)
{
new RandSong = random_num(1, AMOUNT)
for(new i=1 ; i<=32 ; i++)
{
if(!DontPlay[i])
{
client_cmd(i, "mp3 stop")
client_cmd(i, "stopsound")
client_cmd(i, "mp3 play %s", MUSIC[RandSong])
client_print(i, print_chat, "Now playing %s", TITLE[RandSong])
}
}
}
public roundsound(id)
{
if(DontPlay[id])
DontPlay[id] = false
else
DontPlay[id] = true
client_print(id, print_chat, "Round sound is %s.", DontPlay[id] ? "ON" : "OFF")
}
public plugin_precache()
{
for(new i = 1; i <= AMOUNT; i++)
{
precache_sound(MUSIC[i])
}
}