Guest User

Fully working Radio system [FS]

a guest
Oct 9th, 2018
2,072
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 5.39 KB | None | 0 0
  1.  
  2. #include <a_samp>
  3. #pragma tabsize 0
  4.  
  5. #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
  6. #define RSystem 4000
  7. #define COLOR_YELLOW 0xDABB3EAA
  8. #define COLOR_GREEN 0x9EC73DAA
  9.  
  10.  
  11. new Radio[MAX_PLAYERS];
  12. new Radio1[MAX_PLAYERS];
  13. new Radio2[MAX_PLAYERS];
  14. new Radio3[MAX_PLAYERS];
  15. new Radio4[MAX_PLAYERS];
  16. new Radio5[MAX_PLAYERS];
  17. new Radio6[MAX_PLAYERS];
  18. new Radio7[MAX_PLAYERS];
  19. new Radio8[MAX_PLAYERS];
  20. new Radio9[MAX_PLAYERS];
  21. new Radio10[MAX_PLAYERS];
  22. new Radio11[MAX_PLAYERS];
  23. new Radio12[MAX_PLAYERS];
  24. new Radio13[MAX_PLAYERS];
  25. new Radio14[MAX_PLAYERS];
  26.  
  27. #if defined FILTERSCRIPT
  28.            
  29.            
  30. public OnFilterScriptInit()
  31. {
  32.  
  33.     return 1;
  34. }
  35.  
  36. #endif
  37. public OnPlayerDisconnect(playerid, reason)
  38. {
  39.     return 1;
  40. }
  41.  
  42. public OnPlayerCommandText(playerid, cmdtext[])
  43. {
  44.     dcmd(radijas, 7, cmdtext);
  45.     return 0;
  46. }
  47. dcmd_radijas(playerid, params[])
  48. {
  49.             #pragma unused params
  50.             ShowPlayerDialog(playerid, RSystem, DIALOG_STYLE_LIST, "Radijas", "Radijo stotys\nĮdėti norimos radijos URL\nIšjungti radiją", "Gerai", "Baigti");
  51.             return 1;
  52.     }
  53. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  54. {
  55.     if(dialogid == RSystem)
  56.     {
  57.         if(response)
  58.         {
  59.             if(listitem == 0)
  60.             {
  61.                 ShowPlayerDialog(playerid, 101, DIALOG_STYLE_LIST, "Radijas", "Radiocentras\nLietus\nM-1\nM-1 Plius\nRuskoje Radio\nZIP FM\nFM99\nKelyje (Klaipėda)\nKelyje (Kaunas)\nEuropeanHitRadio\nRelax FM\nBaltracker\nExtra FM\nUtenos radijas\nGeras FM", "Gerai", "Baigti");
  62.             }
  63.             if(listitem == 1)
  64.             {
  65.                 ShowPlayerDialog(playerid, 102, DIALOG_STYLE_INPUT, "Radijas","Įveskite norimos radijos URL adresą", "Gerai", "Baigti");
  66.             }
  67.             if(listitem == 2)
  68.             {
  69.                 StopAudioStreamForPlayer(playerid);
  70.                 GameTextForPlayer(playerid, "~r~Isjungete radija!",2500,4);
  71.             }
  72.             return 1;
  73.         }
  74.     }
  75.     if(dialogid == 101)
  76.     {
  77.         if(response)
  78.         {
  79.             if(listitem == 0)
  80.             {
  81.            Radio[playerid] = PlayAudioStreamForPlayer(playerid, "http://84.46.205.13:80/rc128.mp3");
  82.            GameTextForPlayer(playerid, "~b~Radiocentras",1500,4);
  83.             }
  84.             if(listitem == 1)
  85.             {//
  86.            Radio1[playerid] = PlayAudioStreamForPlayer(playerid, "http://radio.m-1.fm/lietus/mp3");
  87.            GameTextForPlayer(playerid, "~b~Lietus",2500,4);
  88.             }
  89.             if(listitem == 2)
  90.             {
  91.            Radio2[playerid] = PlayAudioStreamForPlayer(playerid, "http://radio.m-1.fm:80/m1/mp3");
  92.            GameTextForPlayer(playerid, "~b~M-1",2500,4);
  93.             }
  94.             if(listitem == 3)
  95.             {
  96.            Radio3[playerid] = PlayAudioStreamForPlayer(playerid, "http://radio.m-1.fm:80/m1plius/mp3");
  97.            GameTextForPlayer(playerid, "~b~M-1 Plius",2500,4);
  98.             }
  99.             if(listitem == 4)
  100.             {
  101.            Radio4[playerid] = PlayAudioStreamForPlayer(playerid, "http://5.20.223.18:80/rrb128.mp3");
  102.            GameTextForPlayer(playerid, "~b~Ruskoje Radio",2500,4);
  103.             }
  104.             if(listitem == 5)
  105.             {
  106.            Radio5[playerid] = PlayAudioStreamForPlayer(playerid, "http://84.46.205.13:80/zipfm128.mp3");
  107.            GameTextForPlayer(playerid, "~b~ZIP FM",2500,4);
  108.             }
  109.             if(listitem == 6)
  110.             {
  111.            Radio6[playerid] = PlayAudioStreamForPlayer(playerid, "http://82.135.234.195:8000/fm99.mp3");
  112.            GameTextForPlayer(playerid, "~b~FM99",2500,4);
  113.             }
  114.             if(listitem == 7)
  115.             {
  116.            Radio7[playerid] = PlayAudioStreamForPlayer(playerid, "http://82.135.234.195:8000/kelyje_klaipeda.mp3");
  117.            GameTextForPlayer(playerid, "~b~Kelyje Klaipeda",2500,4);
  118.             }
  119.             if(listitem == 8)
  120.             {
  121.            Radio8[playerid] = PlayAudioStreamForPlayer(playerid, "http://82.135.234.195:8000/kelyje_kaunas.mp3");
  122.            GameTextForPlayer(playerid, "~b~Kelyje Kaunas",2500,4);
  123.             }
  124.             if(listitem == 9)
  125.             {
  126.            Radio9[playerid] = PlayAudioStreamForPlayer(playerid, "http://82.135.234.195:8000/ehr.mp3");
  127.            GameTextForPlayer(playerid, "~b~European Hit Radio",2500,4);
  128.             }
  129.             if(listitem == 10)
  130.             {
  131.            Radio10[playerid] = PlayAudioStreamForPlayer(playerid, "http://5.20.223.18:80/relaxfm128.mp3");
  132.            GameTextForPlayer(playerid, "~b~Relax FM",2500,4);
  133.             }
  134.             if(listitem == 11)
  135.            {
  136.            Radio11[playerid] = PlayAudioStreamForPlayer(playerid, "http://listen2.myradio24.com:9000/8608");
  137.            GameTextForPlayer(playerid, "~b~Baltracker",2500,4);
  138.             }
  139.             if(listitem == 12)
  140.             {
  141.            Radio12[playerid] = PlayAudioStreamForPlayer(playerid, "http://82.135.234.195:8000/extrafm.mp3");
  142.            GameTextForPlayer(playerid, "~b~Extra FM",2500,4);
  143.             }
  144.             if(listitem == 13)
  145.             {
  146.            Radio13[playerid] = PlayAudioStreamForPlayer(playerid, "http://gyvai.utenosradijas.lt:8010/Utenosradijas");
  147.            GameTextForPlayer(playerid, "~b~Utenos radijas",2500,4);
  148.             }
  149.             if(listitem == 14)
  150.             {
  151.            Radio14[playerid] = PlayAudioStreamForPlayer(playerid, "http://82.135.234.195:8000/gerasfm.mp3");
  152.            GameTextForPlayer(playerid, "~b~Geras FM",2500,4);
  153.             }
  154.             return 1;
  155.         }
  156.     }
  157.     if(dialogid == 102) //
  158.     {
  159.       if(response)
  160.          {
  161.       for(new i=0; i<250; i++)
  162.      {
  163.        if(IsPlayerConnected(i))
  164.       {
  165.            PlayAudioStreamForPlayer(i, inputtext);
  166.          }
  167.       }
  168.     }
  169. }
  170.  
  171.     return 1;
  172. }
Advertisement
Add Comment
Please, Sign In to add comment