15.07.2015, 05:37
Quote:
|
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? |
PHP код:
else if(dialogid == CUSTOM_URLCHOICE)
{
if(response)
{
if(isnull(inputtext) || IsNumeric(inputtext)) return SendClientMessageEx(playerid, COLOR_GRAD1, "You have not entered a valid URL.");
PlayAudioStreamForPlayerEx(playerid, inputtext);
SetPVarInt(playerid, "MusicIRadio", 1);
format(string, sizeof(string), "You are now playing %s.", inputtext);
SendClientMessageEx(playerid, COLOR_GREEN, string);
}
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(string, sizeof(string), "%s/radio/radio.php?genre=%d", SAMP_WEB, (listitem+1));
SetPVarInt(playerid, "pSelectGenre", (listitem+1));
SetPVarInt(playerid, "pHTTPWait", 1);
HTTP(playerid, HTTP_GET, string, "", "StationListHTTP");
}
else
{
SendClientMessage(playerid, 0xFFFFFFAA, "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(string, sizeof(string), "%s/radio/radio.php?genre=%d&station=%d", SAMP_WEB, GetPVarInt(playerid, "pSelectGenre"), (listitem+1));
SetPVarInt(playerid, "pHTTPWait", 1);
SetPVarInt(playerid, "pSelectStation", (listitem+1));
HTTP(playerid, HTTP_GET, string, "", "StationInfoHTTP");
}
else
{
SendClientMessage(playerid, 0xFFFFFFAA, "HTTP Thread is busy");
}
}
else
{
if(!GetPVarType(playerid, "pHTTPWait"))
{
SetPVarInt(playerid, "pHTTPWait", 1);
format(string, sizeof(string), "%s/radio/radio.php?listgenres=1", SAMP_WEB);
HTTP(playerid, HTTP_GET, string, "", "GenreHTTP");
}
else
{
SendClientMessage(playerid, 0xFFFFFFAA, "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(string, sizeof(string), "%s/radio/radio.php?top50=1&station=%d", SAMP_WEB, (listitem+1));
SetPVarInt(playerid, "pHTTPWait", 1);
SetPVarInt(playerid, "pSelectStation", (listitem+1));
HTTP(playerid, HTTP_GET, string, "", "Top50InfoHTTP");
}
else
{
SendClientMessage(playerid, 0xFFFFFFAA, "HTTP Thread is busy");
}
}
}
else if(dialogid == STATIONLISTEN)
{
if(response)
{
if(!GetPVarType(playerid, "pHTTPWait"))
{
format(string, sizeof(string), "%s/radio/radio.php?genre=%d&station=%d&listen=1", SAMP_WEB, GetPVarInt(playerid, "pSelectGenre"), GetPVarInt(playerid, "pSelectStation"));
SetPVarInt(playerid, "pHTTPWait", 1);
HTTP(playerid, HTTP_GET, string, "", "StationSelectHTTP");
}
else
{
SendClientMessage(playerid, 0xFFFFFFAA, "HTTP Thread is busy");
}
}
else
{
if(!GetPVarType(playerid, "pHTTPWait"))
{
format(string, sizeof(string), "%s/radio/radio.php?genre=%d", SAMP_WEB, GetPVarInt(playerid, "pSelectGenre"));
SetPVarInt(playerid, "pHTTPWait", 1);
HTTP(playerid, HTTP_GET, string, "", "StationListHTTP");
DeletePVar(playerid, "pSelectStation");
}
else
{
SendClientMessage(playerid, 0xFFFFFFAA, "HTTP Thread is busy");
}
}
}
else if(dialogid == TOP50LISTEN)
{
if(!response)
{
if(!GetPVarType(playerid, "pHTTPWait"))
{
DeletePVar(playerid, "pSelectStation");
SetPVarInt(playerid, "pHTTPWait", 1);
format(string, sizeof(string), "%s/radio/radio.php?top50=1", SAMP_WEB);
HTTP(playerid, HTTP_GET, string, "", "Top50HTTP");
}
else
{
SendClientMessage(playerid, 0xFFFFFFAA, "HTTP Thread is busy");
}
}
else
{
if(!GetPVarType(playerid, "pHTTPWait"))
{
format(string, sizeof(string), "%s/radio/radio.php?top50=1&station=%d&listen=1", SAMP_WEB, GetPVarInt(playerid, "pSelectStation"));
SetPVarInt(playerid, "pHTTPWait", 1);
HTTP(playerid, HTTP_GET, string, "", "StationSelectHTTP");
}
else
{
SendClientMessage(playerid, 0xFFFFFFAA, "HTTP Thread is busy");
}
}
}
else if(dialogid == STATIONSEARCH)
{
if(response)
{
if(strlen(inputtext) < 0 || 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(string, sizeof(string), "%s/tim-kiem/bai-hat.html?q=%s", SAMP_WEB, inputtext);
SetPVarString(playerid, "pSearchStation", inputtext);
SetPVarInt(playerid, "pHTTPWait", 1);
ShowNoticeGUIFrame(playerid, 6);
HTTP(playerid, HTTP_GET, string, "", "StationSearchHTTP");
}
else
{
SendClientMessage(playerid, 0xFFFFFFAA, "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", string, sizeof(string));
format(string, sizeof(string), "%s/tim-kiem/bai-hat.html?q=%s&stattion=%d", SAMP_WEB, string, (listitem+1));
SetPVarInt(playerid, "pHTTPWait", 1);
ShowNoticeGUIFrame(playerid, 6);
SetPVarInt(playerid, "pSelectStation", (listitem+1));
HTTP(playerid, HTTP_GET, string, "", "StationSearchInfoHTTP");
}
else
{
SendClientMessage(playerid, 0xFFFFFFAA, "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", string, sizeof(string));
format(string, sizeof(string), "%s/radio/radio.php?search=%s&station=%d&listen=1", SAMP_WEB, string, GetPVarInt(playerid, "pSelectStation"));
SetPVarInt(playerid, "pHTTPWait", 1);
ShowNoticeGUIFrame(playerid, 6);
HTTP(playerid, HTTP_GET, string, "", "StationSelectHTTP");
}
else
{
SendClientMessage(playerid, 0xFFFFFFAA, "HTTP Thread is busy");
}
}
else
{
if(!GetPVarType(playerid, "pHTTPWait"))
{
GetPVarString(playerid, "pSearchStation", string, sizeof(string));
format(string, sizeof(string), "%s/radio/radio.php?search=%s", SAMP_WEB, string);
ShowNoticeGUIFrame(playerid, 6);
HTTP(playerid, HTTP_GET, string, "", "StationSearchHTTP");
DeletePVar(playerid, "pSelectStation");
}
else
{
SendClientMessage(playerid, 0xFFFFFFAA, "HTTP Thread is busy");
}
}
}


