Problem with boombox, setstation
#4

Quote:
Originally Posted by Virtual1ty
Посмотреть сообщение
The URL (second parameter) to PlayAudioStreamForPlayer must be a valid stream, playlist or an mp3 file. For the "boombox" part we can't possibly know how you handle reproduction because you didn't show us dialog response code for dialog "CUSTOM_URLCHOICE".
As for the "set station" HTTP part, we can't know how you handle reproduction because you didn't show us "GenreHTTP" and "Top50HTTP" callbacks. Also, most of the "PlayAudioStreamForPlayer" code is commented out, so how is it supposed to work then?
Sorry, I'm not good at Code and I'm trying to do it, this is code what you need.
PHP код:
else if(dialogid == CUSTOM_URLCHOICE)
    {
        if(
response)
        {
            if(
isnull(inputtext) || IsNumeric(inputtext)) return SendClientMessageEx(playeridCOLOR_GRAD1"You have not entered a valid URL.");
            
PlayAudioStreamForPlayerEx(playeridinputtext);
            
SetPVarInt(playerid"MusicIRadio"1);
            
format(stringsizeof(string), "You are now playing %s."inputtext);
            
SendClientMessageEx(playeridCOLOR_GREENstring);
        }
        else
        {
            
ShowPlayerDialog(playerid,SETSTATION,DIALOG_STYLE_LIST,"Radio Menu","Genres\nTop 50 Stations\nSearch\nK-LSR\nNick's Radio\nTurn radio off","Select""Close");
        }
    }
    else if(
dialogid == GENRES)
    {
        if(
response)
        {
            if(!
GetPVarType(playerid"pHTTPWait"))
            {
                
format(stringsizeof(string), "%s/radio/radio.php?genre=%d"SAMP_WEB, (listitem+1));
                
SetPVarInt(playerid"pSelectGenre", (listitem+1));
                
SetPVarInt(playerid"pHTTPWait"1);
                
HTTP(playeridHTTP_GETstring"""StationListHTTP");
            }
            else
            {
                
SendClientMessage(playerid0xFFFFFFAA"HTTP Thread is busy");
            }
        }
        else
        {
            
ShowPlayerDialog(playerid,SETSTATION,DIALOG_STYLE_LIST,"Radio Menu","Genres\nTop 50 Stations\nSearch\nK-LSR\nNick's Radio\nTurn radio off","Select""Close");
            
DeletePVar(playerid"pSelectGenre");
        }
    }
    else if(
dialogid == STATIONLIST)
    {
        if(
response)
        {
            if(!
GetPVarType(playerid"pHTTPWait"))
            {
                
format(stringsizeof(string), "%s/radio/radio.php?genre=%d&station=%d"SAMP_WEBGetPVarInt(playerid"pSelectGenre"), (listitem+1));
                
SetPVarInt(playerid"pHTTPWait"1);
                
SetPVarInt(playerid"pSelectStation", (listitem+1));
                
HTTP(playeridHTTP_GETstring"""StationInfoHTTP");
            }
            else
            {
                
SendClientMessage(playerid0xFFFFFFAA"HTTP Thread is busy");
            }
        }
        else
        {
            if(!
GetPVarType(playerid"pHTTPWait"))
            {
                
SetPVarInt(playerid"pHTTPWait"1);
                
format(stringsizeof(string), "%s/radio/radio.php?listgenres=1"SAMP_WEB);
                
HTTP(playeridHTTP_GETstring"""GenreHTTP");
            }
            else
            {
                
SendClientMessage(playerid0xFFFFFFAA"HTTP Thread is busy");
            }
        }
    }
    else if(
dialogid == TOP50LIST)
    {
        if(!
response)
        {
            
ShowPlayerDialog(playerid,SETSTATION,DIALOG_STYLE_LIST,"Radio Menu","Genres\nTop 50 Stations\nSearch\nK-LSR\nNick's Radio\nTurn radio off","Select""Close");
        }
        else
        {
            if(!
GetPVarType(playerid"pHTTPWait"))
            {
                
format(stringsizeof(string), "%s/radio/radio.php?top50=1&station=%d"SAMP_WEB, (listitem+1));
                
SetPVarInt(playerid"pHTTPWait"1);
                
SetPVarInt(playerid"pSelectStation", (listitem+1));
                
HTTP(playeridHTTP_GETstring"""Top50InfoHTTP");
            }
            else
            {
                
SendClientMessage(playerid0xFFFFFFAA"HTTP Thread is busy");
            }
        }
    }
    else if(
dialogid == STATIONLISTEN)
    {
        if(
response)
        {
            if(!
GetPVarType(playerid"pHTTPWait"))
            {
                
format(stringsizeof(string), "%s/radio/radio.php?genre=%d&station=%d&listen=1"SAMP_WEBGetPVarInt(playerid"pSelectGenre"), GetPVarInt(playerid"pSelectStation"));
                
SetPVarInt(playerid"pHTTPWait"1);
                
HTTP(playeridHTTP_GETstring"""StationSelectHTTP");
            }
            else
            {
                
SendClientMessage(playerid0xFFFFFFAA"HTTP Thread is busy");
            }
        }
        else
        {
            if(!
GetPVarType(playerid"pHTTPWait"))
            {
                
format(stringsizeof(string), "%s/radio/radio.php?genre=%d"SAMP_WEBGetPVarInt(playerid"pSelectGenre"));
                   
SetPVarInt(playerid"pHTTPWait"1);
                
HTTP(playeridHTTP_GETstring"""StationListHTTP");
                
DeletePVar(playerid"pSelectStation");
            }
            else
            {
                
SendClientMessage(playerid0xFFFFFFAA"HTTP Thread is busy");
            }
        }
    }
    else if(
dialogid == TOP50LISTEN)
    {
        if(!
response)
        {
            if(!
GetPVarType(playerid"pHTTPWait"))
            {
                
DeletePVar(playerid"pSelectStation");
                
SetPVarInt(playerid"pHTTPWait"1);
                
format(stringsizeof(string), "%s/radio/radio.php?top50=1"SAMP_WEB);
                
HTTP(playeridHTTP_GETstring"""Top50HTTP");
            }
            else
            {
                
SendClientMessage(playerid0xFFFFFFAA"HTTP Thread is busy");
            }
        }
        else
        {
            if(!
GetPVarType(playerid"pHTTPWait"))
            {
                
format(stringsizeof(string), "%s/radio/radio.php?top50=1&station=%d&listen=1"SAMP_WEBGetPVarInt(playerid"pSelectStation"));
                
SetPVarInt(playerid"pHTTPWait"1);
                
HTTP(playeridHTTP_GETstring"""StationSelectHTTP");
            }
            else
            {
                
SendClientMessage(playerid0xFFFFFFAA"HTTP Thread is busy");
            }
        }
    }
    else if(
dialogid == STATIONSEARCH)
    {
        if(
response)
        {
            if(
strlen(inputtext) < || strlen(inputtext) > 64)
            {
                
ShowPlayerDialog(playerid,SETSTATION,DIALOG_STYLE_LIST,"Radio Menu","Genres\nTop 50 Stations\nSearch\nK-LSR\nNick's Radio\nTurn radio off","Select""Close");
            }
            else
            {
                if(!
GetPVarType(playerid"pHTTPWait"))
                {
                    
format(stringsizeof(string), "%s/tim-kiem/bai-hat.html?q=%s"SAMP_WEBinputtext);
                    
SetPVarString(playerid"pSearchStation"inputtext);
                    
SetPVarInt(playerid"pHTTPWait"1);
                    
ShowNoticeGUIFrame(playerid6);
                    
HTTP(playeridHTTP_GETstring"""StationSearchHTTP");
                }
                else
                {
                    
SendClientMessage(playerid0xFFFFFFAA"HTTP Thread is busy");
                }
            }
        }
        else
        {
            
ShowPlayerDialog(playerid,SETSTATION,DIALOG_STYLE_LIST,"Radio Menu","Genres\nTop 50 Stations\nSearch\nK-LSR\nNick's Radio\nTurn radio off","Select""Close");
        }
    }
    else if(
dialogid == STATIONSEARCHLIST)
    {
        if(
response)
        {
            if(!
GetPVarType(playerid"pHTTPWait"))
            {
                
GetPVarString(playerid"pSearchStation"stringsizeof(string));
                
format(stringsizeof(string), "%s/tim-kiem/bai-hat.html?q=%s&stattion=%d"SAMP_WEBstring, (listitem+1));
                
SetPVarInt(playerid"pHTTPWait"1);
                
ShowNoticeGUIFrame(playerid6);
                
SetPVarInt(playerid"pSelectStation", (listitem+1));
                
HTTP(playeridHTTP_GETstring"""StationSearchInfoHTTP");
            }
            else
            {
                
SendClientMessage(playerid0xFFFFFFAA"HTTP Thread is busy");
            }
        }
        else
        {
            
ShowPlayerDialog(playerid,SETSTATION,DIALOG_STYLE_LIST,"Radio Menu","Genres\nTop 50 Stations\nSearch\nK-LSR\nNick's Radio\nTurn radio off","Select""Close");
        }
    }
    else if(
dialogid == STATIONSEARCHLISTEN)
    {
        if(
response)
        {
            if(!
GetPVarType(playerid"pHTTPWait"))
            {
                   
GetPVarString(playerid"pSearchStation"stringsizeof(string));
                
format(stringsizeof(string), "%s/radio/radio.php?search=%s&station=%d&listen=1"SAMP_WEBstringGetPVarInt(playerid"pSelectStation"));
                
SetPVarInt(playerid"pHTTPWait"1);
                
ShowNoticeGUIFrame(playerid6);
                
HTTP(playeridHTTP_GETstring"""StationSelectHTTP");
            }
            else
            {
                
SendClientMessage(playerid0xFFFFFFAA"HTTP Thread is busy");
            }
        }
        else
        {
            if(!
GetPVarType(playerid"pHTTPWait"))
            {
                
GetPVarString(playerid"pSearchStation"stringsizeof(string));
                
format(stringsizeof(string), "%s/radio/radio.php?search=%s"SAMP_WEBstring);
                
ShowNoticeGUIFrame(playerid6);
                
HTTP(playeridHTTP_GETstring"""StationSearchHTTP");
                
DeletePVar(playerid"pSelectStation");
            }
            else
            {
                
SendClientMessage(playerid0xFFFFFFAA"HTTP Thread is busy");
            }
        }
    } 
Reply


Messages In This Thread
Problem with boombox, setstation - by Bumie - 09.07.2015, 09:57
Re: Problem with boombox, setstation - by Bumie - 14.07.2015, 15:41
Re: Problem with boombox, setstation - by Virtual1ty - 14.07.2015, 17:41
Re: Problem with boombox, setstation - by Bumie - 15.07.2015, 05:37
Re: Problem with boombox, setstation - by Virtual1ty - 15.07.2015, 12:06
Re: Problem with boombox, setstation - by Bumie - 16.07.2015, 06:56
Re: Problem with boombox, setstation - by XBrianX - 16.07.2015, 12:25

Forum Jump:


Users browsing this thread: 1 Guest(s)