Advertisement
DragonZafiro666

MexRadio v1.0 by DragonZafiro

Mar 17th, 2016
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 4.68 KB | None | 0 0
  1. /*==============================================================================
  2. ** SA-MP (0.3.7)  MexRadio Filterscript v1.0
  3. ** By: DragonZafiro/NeloAngelo
  4. ** Created: 04/03/16
  5. ** Last modified: 17/03/16
  6. ==============================================================================*/
  7. #include <a_samp>
  8. #include <zcmd>
  9. #include <YSI\y_colours>
  10.  
  11. #define COLOR_ADVICE    X11_RED
  12. #define COLOR_SUCCESS   X11_LIMEGREEN
  13. #define PLAIN_TEXT      "{FFFAFA}"
  14. #define M_TEXT          "{808080}"
  15. #define M_TITLE         "{45FF00}"
  16.  
  17. #define DIALOG_MENU 50
  18. #define DIALOG_GEN 51
  19. #define MAX_SONGS 10 // Max Songs per category, must be the same on ALL CATEGORIES
  20. // Definition for isnull():
  21. #if !defined isnull
  22.     #define isnull(%1) ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))
  23. #endif
  24.  
  25. new selected[MAX_PLAYERS];
  26. new _mString[][][] =  
  27. {
  28.     {   // BLUES
  29.         "Megaton Cafe Radio", "http://us1.internet-radio.com:8390/",
  30.         "Midnight Special Blues Radio", "http://uk2.internet-radio.com:8209/",
  31.         "Non Stop Hits From All Eras", "http://uk3.internet-radio.com:8060/",
  32.         "Duo.Click Radio", "http://us1.internet-radio.com:8352/",
  33.         "RadioWahWah", "http://uk1.internet-radio.com:8144/",
  34.         "Aardvark Blues FM", "http://74.208.45.146:8639/",
  35.         "Blues Radio", "http://37.59.14.77:8352/",
  36.         "SuperBluesRadio.Com", "http://109.169.54.86:8036/",
  37.         "Bar Legend Radio", "http://50.7.98.106:8719/",
  38.         "Joint Radio Blues", "http://72.9.152.111:9992/"
  39.     },
  40.     {   // CLASSICAL
  41.         "Venice Classic Radio Italia", "http://109.123.116.202:8022/",
  42.         "Audiophile Baroque", "http://213.251.157.145:8016/",
  43.         "Ancient FM","http://simplexstream.com:8058/",
  44.         "CFMZ","http://199.27.180.216:8019/",
  45.         "ABC Radio 89.2","http://192.235.87.105:14424/",
  46.         "Classical WETA 90.9 FM","http://38.100.128.106:8000/",
  47.         "Hi On Line Classic Radio","http://82.94.166.107:8088/",
  48.         "Abacus Lute","http://91.121.166.38:7250/",
  49.         "AddictedToRadio.com - Classical Channel","http://208.77.21.33:14510/",
  50.         "OM Radio","http://178.168.28.148:8000/"
  51.     },
  52.     {   // ROCK
  53.         "SHE Radio","http://us1.internet-radio.com:8105/",
  54.         "Box UK Radio","http://uk2.internet-radio.com:31076/",
  55.         "STAR FM Maximum Rock ","http://87.230.53.43:8000/",
  56.         "New Country 93","http://173.192.70.138:9170/",
  57.         "4U Classic Rock ","http://217.114.200.100:80/",
  58.         "Ghanansem FM","http://38.96.148.254:8878/",
  59.         "Rockin' Planet Radio","http://us1.internet-radio.com:8396/",
  60.         "Music Tripper","http://us1.internet-radio.com:8220/",
  61.         "Radio RFM SENEGAL","http://192.235.87.113:11446/",
  62.         "Arrow Classic Rock","http://91.221.151.237:8107/"
  63.     },
  64.     {   // HEAVY METAL
  65.         "The KILL.IM", "http://us1.internet-radio.com:8224/",
  66.         "Alchemical Internet Radio", "http://uk3.internet-radio.com:11048/",
  67.         "The VIRAL.IM","http://us1.internet-radio.com:8034/",
  68.         "Metal Devastation Radio","http://188.40.32.140:8061/",
  69.         "Braingell Radio","http://206.217.213.16:8010/",
  70.         "STAR FM Maximum Rock","http://91.250.82.237:7000/",
  71.         "Party at Dans","http://208.80.53.106:31560/",
  72.         "Femmetal Online","http://173.236.59.83:8510/",
  73.         "Tyrant Metal Radio","http://5.39.71.159:8440/",
  74.         "ADMM Metal Music Radio","http://www.icastcenter.com/cast/tunein.php/wendigo/playlist.pls"
  75.     }
  76. };
  77. #define mString[%0][%1][%2] _mString[%0][(2 * (%1)) + (%2)]
  78. CMD:music(playerid, params[])
  79. {
  80.     return cmd_radio(playerid, params);
  81. }
  82. CMD:radio(playerid, params[])
  83. {
  84.     ShowPlayerDialog(playerid, DIALOG_MENU, DIALOG_STYLE_LIST, ""M_TITLE"Select Category:", "Blues\nClassical\nRock\nHeavy Metal", "Select", "Cancel");
  85.     return 1;
  86. }
  87. CMD:stopradio(playerid, params[])
  88. {
  89.     StopAudioStreamForPlayer(playerid);
  90.     return 1;
  91. }
  92. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  93. {
  94.     switch(dialogid)
  95.     {
  96.         case DIALOG_MENU:
  97.         {
  98.             new genString[1000];
  99.             if(response)
  100.             {
  101.                 genString = "";
  102.                 for(new i = 0; i < MAX_SONGS; i++)
  103.                 {
  104.                     if(!isnull(mString[listitem][i][0]))
  105.                         strcat(genString, "{FF0000}• {FAFAFA}");
  106.                     strcat(genString, mString[listitem][i][0]);
  107.                     strcat(genString, "\n");
  108.                 }
  109.                 selected[playerid] = listitem;
  110.                 ShowPlayerDialog(playerid, DIALOG_GEN, DIALOG_STYLE_LIST, ""M_TITLE"Select Radio:", genString, "Select", "Cancel");
  111.             }
  112.            
  113.         }
  114.         case DIALOG_GEN:
  115.         {
  116.             if(response)
  117.             {
  118.                 new str[100];
  119.                 format(str, 100, "-> "PLAIN_TEXT"Now Playing: "M_TITLE"%s", mString[selected[playerid]][listitem][0]);
  120.                 SendClientMessage(playerid, COLOR_SUCCESS, str);
  121.                 PlayAudioStreamForPlayer(playerid, mString[selected[playerid]][listitem][1]);
  122.                 SendClientMessage(playerid, COLOR_ADVICE, "[!]: "PLAIN_TEXT"Use "M_TEXT"/StopRadio "PLAIN_TEXT"to stop the radio.");
  123.             }
  124.         }
  125.     }
  126.     return 1;
  127. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement