Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <zcmd>
- #define DIALOG_MUSIC 455
- COMMAND:playtube(playerid,params[])
- {
- ShowPlayerDialog(playerid,DIALOG_MUSIC,DIALOG_STYLE_INPUT,"PlayTube by iRaiDeN", "Please input the URL of the song you want (Example: wwww.youtube.com/watch?v=VID Change the VID!)","Play","Cancel");
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == DIALOG_MUSIC)
- {
- if(response)
- {
- if(strlen(inputtext))
- {
- if(strfind(inputtext,"www.youtube.com",true) == -1)
- {
- new localURL[128];
- strmid(localURL,inputtext,strfind(inputtext, "v=")+2,strfind(inputtext, "v=")+19);
- new localString[128];
- format(localString, 128, "http://mwrserver.com/youtube.php?videoid=%s",localURL);
- for(new i; i != MAX_PLAYERS; i++) PlayAudioStreamForPlayer(i,localString);
- }else{
- ShowPlayerDialog(playerid,DIALOG_MUSIC,DIALOG_STYLE_INPUT,"PlayTube by iRaiDeN", "Please input the URL of the song you want (Example: wwww.youtube.com/watch?v=VID Change the VID!)","Play","Cancel");
- }
- }else{
- ShowPlayerDialog(playerid,DIALOG_MUSIC,DIALOG_STYLE_INPUT,"PlayTube by iRaiDeN", "Please input the URL of the song you want (Example: wwww.youtube.com/watch?v=VID Change the VID!)","Play","Cancel");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement