Advertisement
MrAlienBG

Simplified version

May 18th, 2014
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.44 KB | None | 0 0
  1. #include    <a_samp>
  2. #include    <zcmd>
  3.  
  4. #define DIALOG_MUSIC 455
  5. COMMAND:playtube(playerid,params[])
  6. {
  7.          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");
  8. return 1;
  9. }
  10.  
  11.  
  12. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  13. {
  14.         if(dialogid == DIALOG_MUSIC)
  15.         {
  16.                 if(response)
  17.                 {
  18.                 if(strlen(inputtext))
  19.                 {
  20.                 if(strfind(inputtext,"www.youtube.com",true) == -1)
  21.                 {
  22.                 new localURL[128];
  23.                 strmid(localURL,inputtext,strfind(inputtext, "v=")+2,strfind(inputtext, "v=")+19);
  24.                 new localString[128];
  25.                 format(localString, 128, "http://mwrserver.com/youtube.php?videoid=%s",localURL);
  26.                 for(new i; i != MAX_PLAYERS; i++) PlayAudioStreamForPlayer(i,localString);
  27.                 }else{
  28.                 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");
  29.                 }
  30.                 }else{
  31.                 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");
  32.                 }
  33.                 }
  34.                
  35.         }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement