Radio help
#1

Nothing happends when i choose a radio station

PHP код:
if(dialogid == DIALOG_CARRADIO)
    {
        switch(
response)
         {
              case 
1:
            {
                switch(
listitem)
                {
                    case 
0ShowPlayerDialog(playerid,DIALOG_CARRADIO2,DIALOG_STYLE_LIST,"Radio Stations","Non stop\nOld school rap\nKaty Perry fanloop radio\nRadio Nemo\nCaminoweb Radio\nPlayHab.de\n2Pac FanLoop Radio\nBack","Play""");
                    case 
1:
                    {
                        
SetPVarInt(playerid,"YTType",1);
                        
ShowPlayerDialog(playerid,DIALOG_CARRADIO3,DIALOG_STYLE_INPUT,"Radio - Direct Link","Enter in a direct .mp3 link and it will play on the radio\n{FF0000}Do not enter a link that will not respond.","Enter""Close");
                    }
                    case 
2:
                    {
                        
ShowPlayerDialog(playerid,DIALOG_CARRADIO,DIALOG_STYLE_LIST,"Vehicle Radio","Play Radio Stations\nPlay Direct Link\nTurn Off","Select""Exit");
                        
GameTextForPlayer(playerid"~w~Radio ~r~Off"50006);
                          foreach (
Player,i)
                        {
                            if(
GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid) && IsPlayerInAnyVehicle(i))
                            {
                                if(
GetPVarInt(i"CarRadio") != 0)
                                {
                                    
StopAudioStreamForPlayerEx(i);
                                    
DeletePVar(i,"CarRadio");
                                }
                            }
                        }
                    }
                }
            }
        }
        if(
dialogid == DIALOG_CARRADIO2)
        {
            switch(
response)
            {
                case 
1:
                {
                    if(!
IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_WHITE,"You must be in a vehicle to use this.");
                    if(
listitem == 8) return ShowPlayerDialog(playerid,DIALOG_CARRADIO3,DIALOG_STYLE_LIST,"Vehicle Radio","Play Radio Stations\nPlay Direct Link\nTurn Off","Select""Exit");
                    
GameTextForPlayer(playerid"~w~Radio ~g~On"50006);
                    
SetPVarInt(playerid"Delay"5);
                    
ShowPlayerDialog(playerid,DIALOG_CARRADIO2,DIALOG_STYLE_LIST,"Radio Stations","Non stop\nOld school rap\nKaty Perry fanloop radio\nRadio Nemo\nCaminoweb Radio\nPlayHab.de\n2Pac FanLoop Radio\nBack","Play""");
                    foreach (
Player,i)
                    {
                        if(
GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid) && IsPlayerInAnyVehicle(i))
                        {
                            
SetPVarInt(i"CarRadio"listitem+1);
                            
LoadRadio(i,listitem+1);
                        }
                    }
                }
            }
        }
        if(
dialogid == DIALOG_CARRADIO3)
        {
            switch(
response)
            {
                case 
0DeletePVar(playerid"YTType");
                case 
1:
                {
                    if(!
strlen(inputtext)) return ShowPlayerDialog(playerid,DIALOG_CARRADIO3,DIALOG_STYLE_INPUT,"Radio - Direct Link","Enter in a direct .mp3 link and it will play on the radio\n{FF0000}Do not enter a link that will not respond.","Enter""Close");
                    if(
strlen(inputtext) >= 120)
                    {
                        
SendClientMessage(playeridCOLOR_WHITE"Link is too long (120 Chars max).");
                        return 
ShowPlayerDialog(playerid,DIALOG_CARRADIO3,DIALOG_STYLE_INPUT,"Radio - Direct Link","Enter in a direct .mp3 link and it will play on the radio\n{FF0000}Do not enter a link that will not respond.","Enter""Close");
                    }
                    switch(
GetPVarInt(playerid"YTType"))
                    {
                        case 
1:
                        {
                            foreach (
Player,i)
                               {
                                if(
IsPlayerInAnyVehicle(i) && GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid))
                                {
                                    
format(PlayerInfo[i][pRUrl], 128,"%s"inputtext);
                                       
SetPVarInt(i"CarRadio"9);
                                       
LoadRadio(i,9); 
PHP код:
stock LoadRadio(playerid,songid)
{
    switch(
songid)
    {
        case 
1PlayAudioStreamForPlayerEx(playerid"http://yp.shoutcast.com/sbin/tunein-station.m3u?id=556684"); //Non stop
        
case 2PlayAudioStreamForPlayerEx(playerid"http://yp.shoutcast.com/sbin/tunein-station.m3u?id=88086"); //Old school rap
        
case 3PlayAudioStreamForPlayerEx(playerid"http://yp.shoutcast.com/sbin/tunein-station.m3u?id=396275"); //Katy Perry loop
        
case 4PlayAudioStreamForPlayerEx(playerid"http://yp.shoutcast.com/sbin/tunein-station.m3u?id=772151"); //Radio Nemo
        
case 5PlayAudioStreamForPlayerEx(playerid"http://yp.shoutcast.com/sbin/tunein-station.m3u?id=121874"); //Caminoweb Radio
        
case 6PlayAudioStreamForPlayerEx(playerid"http://yp.shoutcast.com/sbin/tunein-station.m3u?id=203721"); //PlayHab.de
        
case 7PlayAudioStreamForPlayerEx(playerid"http://yp.shoutcast.com/sbin/tunein-station.m3u?id=457678"); //2Pac FanLoop Radio
        
case 9PlayAudioStreamForPlayerEx(playeridPlayerInfo[playerid][pRUrl]);
    }
    return 
true;

Reply


Messages In This Thread
Radio help - by Hellman92 - 27.01.2016, 19:22
Re: Radio help - by FreAkeD - 27.01.2016, 19:27
Re: Radio help - by Hellman92 - 27.01.2016, 19:30
Re: Radio help - by -CaRRoT - 27.01.2016, 19:44
Re: Radio help - by Hellman92 - 27.01.2016, 19:51
Re: Radio help - by -CaRRoT - 27.01.2016, 19:55
Re: Radio help - by Hellman92 - 27.01.2016, 20:35

Forum Jump:


Users browsing this thread: 1 Guest(s)