I have this on my BM but it wont play or preache any sound file.
PHP Code:
new g_sound_music[][] =
{
"sound/misc/sg1.mp3",
"sound/misc/sg2.mp3",
"sound/misc/sg3.mp3",
"sound/misc/sg4.mp3",
"sound/misc/sg5.mp3"
};
new bool:g_BlockMusic;
public plugin_precache()
{
for(new i=0; i<sizeof(g_sound_music); i++)
{
precache_generic(g_sound_music[i]);
}
}
public ActionMusic()
{
if(!g_BlockMusic)
{
new rand = random(sizeof(g_sound_music));
new command[128];
format(command, charsmax(command), "mp3 play %s", g_sound_music[rand]);
new iPlayers[32], iNum;
get_players(iPlayers, iNum);
for(new i=0;i<=iNum;i++)
{
new id = iPlayers[i];
if(is_user_connected(id))
{
client_cmd(id, command);
}
}
g_BlockMusic = true;
set_task(40.0, "AllowMusic");
}
}
public AllowMusic()
{
g_BlockMusic = true;
}