Advertisement
Guest User

Untitled

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