05.04.2015, 14:24
Hi, guys!
I want to make a /mp3 System based on a_http.inc
What I want exactly is, after the player clicks on a PlayList, it will be automatically generated from a .txt file on my WebHost as a DIALOG_STYLE_LIST.
Ok, so this part of my code is working:
OnDialogResponse => MP3 Dialog => Listitem 3:
And public HTTPResponse Part:
The Dialog appears and shows me exactly what I have on The RullZ.txt.
Now there is MP3_D + 5:
After I click a song from the PlayList automatically generated before, instead playing that song, it just tries to play all my .txt as in the example before:
A good result:
And my result:
How could I select just the Line 1 or 2 from the .txt ?
Thank you!
I want to make a /mp3 System based on a_http.inc
What I want exactly is, after the player clicks on a PlayList, it will be automatically generated from a .txt file on my WebHost as a DIALOG_STYLE_LIST.
Ok, so this part of my code is working:
OnDialogResponse => MP3 Dialog => Listitem 3:
Код:
case 2: // Playlist #1 - RullZ's Music { if(response) HTTP(playerid, HTTP_GET, "localhost/XSW/Others/Server%20MP3/The%20RullZ.txt", "", "HTTPResponse"); if(!response) CallRemoteFunction("OnPlayerCommandText", "is", playerid, "/mp3"); }
Код:
public HTTPResponse(index, response_code, data[]) { TxtData[0] = '\0'; //-------------------------------------------------------------------------- if(response_code == 200) format(TxtData, 1900, "%s", data), ShowPlayerDialog(index, MP3_D + 5, DIALOG_STYLE_LIST, "MP3 - {FF0000}RullZ's Music", TxtData, "Play", "Back"); //-------------------------------------------------------------------------- return 1; }
Now there is MP3_D + 5:
Код:
case MP3_D + 5: // Playlist #1 - RullZ's Music { if(response) { Str[0] = '\0'; format(Str, 1900, "localhost/XSW/Others/Server MP3/The RullZ/%s.mp3", TxtData); PlayAudioStreamForPlayer(playerid, Str); } else return CallRemoteFunction("OnPlayerCommandText", "is", playerid, "/mp3"); }
A good result:
Код:
Audio stream: http://localhost/XSW/Others/Server MP3/The RullZ/Song No 1.mp3
Код:
Audio stream: http://localhost/XSW/Others/ServerMP3/TheRullZ/SongNo1 SongNo2 SongNo3.mp3
Thank you!