Array/enum help
#4

Quote:
Originally Posted by SuperViper
Посмотреть сообщение
pawn Код:
enum randomMusicA
{
    MusicName[50],
    Url[256],
}
new randomMusic[MAX_MUSIC_STREAMS][randomMusicA] ={
{"Country","http://yp.shoutcast.com/sbin/tunein-station.pls?id=1283687"},
{"Sky.FM","http://yp.shoutcast.com/sbin/tunein-station.pls?id=728272"},
{"Big R Radio","http://74.86.186.35:8018/listen.pls"},
{"Slow Music","http://yp.shoutcast.com/sbin/tunein-station.pls?id=1658657"}
};
stock NMusicStream(playerid)
{
    StopAudioStreamForPlayer(playerid);
    new string[128], randomRadio = random(sizeof(randomMusic));
    PlayAudioStreamForPlayer(playerid, randomMusic[randomRadio][Url]);
    SendClientMessage(playerid, -1, "Next Song/Radio Loading........");
    format(string, sizeof(string), "Listening to %s", randomMusic[randomRadio][MusicName]);
    SendClientMessage(playerid, -1, string);
    return 1;
}
stock ANMusicStream(playerid)
{
    StopAudioStreamForPlayer(playerid);
    new string[128], randomRadio = random(sizeof(randomMusic));
    PlayAudioStreamForPlayer(playerid, randomMusic[randomRadio][Url]);
    format(string, sizeof(string), "Listening to %s", randomMusic[randomRadio][MusicName]);
    SendClientMessage(playerid, -1, string);
}
Ok it works good but for some reason it only plays the same stream and the song name changes. I also had to change it up with the line...
pawn Код:
new string[128], randomRadio = random(sizeof(randomMusic));
//to
new string[128];
new randomRadio = random(sizeof(randomMusic));
Cause it was giving errors. Other than that it is the same. Any suggestions on that?
Reply


Messages In This Thread
Array/enum help - by nickdodd25 - 18.04.2012, 03:40
Re: Array/enum help - by SuperViper - 18.04.2012, 04:03
Re: Array/enum help - by Marco_Valentine - 18.04.2012, 04:06
Re: Array/enum help - by nickdodd25 - 18.04.2012, 05:03
Re: Array/enum help - by Marco_Valentine - 18.04.2012, 05:18
Re: Array/enum help - by nickdodd25 - 18.04.2012, 05:36
Re: Array/enum help - by Marco_Valentine - 18.04.2012, 06:41
Re: Array/enum help - by nickdodd25 - 18.04.2012, 16:16

Forum Jump:


Users browsing this thread: 1 Guest(s)