StreamAudioForPlayer
#2

pawn Код:
// top of script
new RandomMusic[][] =
{
    "http://listen.di.fm/public3/progressive.pls ",
    "http://listen.di.fm/public3/eurodance.pls ",
    "http://listen.di.fm/public3/house.pls "
};
// OnGameModeInIt
SetTimer("SwitchRadio", 60000*15, true); // meaning it will change every 15 minutes.

// somewhere in your script
forward SwitchRadio();
public SwitchRadio()
{
    new randURL = random(sizeof(RandomMusic));
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            StopAudioStreamForPlayer(i);
            PlayAudioStreamForPlayer(i, RandomMusic[randURL]);
        }
    }
    return 1;
}

CMD:radiostop(playerid, params[])
{
    StopAudioStreamForPlayer(playerid);
    return 1;
}
What does it do?, all the players will listen to 3 radio links with a lot of songs each link, the player has the option to turn off his stream with the command /radiostop.

Note: This is not tested.
Reply


Messages In This Thread
StreamAudioForPlayer - by Ananisiki - 26.02.2013, 01:46
Respuesta: StreamAudioForPlayer - by Strier - 26.02.2013, 02:09

Forum Jump:


Users browsing this thread: 1 Guest(s)