27.01.2016, 20:35
Quote:
Try the fixed code I posted above.
(response) is to check whether there was response to the dialog or not (if they pressed enter) so you'd use if, switch is used to switch between different situations/cases so that would be for the items listed (listitem). I don't see the need for the first case 1: at all, correct me if I am missing something. |
PHP код:
if(dialogid == DIALOG_CARRADIO2)
{
if(response)
{
if(listitem == 0)
{
GameTextForPlayer(playerid, "~w~Radio ~g~On", 5000, 6);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.m3u?id=556684"); //Non stop
}
else if(listitem == 1)
{
GameTextForPlayer(playerid, "~w~Radio ~g~On", 5000, 6);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.m3u?id=88086"); //Old school rap
}
else if(listitem == 2)
{
GameTextForPlayer(playerid, "~w~Radio ~g~On", 5000, 6);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.m3u?id=396275"); //Katy Perry loop
}
else if(listitem == 3)
{
GameTextForPlayer(playerid, "~w~Radio ~g~On", 5000, 6);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.m3u?id=772151"); //Radio Nemo
}
else if(listitem == 4)
{
GameTextForPlayer(playerid, "~w~Radio ~g~On", 5000, 6);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.m3u?id=121874"); //Caminoweb Radio
}
else if(listitem == 5)
{
GameTextForPlayer(playerid, "~w~Radio ~g~On", 5000, 6);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.m3u?id=203721"); //PlayHab.de
}
else if(listitem == 6)
{
GameTextForPlayer(playerid, "~w~Radio ~g~On", 5000, 6);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.m3u?id=457678"); //2Pac FanLoop Radio