Advertisement
Guest User

Radio System

a guest
May 8th, 2014
648
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 7.63 KB | None | 0 0
  1. #if defined s_Radio Header
  2. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  3. --------------------------------------------------------------------------------
  4. |                          Radio System V1.0 by [XSS]Seby                      |
  5. |            System Created on 05 May 2014 for Romania eXtreme Stunt V4        |
  6. |                       And for SA-MP.com / SA-MP.ro / GTA-MP.ro               |
  7. --------------------------------------------------------------------------------
  8. |                You can edit this filterscript in witch way you want          |
  9. |                   if you keep my name in /Credits on your Server.            |
  10. --------------------------------------------------------------------------------
  11. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  12. #endif
  13. #include                                                        <   a_samp  >
  14. #include                                                        <   zcmd    >
  15. #include                                                        <   sscanf2 >
  16.  
  17. #undef                                                          MAX_PLAYERS
  18. #define                                                         MAX_PLAYERS 50
  19.  
  20. #define                                                         LIME 0x00FF00AA
  21. #define                                                         s_ListenD 1000
  22. #define                                                         s_CustomD 2000
  23.  
  24. forward s_Listen(playerid, Link[]);
  25. forward s_CustomR(playerid);
  26. forward s_StopA(playerid);
  27.  
  28. public OnFilterScriptInit()
  29. {
  30.     print("\n");
  31.     print("+++++++++++++++++++++++++++++++++++++++++++++++++++++");
  32.     print(">> Radio System - [XSS]Seby - Loaded Successfully! <<");
  33.     print("+++++++++++++++++++++++++++++++++++++++++++++++++++++");
  34.     print("\n");
  35.     //--------------------------------------------------------------------------
  36.     return 1;
  37. }
  38. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  39. {
  40.     switch(dialogid)
  41.     {
  42.         case s_ListenD:
  43.         {
  44.             if(listitem == 0)
  45.             {
  46.                 if(response) return s_Listen(playerid, "http://80.86.106.136:8088/");
  47.             }
  48.             if(listitem == 1)
  49.             {
  50.                 if(response) return s_Listen(playerid, "http://stream.profm.ro:8012/profm.mp3");
  51.             }
  52.             if(listitem == 2)
  53.             {
  54.                 if(response) return s_Listen(playerid, "http://www.radio-hit.ro/asculta.m3u");
  55.             }
  56.             if(listitem == 3)
  57.             {
  58.                 if(response) return s_Listen(playerid, "http://www.radiomafia.ro/listen.m3u");
  59.             }
  60.             if(listitem == 4)
  61.             {
  62.                 if(response) return s_Listen(playerid, "http://www.radiowish.ro/live.m3u");
  63.             }
  64.             if(listitem == 5)
  65.             {
  66.                 if(response) return s_Listen(playerid, "http://radio-fun.ro/asculta.m3u");
  67.             }
  68.             if(listitem == 6)
  69.             {
  70.                 if(response) return s_Listen(playerid, "http://www.radiolautaru.ro/live.m3u");
  71.             }
  72.             if(listitem == 7)
  73.             {
  74.                 if(response) return s_Listen(playerid, "http://www.greudedifuzat.eu/greudedifuzat.m3u");
  75.             }
  76.             if(listitem == 8)
  77.             {
  78.                 if(response) return s_Listen(playerid, "http://www.radioclubmix.ro/live.m3u");
  79.             }
  80.             if(listitem == 9)
  81.             {
  82.                 if(response) return s_Listen(playerid, "http://radiostardj.ro/lst/hip/listen.pls");
  83.             }
  84.             if(listitem == 10)
  85.             {
  86.                 if(response) return s_Listen(playerid, "http://www.radiogmusic.com/rock.m3u");
  87.             }
  88.             if(listitem == 11)
  89.             {
  90.                 if(response) return s_CustomR(playerid);
  91.             }
  92.             if(listitem == 12)
  93.             {
  94.                 if(response) return s_StopA(playerid);
  95.             }
  96.         }
  97.         case s_CustomD:
  98.         {
  99.             if(response) return s_Listen(playerid, inputtext);
  100.         }
  101.     }
  102.     return 1;
  103. }
  104.  
  105. CMD:radio(playerid, params[])
  106. {
  107.     if(isnull(params))
  108.     {
  109.         new sStr[1000];
  110.         //--------------------------------------------------------------------------
  111.         strcat(sStr, "{0072FF}Kiss FM - /Radio 1\n", sizeof(sStr));
  112.         strcat(sStr, "{0072FF}Pro FM - /Radio 2\n", sizeof(sStr));
  113.         strcat(sStr, "{0072FF}Radio HiT - /Radio 3\n", sizeof(sStr));
  114.         strcat(sStr, "{0072FF}Radio Mafia - /Radio 4\n", sizeof(sStr));
  115.         strcat(sStr, "{FFFF00}Radio Wish - /Radio 5\n", sizeof(sStr));
  116.         strcat(sStr, "{FFFF00}Radio Fun Manele - /Radio 6\n", sizeof(sStr));
  117.         strcat(sStr, "{FFFF00}Radio Lautaru - /Radio 7\n", sizeof(sStr));
  118.         strcat(sStr, "{FFFF00}Radio Greu de Difuzat - /Radio 8\n", sizeof(sStr));
  119.         strcat(sStr, "{FF0000}Radio Club Mix - /Radio 9\n", sizeof(sStr));
  120.         strcat(sStr, "{FF0000}Radio Star DJ Hip-Hop - /Radio 10\n", sizeof(sStr));
  121.         strcat(sStr, "{FF0000}Radio GMusic Rock - /Radio 11\n", sizeof(sStr));
  122.         strcat(sStr, "{00FF00}Custom Radio Station\n", sizeof(sStr));
  123.         strcat(sStr, "{00FF00}Stop Radio", sizeof(sStr));
  124.         //--------------------------------------------------------------------------
  125.         return ShowPlayerDialog(playerid, s_ListenD, DIALOG_STYLE_LIST, "Radio", sStr, "Listen", "Close");
  126.     }
  127.     else if(strcmp(params, "1", true) == 0)  return s_Listen(playerid, "http://80.86.106.136:8088/");
  128.     else if(strcmp(params, "2", true) == 0)  return s_Listen(playerid, "http://stream.profm.ro:8012/profm.mp3");
  129.     else if(strcmp(params, "3", true) == 0)  return s_Listen(playerid, "http://www.radio-hit.ro/asculta.m3u");
  130.     else if(strcmp(params, "4", true) == 0)  return s_Listen(playerid, "http://www.radiomafia.ro/listen.m3u");
  131.     else if(strcmp(params, "5", true) == 0)  return s_Listen(playerid, "http://www.radiowish.ro/live.m3u");
  132.     else if(strcmp(params, "6", true) == 0)  return s_Listen(playerid, "http://radio-fun.ro/asculta.m3u");
  133.     else if(strcmp(params, "7", true) == 0)  return s_Listen(playerid, "http://www.radiolautaru.ro/live.m3u");
  134.     else if(strcmp(params, "8", true) == 0)  return s_Listen(playerid, "http://www.greudedifuzat.eu/greudedifuzat.m3u");
  135.     else if(strcmp(params, "9", true) == 0)  return s_Listen(playerid, "http://www.radioclubmix.ro/live.m3u");
  136.     else if(strcmp(params, "10", true) == 0) return s_Listen(playerid, "http://radiostardj.ro/lst/hip/listen.pls");
  137.     else if(strcmp(params, "11", true) == 0) return s_Listen(playerid, "http://www.radiogmusic.com/rock.m3u");
  138.     else if(strcmp(params, "custom", true) == 0) return s_CustomR(playerid);
  139.     else if(strcmp(params, "stop", true) == 0) return s_StopA(playerid);
  140.     //--------------------------------------------------------------------------
  141.     return 1;
  142. }
  143.  
  144. public s_Listen(playerid, Link[])
  145. {
  146.     new sStr[128];
  147.     //--------------------------------------------------------------------------
  148.     format(sStr, sizeof(sStr), "%s", Link);
  149.     PlayAudioStreamForPlayer(playerid, Link);
  150.     //--------------------------------------------------------------------------
  151.     return 1;
  152. }
  153. public s_CustomR(playerid)
  154. {
  155.     new sStr[200], sStr2[200];
  156.     //--------------------------------------------------------------------------
  157.     format(sStr2, sizeof(sStr2), "{00FF00}Hi, {FF0000}%s{00FF00}!\n{00FF00}Please enter the {FF0000}Radio Station Link {00FF00}you want to listen before:", s_ReturnName(playerid));
  158.     strcat(sStr, sStr2, sizeof(sStr));
  159.     //--------------------------------------------------------------------------
  160.     return ShowPlayerDialog(playerid, s_CustomD, DIALOG_STYLE_INPUT, "Custom {FF0000}Radio", sStr, "Listen", "Close");
  161. }
  162. public s_StopA(playerid) return StopAudioStreamForPlayer(playerid);
  163.  
  164. stock s_ReturnName(playerid)
  165. {
  166.     new pName[MAX_PLAYER_NAME];
  167.     GetPlayerName(playerid, pName, 20);
  168.     return pName;
  169. }
  170. #if defined s_Radio Footer
  171. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  172. --------------------------------------------------------------------------------
  173. |       Copyright by [XSS]Seby - 2014 - All Rights Reserved. - End Here.       |
  174. |                       Contact: samp_theseby@yahoo.com                        |
  175. --------------------------------------------------------------------------------
  176. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  177. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement