In your script, add under the includes: new Laststream[MAX_PLAYERS];
Then, go to OnDialogResponse, and add the id of the case to laststream.
pawn Код:
if(response) {
switch(dialogid == 2)
{
case 1: {
switch(listitem)
{
case 0: {
StopAudioStreamForPlayer(playerid);
PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
PlayAudioStreamForPlayer(playerid, "http://stream.profm.ro:8012/profm.mp3");
SendClientMessage(playerid,0x00FFFAFF,"ProFM");
Laststream[playerid] = 0;
return 1;
}
case 1: {
StopAudioStreamForPlayer(playerid);
PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
PlayAudioStreamForPlayer(playerid, "http://radiotaraf.no-ip.biz:7100");
SendClientMessage(playerid,0x00FFFAFF,"Radio Taraf");
Laststream[playerid] = 1;
return 1;
}
case 2: {
StopAudioStreamForPlayer(playerid);
PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
PlayAudioStreamForPlayer(playerid, "http://srv04.bigstreams.de/bigfm-mp3-64");
SendClientMessage(playerid,0x00FFFAFF,"BigFM");
Laststream[playerid] = 2;
return 1;
}
I showed the first 3 cases, just do the same for the remaining cases.
Then, under OnPlayerStateChange, add something like this:
pawn Код:
if(Laststream[playerid] == 0)
{
//Play the audio stream from case 0
}
if(Laststream[playerid] == 1)
{
//play the audio stream from case 1
}
And so on.
I hope you get what I mean :P