18.10.2012, 12:20
pawn Code:
// top of script
new RandomMusic[][] =
{
"URL1",
"URL2",
"URL3"
};
// ongamemodeinit
SetTimer("SwitchNewSound", 60000*3, true); // 3 minutes
// somewhere in your script
forward SwitchNewSound();
public SwitchNewSound()
{
new randURL = random(sizeof(RandomMusic));
for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
{
if(IsPlayerConnected(playerid))
{
StopAudioStreamForPlayer(playerid);
PlayAudioStreamForPlayer(playerid, RandomMusic[randURL]);
}
}
return 1;
}