SHOW:
|
|
- or go back to the newest paste.
1 | #include <a_samp> | |
2 | #include <zcmd> | |
3 | ||
4 | #define DIALOG_MUSIC (100) | |
5 | ||
6 | COMMAND:playtube(playerid,params[]) | |
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"); |
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 | } |