SHOW:
|
|
- or go back to the newest paste.
| 1 | - | //============================================================================== |
| 1 | + | if (strcmp(cmdtext, "/kapiac", true)==0) |
| 2 | - | // Youtube Player v1.0 by usrb1n ! |
| 2 | + | {
|
| 3 | - | // http://forum.sa-mp.com/member.php?u=122322 |
| 3 | + | if (PlayerInfo[playerid][pFaction] == 0) |
| 4 | - | //============================================================================== |
| 4 | + | {
|
| 5 | - | // Includes & Defines |
| 5 | + | if (PlayerToPoint(10.0, playerid,1538.0441,-1628.0602,13.3828) ) |
| 6 | - | //============================================================================== |
| 6 | + | {
|
| 7 | - | #include <a_samp> |
| 7 | + | MoveObject(kapi1,1541.1430664063, -1627.6123046875, 20.475856781006,3.5); |
| 8 | - | #include <a_http> |
| 8 | + | SetTimer("kapi1kapat",7000,false);
|
| 9 | - | #include <core> |
| 9 | + | return 1; |
| 10 | - | #include <float> |
| 10 | + | } |
| 11 | - | #define U2BDIAG 6958 //DialogID used |
| 11 | + | |
| 12 | - | new PlayerU2B[MAX_PLAYERS]; |
| 12 | + | |
| 13 | - | new PlayerU2BLink[MAX_PLAYERS][32]; |
| 13 | + | if (strcmp(cmdtext, "/kapiac", true)==0) |
| 14 | - | new U2BRadius[MAX_PLAYERS][16]; |
| 14 | + | {
|
| 15 | - | forward U2BInfo(playerid, response_code, data[]); |
| 15 | + | if (PlayerInfo[playerid][pFaction] == 0) |
| 16 | - | #define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1 |
| 16 | + | {
|
| 17 | - | #define WHOMADETHIS "Youtube Player v1.0 by {FF0000}us{FFEF00}rb{1A00FF}1n"
|
| 17 | + | if (PlayerToPoint(10.0, playerid,1589.6451,-1634.7839,13.4134) ) |
| 18 | - | |
| 18 | + | {
|
| 19 | - | public OnFilterScriptInit() |
| 19 | + | MoveObject(kapi2,1576.7047119141, -1638.1271972656, 15.165544509888,3.5); |
| 20 | - | {
|
| 20 | + | SetTimer("kapi2kapat",7000,false);
|
| 21 | - | print("Youtube player by usrb1n has been loaded");
|
| 21 | + | return 1; |
| 22 | - | } |
| 22 | + | } |
| 23 | - | public OnFilterScriptExit() |
| 23 | + | |
| 24 | - | {
|
| 24 | + | |
| 25 | - | print("Youtube player by usrb1n has been unloaded");
|
| 25 | + | if (strcmp(cmdtext, "/kapiac", true)==0) |
| 26 | - | } |
| 26 | + | {
|
| 27 | - | |
| 27 | + | if (PlayerInfo[playerid][pFaction] == 0) |
| 28 | - | //============================================================================== |
| 28 | + | {
|
| 29 | - | // Commands |
| 29 | + | if (PlayerToPoint(7.0, playerid,251.6832,108.8491,1003.2188) ) |
| 30 | - | //============================================================================== |
| 30 | + | {
|
| 31 | - | public OnPlayerCommandText(playerid, cmdtext[]) |
| 31 | + | MoveObject(kapi3,253.19567871094, 108.96716308594, 998.02465820313,3.5); |
| 32 | - | {
|
| 32 | + | SetTimer("kapi3kapat",7000,false);
|
| 33 | - | dcmd(youtube, 7, cmdtext); |
| 33 | + | return 1; |
| 34 | - | dcmd(stopu2b, 7, cmdtext); |
| 34 | + | } |
| 35 | - | return 0; |
| 35 | + | |
| 36 | - | } |
| 36 | + | |
| 37 | - | |
| 37 | + | if (strcmp(cmdtext, "/kapiac", true)==0) |
| 38 | - | dcmd_stopu2b(playerid, params[]) |
| 38 | + | {
|
| 39 | - | {
|
| 39 | + | if (PlayerInfo[playerid][pFaction] == 0) |
| 40 | - | if(strlen(params)) return 0; |
| 40 | + | {
|
| 41 | - | PlayAudioStreamForPlayer(playerid, "Music was stoped by player."); |
| 41 | + | if (PlayerToPoint(7.0, playerid,241.4603,117.4467,1003.2188) ) |
| 42 | - | return 1; |
| 42 | + | {
|
| 43 | - | } |
| 43 | + | MoveObject(kapi4,239.6840057373, 117.80960083008, 998.015625,3.5); |
| 44 | - | |
| 44 | + | SetTimer("kapi4kapat",7000,false);
|
| 45 | - | dcmd_youtube(playerid, params[]) |
| 45 | + | return 1; |
| 46 | - | {
|
| 46 | + | } |
| 47 | - | if(strlen(params)) return 0; |
| 47 | + | |
| 48 | - | if(!IsPlayerAdmin(playerid)) |
| 48 | + | |
| 49 | - | {
|
| 49 | + | if (strcmp(cmdtext, "/kapiac", true)==0) |
| 50 | - | SendClientMessage(playerid, 0xD776FF, "Only RCON admins can use this command."); |
| 50 | + | {
|
| 51 | - | return 1; |
| 51 | + | if (PlayerInfo[playerid][pFaction] == 1) |
| 52 | - | } |
| 52 | + | {
|
| 53 | - | ShowPlayerDialog(playerid, U2BDIAG, DIALOG_STYLE_LIST, WHOMADETHIS, "{46BEE6}Play for yourself (The song will be played only for you)\n{ED954E}Play for someone (The song will be played for the ID you input in the textbox)\n{46BEE6}Play for a location (The song will be played with the radius you choose)\n{ED954E}Play for all (The song will be played for all the players in the server)", "Select", "Cancel");
|
| 53 | + | if (PlayerToPoint(7.0, playerid,1262.1733, -2047.2603, 66.2151) ) |
| 54 | - | return 1; |
| 54 | + | {
|
| 55 | - | } |
| 55 | + | MoveObject(kapi5,1262.1733398438, -2047.2603759766, 66.215110778809,3.5); |
| 56 | - | //============================================================================== |
| 56 | + | SetTimer("kapi5kapat",7000,false);
|
| 57 | - | // Dialogs |
| 57 | + | return 1; |
| 58 | - | //============================================================================== |
| 58 | + | } |
| 59 | - | public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) |
| 59 | + | |
| 60 | - | {
|
| 60 | + | |
| 61 | - | if(dialogid == U2BDIAG && response) |
| 61 | + | if (strcmp(cmdtext, "/kapiac", true)==0) |
| 62 | - | {
|
| 62 | + | {
|
| 63 | - | switch(listitem) |
| 63 | + | if (PlayerInfo[playerid][pFaction] == 6) |
| 64 | - | {
|
| 64 | + | {
|
| 65 | - | case 0: |
| 65 | + | if (PlayerToPoint(10.0, playerid,1245.7036,-770.7661,91.6914) ) |
| 66 | - | {
|
| 66 | + | {
|
| 67 | - | PlayerU2B[playerid] = 1; |
| 67 | + | MoveObject(kapi6,1257.1459960938, -767.32391357422, 93.806228637695,3.5); |
| 68 | - | ShowPlayerDialog(playerid,U2BDIAG+1,DIALOG_STYLE_INPUT,WHOMADETHIS,"Paste the youtube link you want to play for yourself:","Play","Cancel"); |
| 68 | + | SetTimer("kapi6kapat",7000,false);
|
| 69 | - | return 1; |
| 69 | + | return 1; |
| 70 | - | } |
| 70 | + | } |
| 71 | - | case 1: |
| 71 | + | |
| 72 | - | {
|
| 72 | + | |
| 73 | - | PlayerU2B[playerid] = 2; |
| 73 | + | if (strcmp(cmdtext, "/kapiac", true)==0) |
| 74 | - | ShowPlayerDialog(playerid,U2BDIAG+1,DIALOG_STYLE_INPUT,WHOMADETHIS,"Paste the youtube link you want to play for a player:","Play","Cancel"); |
| 74 | + | {
|
| 75 | - | return 1; |
| 75 | + | if (PlayerInfo[playerid][pFaction] == 6 && PlayerInfo[playerid][pRank] == 1) |
| 76 | - | } |
| 76 | + | {
|
| 77 | - | case 2: |
| 77 | + | if (PlayerToPoint(10.0, playerid,1489.3992, -700.2100, 95.5708) ) |
| 78 | - | {
|
| 78 | + | {
|
| 79 | - | PlayerU2B[playerid] = 3; |
| 79 | + | MoveObject(kapi7,1494.860962, -700.101501, 95.570808,3.5); |
| 80 | - | ShowPlayerDialog(playerid,U2BDIAG+1,DIALOG_STYLE_INPUT,WHOMADETHIS,"Paste the youtube link you want to play for your location:","Play","Cancel"); |
| 80 | + | SetTimer("kapi7kapat",7000,false);
|
| 81 | - | return 1; |
| 81 | + | return 1; |
| 82 | - | } |
| 82 | + | } |
| 83 | - | case 3: |
| 83 | + | |
| 84 | - | {
|
| 84 | + | |
| 85 | - | PlayerU2B[playerid] = 4; |
| 85 | + | if (strcmp(cmdtext, "/kapiac", true)==0) |
| 86 | - | ShowPlayerDialog(playerid,U2BDIAG+1,DIALOG_STYLE_INPUT,WHOMADETHIS,"Paste the youtube link you want to play for the whole server:","Play","Cancel"); |
| 86 | + | {
|
| 87 | - | return 1; |
| 87 | + | if (PlayerInfo[playerid][pFaction] == 7) |
| 88 | - | } |
| 88 | + | {
|
| 89 | if (PlayerToPoint(10.0, playerid,665.4987,-1306.7292,13.4609) ) | |
| 90 | - | } |
| 90 | + | {
|
| 91 | - | if(dialogid == U2BDIAG+1 && response) |
| 91 | + | MoveObject(kapi8,665.16363525391, -1310.8697509766, 20.556196212769,3.5); |
| 92 | - | {
|
| 92 | + | SetTimer("kapi8kapat",7000,false);
|
| 93 | - | if(strlen(inputtext)) |
| 93 | + | return 1; |
| 94 | - | {
|
| 94 | + | } |
| 95 | - | new result[128], videostr[128]; |
| 95 | + | |
| 96 | - | strmid(result,inputtext,31,44,strlen(inputtext)); |
| 96 | + | |
| 97 | - | format(videostr,sizeof(videostr),"www.youtube-mp3.org/api/itemInfo/?video_id=%s",result); |
| 97 | + | if (strcmp(cmdtext, "/kapiac", true)==0) |
| 98 | - | strmid(PlayerU2BLink[playerid], result, 0, 32); |
| 98 | + | {
|
| 99 | - | if (PlayerU2B[playerid] == 1) |
| 99 | + | if (PlayerInfo[playerid][pFaction] == 7) |
| 100 | - | {
|
| 100 | + | {
|
| 101 | - | PlayerU2B[playerid] = 11; |
| 101 | + | if (PlayerToPoint(10.0, playerid,662.6322,-1230.1627,15.3995) ) |
| 102 | - | HTTP(playerid,HTTP_GET,videostr,"","U2BInfo"); |
| 102 | + | {
|
| 103 | - | } |
| 103 | + | MoveObject(kapi9,657.98876953125, -1226.3483886719, 22.034721374512,3.5); |
| 104 | - | else if (PlayerU2B[playerid] == 2) |
| 104 | + | SetTimer("kapi9kapat",7000,false);
|
| 105 | - | {
|
| 105 | + | return 1; |
| 106 | - | PlayerU2B[playerid] = 22; |
| 106 | + | } |
| 107 | - | ShowPlayerDialog(playerid,U2BDIAG+2,DIALOG_STYLE_INPUT,WHOMADETHIS,"Enter the player id you want to play the song for:","Play","Cancel"); |
| 107 | + | |
| 108 | - | new string[128]; |
| 108 | + | |
| 109 | - | format(string, sizeof(string), "%s", PlayerU2BLink[playerid]); |
| 109 | + | if (strcmp(cmdtext, "/kapiac", true)==0) |
| 110 | - | } |
| 110 | + | {
|
| 111 | - | else if (PlayerU2B[playerid] == 3) |
| 111 | + | if (PlayerInfo[playerid][pFaction] == 7) |
| 112 | - | {
|
| 112 | + | {
|
| 113 | - | PlayerU2B[playerid] = 33; |
| 113 | + | if (PlayerToPoint(10.0, playerid,780.8899,-1152.7042,23.3798) ) |
| 114 | - | ShowPlayerDialog(playerid,U2BDIAG+3,DIALOG_STYLE_INPUT,WHOMADETHIS,"Enter the radius in which you want the song to be heard:","Play","Cancel"); |
| 114 | + | {
|
| 115 | - | } |
| 115 | + | MoveObject(kapi10,786.99401855469, -1152.201171875, 30.562343597412,3.5); |
| 116 | - | else if (PlayerU2B[playerid] == 4) |
| 116 | + | SetTimer("kapi10kapat",7000,false);
|
| 117 | - | {
|
| 117 | + | return 1; |
| 118 | - | PlayerU2B[playerid] = 44; |
| 118 | + | } |
| 119 | - | HTTP(playerid,HTTP_GET,videostr,"","U2BInfo"); |
| 119 | + | |
| 120 | - | } |
| 120 | + | |
| 121 | if (strcmp(cmdtext, "/kapiac", true)==0) | |
| 122 | - | return 1; |
| 122 | + | {
|
| 123 | - | |
| 123 | + | if (PlayerInfo[playerid][pFaction] == 8) |
| 124 | - | } |
| 124 | + | {
|
| 125 | - | if(dialogid == U2BDIAG+2 && response) |
| 125 | + | if (PlayerToPoint(10.0, playerid,264.7064,-1337.3473,53.2380) ) |
| 126 | - | {
|
| 126 | + | {
|
| 127 | - | new gpid = strval(inputtext); |
| 127 | + | MoveObject(kapi11,256.9189453125, -1338.4560546875, 53.89965057373,3.5); |
| 128 | - | new videostr[128]; |
| 128 | + | SetTimer("kapi11kapat",7000,false);
|
| 129 | - | format(videostr,sizeof(videostr),"www.youtube-mp3.org/api/itemInfo/?video_id=%s",PlayerU2BLink[playerid]); |
| 129 | + | return 1; |
| 130 | - | HTTP(gpid,HTTP_GET,videostr,"","U2BInfo"); |
| 130 | + | } |
| 131 | - | return 1; |
| 131 | + | |
| 132 | - | |
| 132 | + | |
| 133 | - | } |
| 133 | + | if (strcmp(cmdtext, "/kapiac", true)==0) |
| 134 | - | if(dialogid == U2BDIAG+3 && response) |
| 134 | + | {
|
| 135 | - | {
|
| 135 | + | if (PlayerInfo[playerid][pFaction] == 2) |
| 136 | - | strmid(U2BRadius[playerid], inputtext, 0, 32); |
| 136 | + | {
|
| 137 | - | new videostr[128]; |
| 137 | + | if (PlayerToPoint(10.0, playerid,778.3427,-1327.7927,13.5469) ) |
| 138 | - | PlayerU2B[playerid] = 333; |
| 138 | + | {
|
| 139 | - | format(videostr,sizeof(videostr),"www.youtube-mp3.org/api/itemInfo/?video_id=%s",PlayerU2BLink[playerid]); |
| 139 | + | MoveObject(kapi12,764.896484375, -1329.9958496094, 12.734113693237,3.5); |
| 140 | - | HTTP(playerid,HTTP_GET,videostr,"","U2BInfo"); |
| 140 | + | SetTimer("kapi12kapat",7000,false);
|
| 141 | - | return 1; |
| 141 | + | return 1; |
| 142 | - | |
| 142 | + | } |
| 143 | - | } |
| 143 | + | |
| 144 | - | |
| 144 | + | |
| 145 | - | |
| 145 | + | if (strcmp(cmdtext, "/kapiac", true)==0) |
| 146 | - | return 0; |
| 146 | + | {
|
| 147 | - | } |
| 147 | + | if (PlayerInfo[playerid][pFaction] == 2) |
| 148 | - | |
| 148 | + | {
|
| 149 | - | //============================================================================== |
| 149 | + | if (PlayerToPoint(10.0, playerid,777.9497,-1386.6945,13.6749) ) |
| 150 | - | // Functions |
| 150 | + | {
|
| 151 | - | //============================================================================== |
| 151 | + | MoveObject(kapi13,765.23474121094, -1384.611328125, 12.751850128174,3.5); |
| 152 | - | |
| 152 | + | SetTimer("kapi13kapat",7000,false);
|
| 153 | - | public U2BInfo(playerid, response_code, data[]) |
| 153 | + | return 1; |
| 154 | - | {
|
| 154 | + | } |
| 155 | - | if(response_code == 200) |
| 155 | + | |
| 156 | - | {
|
| 156 | + | } |