CMD:radio(playerid, params[])
{
ShowPlayerDialog(playerid, 123,DIALOG_STYLE_LIST, "Trucker's Life - Radio Stations", "SkyFM\nBlazin PH Radio\nRadio Off","Select","Close");
return 1;
}
if(dialogid == 15151)
{
if(response)
{
if(listitem == 0)
{
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=780577");
}
if(listitem == 1)
{
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=213653");
}
if(listitem == 2)
{
StopAudioStreamForPlayer(playerid);
}
}
return 1;
}
Send a message to the player (or print) after you play the audio. Then tell us if you get the message.
|
if(dialogid == 15151)
{
if(response)
{
if(listitem == 0)
{
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=780577");
SendClientMessage(playerid, 0x00FF00FF, "You have tuned in to SkyFM");
}
if(listitem == 1)
{
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=213653");
}
if(listitem == 2)
{
StopAudioStreamForPlayer(playerid);
}
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
return 0;//this is what a default OnDialogResponse (when you click new) should really look like.
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 5)
{
//this is fine because a dialog was found
return 1;
}
return 0;//but the final return should be zero
}
CMD:radio(playerid, params[])
{
ShowPlayerDialog(playerid, 15151, DIALOG_STYLE_LIST, "Trucker's Life - Radio Stations", "SkyFM \nBlazin PH Radio \nRadio Off","Select","Close");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 15151)
{
if(response == 1)
{
switch(listitem)
{
case 0:// The first item listed
{
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=780577");
return 1;
}
case 1: // The second item listed
{
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=213653");
return 1;
}
case 2: // The third item listed
{
StopAudioStreamForPlayer(playerid);
return 1;
}
}
}
}
return 1;
}