Advertisement
Banditul

Radio

Feb 14th, 2016
765
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 7.01 KB | None | 0 0
  1. #define FILTERSCRIPT
  2. #include <a_samp>
  3. #undef MAX_PLAYERS
  4. #define MAX_PLAYERS 50
  5. #include <izcmd>
  6. #include <sscanf2>
  7.  
  8. #define Radio 7500
  9. #define youtube 7501
  10.  
  11. new radiolis[MAX_PLAYERS];
  12. public OnPlayerDisconnect(playerid, reason)
  13. {
  14.     radiolis[playerid] = 0;
  15. }
  16. public OnPlayerConnect(playerid)
  17. {
  18.     radiolis[playerid] = 0;
  19. }
  20. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  21. {
  22.     switch(dialogid)
  23.     {
  24.         case Radio:
  25.         {
  26.             if(response)
  27.             {
  28.                 switch(listitem)
  29.                 {
  30.                     case 0: return  ProFM(playerid);
  31.                     case 1: return RadioHIT(playerid);
  32.                     case 2: return Wish(playerid);
  33.                     case 3: return Party(playerid);
  34.                     case 4: return Manele(playerid);
  35.                     case 5: return Trap(playerid);
  36.                     case 6: return Rock(playerid);
  37.                     case 7: return Hip(playerid);
  38.                     case 8: return Paradise(playerid);
  39.                     case 9: return Radio21(playerid);
  40.                     case 10: return SuperFM(playerid);
  41.                     case 11: return EuropaFM(playerid);
  42.                     case 12: return Bandit(playerid);
  43.                     case 13: return Mafia(playerid);
  44.                     case 14: return Intens(playerid);
  45.                     case 15: return Gamelive(playerid);
  46.                     case 16: ShowPlayerDialog(playerid,youtube, DIALOG_STYLE_INPUT, "Youtube", "Enter a youtube link below:", "Start", "Cancel");
  47.                     case 17: return Stop(playerid);
  48.                 }
  49.             }
  50.        
  51.         }
  52.         case youtube:
  53.         {
  54.             if(!response)
  55.                 return 1;
  56.             if(response)
  57.             {
  58.                 new string[180];
  59.                 format(string, 160, "http://www.youtubeinmp3.com/fetch/?video=%s", inputtext);
  60.                 PlayAudioStreamForPlayer(playerid, string);
  61.             }
  62.  
  63.         }
  64.     }
  65.     return 0;
  66. }
  67. CMD:radio(playerid, params[])
  68. {
  69.     new string[540], hit, fm, wish, party, trap, rock, hip, para, manele, radio21, superFM, europaFM, bandit,mafia,intens,gl;
  70.     for(new i=0,j=GetPlayerPoolSize(); i<=j;i++)
  71.     {
  72.         if(!IsPlayerConnected(i)) continue;
  73.         switch(radiolis[i])
  74.         {
  75.             case 1: fm++;
  76.             case 2: hit++;
  77.             case 3: wish++;
  78.             case 4: party++;
  79.             case 5: manele++;
  80.             case 6: trap++;
  81.             case 7: rock++;
  82.             case 8: hip++;
  83.             case 9: para++;
  84.             case 10: radio21++;
  85.             case 11: superFM++;
  86.             case 12: europaFM++;
  87.             case 13: bandit++;
  88.             case 14: mafia++;
  89.             case 15: intens++;
  90.             case 16: gl++;
  91.         }
  92.        
  93.     }
  94.     format(string, sizeof(string), "%s#\tRadio Name\tListeners\n", string);
  95.     format(string, sizeof(string), "%s1.\tPro FM\t%d Listeners\n", string, fm);
  96.     format(string, sizeof(string), "%s2.\tRadio HiT FM \t%d Listeners\n", string, hit);
  97.     format(string, sizeof(string), "%s3.\tRadio Wish\t%d Listeners\n", string, wish);  
  98.     format(string, sizeof(string), "%s4.\tRadio Party Romania\t%d Listeners\n", string, party);
  99.     format(string, sizeof(string), "%s5.\tRadio Taraf\t%d Listeners\n", string, manele);
  100.     format(string, sizeof(string), "%s6.\tTrap Radio\t%d Listeners\n", string, trap);
  101.     format(string, sizeof(string), "%s7.\tRadio Music Rock\t%d Listeners\n", string, rock);
  102.     format(string, sizeof(string), "%s8.\tRadio Romanian Hip-Hop\t%d Listeners\n", string, hip);
  103.     format(string, sizeof(string), "%s9.\tRadio Paradise\t%d Listeners\n", string, para);
  104.     format(string, sizeof(string), "%s10.\tRadio 21\t%d Listeners\n", string, radio21);
  105.     format(string, sizeof(string), "%s11.\tRadio SuperFM\t%d Listeners\n", string, superFM);
  106.     format(string, sizeof(string), "%s12.\tRadio EuropaFM\t%d Listeners\n", string, europaFM);
  107.     format(string, sizeof(string), "%s13.\tRadio Bandit\t%d Listeners\n", string, bandit);
  108.     format(string, sizeof(string), "%s14.\tRadio Mafia\t%d Listeners\n", string, mafia);
  109.     format(string, sizeof(string), "%s15.\tRadio Intens\t%d Listeners\n", string, intens);
  110.     format(string, sizeof(string), "%s16.\tRadio GameLive\t%d Listeners\n", string, intens);
  111.     format(string, sizeof(string), "%s17.\tYoutube Player\n", string);
  112.     format(string, sizeof(string), "%s\tStop Radio\t", string);
  113.    
  114.  
  115.     ShowPlayerDialog(playerid, Radio, DIALOG_STYLE_TABLIST_HEADERS, "Radio Stations",string,"Select", "Cancel");
  116.     return 1;
  117. }
  118. ProFM(playerid)
  119. {
  120.     radiolis[playerid] = 1;
  121.     PlayAudioStreamForPlayer(playerid, "http://stream.profm.ro:8012/profm.mp3");
  122.     return 1;
  123. }
  124. RadioHIT(playerid)
  125. {
  126.     radiolis[playerid] = 2;
  127.     PlayAudioStreamForPlayer(playerid, "http://www.radio-hit.ro/asculta.m3u");
  128.     return 1;
  129. }
  130. Wish(playerid)
  131. {
  132.     radiolis[playerid] = 3;
  133.     PlayAudioStreamForPlayer(playerid, "http://www.radiowish.ro/live.m3u");
  134.     return 1;
  135. }
  136. Party(playerid)
  137. {
  138.     radiolis[playerid] = 4;
  139.     PlayAudioStreamForPlayer(playerid, "http://www.partyradio.ro/live.m3u");
  140.     return 1;
  141. }
  142. Manele(playerid)
  143. {
  144.     radiolis[playerid] = 5;
  145.     PlayAudioStreamForPlayer(playerid, "http://live.radiotaraf.ro:8181");
  146.     return 1;
  147. }
  148. Trap(playerid)
  149. {
  150.     radiolis[playerid] = 6;
  151.     PlayAudioStreamForPlayer(playerid, "http://listen.radionomy.com/It-saTrapRadio");
  152.     return 1;
  153. }
  154. Rock(playerid)
  155. {
  156.     radiolis[playerid] = 7;
  157.     PlayAudioStreamForPlayer(playerid, "http://www.radiogmusic.com/rock.m3u");
  158.     return 1;
  159. }
  160. Hip(playerid)
  161. {
  162.     radiolis[playerid] = 8;
  163.     PlayAudioStreamForPlayer(playerid, "http://radioromanian.net/hiphop.pls");
  164.     return 1;
  165. }
  166. Paradise(playerid)
  167. {
  168.     radiolis[playerid] = 9;
  169.     PlayAudioStreamForPlayer(playerid, "http://www.radioparadise.com/musiclinks/rp_128.m3u");
  170.     return 1;
  171. }
  172. Radio21(playerid)
  173. {
  174.     radiolis[playerid] = 10;
  175.     PlayAudioStreamForPlayer(playerid, "http://astreaming.radio21.ro:8000/radio21_mp3_64k");
  176.     return 1;
  177. }
  178. SuperFM(playerid)
  179. {
  180.     radiolis[playerid] = 11;
  181.     PlayAudioStreamForPlayer(playerid, "http://82.77.45.227:8102");
  182.     return 1;
  183. }
  184. EuropaFM(playerid)
  185. {
  186.     radiolis[playerid] = 12;
  187.     PlayAudioStreamForPlayer(playerid, "http://astreaming.europafm.ro:8000/europafm_mp3_64k");
  188.     return 1;
  189. }
  190. Bandit(playerid)
  191. {
  192.     radiolis[playerid] = 13;
  193.     PlayAudioStreamForPlayer(playerid, "http://radiobandit.mine.nu:8000/");
  194.     return 1;
  195. }
  196. Mafia(playerid)
  197. {
  198.     radiolis[playerid] = 14;
  199.     PlayAudioStreamForPlayer(playerid, "http://37.59.224.227:1717/");
  200.     return 1;
  201. }
  202. Intens(playerid)
  203. {
  204.     radiolis[playerid] = 15;
  205.     PlayAudioStreamForPlayer(playerid, "http://live.radiointens.ro:8070/");
  206.     return 1;
  207. }
  208. Gamelive(playerid)
  209. {
  210.     radiolis[playerid] = 16;
  211.     PlayAudioStreamForPlayer(playerid, "http://radio.paginieuropene.com:8051/stream");
  212.     return 1;
  213. }
  214. Stop(playerid)
  215. {  
  216.     radiolis[playerid] = 0;
  217.     StopAudioStreamForPlayer(playerid);
  218.     return 1;
  219. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement