Advertisement
Guest User

Radio System - Optimized Version

a guest
May 9th, 2014
565
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 5.36 KB | None | 0 0
  1. #if defined s_Radio Header
  2. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  3. ::              Radio System - V1 - Optimized Version - 09/05/2014            ::
  4. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  5. #endif
  6. #include                                                        <   a_samp  >
  7. #include                                                        <   zcmd    >
  8. #include                                                        <   sscanf2 >
  9.  
  10. #undef                                                          MAX_PLAYERS
  11. #define                                                         MAX_PLAYERS 50
  12.  
  13. #define                                                         s_ListenD 1000
  14. #define                                                         s_CustomD 2000
  15.  
  16. forward s_Listen(playerid, Link[]);
  17. forward s_CustomR(playerid);
  18. forward s_StopA(playerid);
  19.  
  20. public OnFilterScriptInit()
  21. {
  22.     print("\n");
  23.     print("+++++++++++++++++++++++++++++++++++++++++++++++++++++");
  24.     print(">> Radio System - [XSS]Seby - Loaded Successfully! <<");
  25.     print("+++++++++++++++++++++++++++++++++++++++++++++++++++++");
  26.     print("\n");
  27.     //--------------------------------------------------------------------------
  28.     return 1;
  29. }
  30. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  31. {
  32.     switch(dialogid)
  33.     {
  34.         case s_ListenD:
  35.         {
  36.             if(listitem == 0)
  37.             { if(response) return s_Listen(playerid, "http://80.86.106.136:8088/"); }
  38.             //------------------------------------------------------------------
  39.             if(listitem == 1)
  40.             { if(response) return s_Listen(playerid, "http://stream.profm.ro:8012/profm.mp3"); }
  41.             //------------------------------------------------------------------
  42.             if(listitem == 2)
  43.             { if(response) return s_Listen(playerid, "http://www.radio-hit.ro/asculta.m3u"); }
  44.             //------------------------------------------------------------------
  45.             if(listitem == 3)
  46.             { if(response) return s_Listen(playerid, "http://www.radiomafia.ro/listen.m3u"); }
  47.             //------------------------------------------------------------------
  48.             if(listitem == 4)
  49.             { if(response) return s_Listen(playerid, "http://www.radiowish.ro/live.m3u"); }
  50.             //------------------------------------------------------------------
  51.             if(listitem == 5)
  52.             { if(response) return s_Listen(playerid, "http://radio-fun.ro/asculta.m3u"); }
  53.             //------------------------------------------------------------------
  54.             if(listitem == 6)
  55.             { if(response) return s_Listen(playerid, "http://www.radiolautaru.ro/live.m3u"); }
  56.             //------------------------------------------------------------------
  57.             if(listitem == 7)
  58.             { if(response) return s_Listen(playerid, "http://www.greudedifuzat.eu/greudedifuzat.m3u"); }
  59.             //------------------------------------------------------------------
  60.             if(listitem == 8)
  61.             { if(response) return s_Listen(playerid, "http://www.radioclubmix.ro/live.m3u"); }
  62.             //------------------------------------------------------------------
  63.             if(listitem == 9)
  64.             { if(response) return s_Listen(playerid, "http://radiostardj.ro/lst/hip/listen.pls"); }
  65.             //------------------------------------------------------------------
  66.             if(listitem == 10)
  67.             { if(response) return s_Listen(playerid, "http://www.radiogmusic.com/rock.m3u"); }
  68.             //------------------------------------------------------------------
  69.             if(listitem == 11)
  70.             { if(response) return s_CustomR(playerid); }
  71.             //------------------------------------------------------------------
  72.             if(listitem == 12)
  73.             { if(response) return s_StopA(playerid); }
  74.         }
  75.         case s_CustomD:
  76.         { if(response) return s_Listen(playerid, inputtext); }
  77.     }
  78.     return 1;
  79. }
  80.  
  81. CMD:radio(playerid) return ShowPlayerDialog(playerid, s_ListenD, DIALOG_STYLE_LIST, "Radio", "{0072FF}Kiss FM\n{0072FF}Pro FM\n{0072FF}Radio HiT\n{0072FF}Radio Mafia\n{FFFF00}Radio Wish\n{FFFF00}Radio Fun Manele\n{FFFF00}Radio Lautaru\n{FFFF00}Radio Greu de Difuzat\n{FF0000}Radio Club Mix\n{FF0000}Radio Star DJ Hip-Hop\n{FF0000}Radio GMusic Rock\n{00FF00}Custom Radio Station\n{00FF00}Stop Radio", "Listen", "Close");
  82.  
  83. public s_Listen(playerid, Link[])
  84. {
  85.     new sStr[128];
  86.     //--------------------------------------------------------------------------
  87.     format(sStr, sizeof(sStr), "%s", Link);
  88.     PlayAudioStreamForPlayer(playerid, Link);
  89.     //--------------------------------------------------------------------------
  90.     return 1;
  91. }
  92. public s_CustomR(playerid)
  93. {
  94.     new sStr[200], sStr2[200];
  95.     //--------------------------------------------------------------------------
  96.     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));
  97.     strcat(sStr, sStr2, sizeof(sStr));
  98.     //--------------------------------------------------------------------------
  99.     return ShowPlayerDialog(playerid, s_CustomD, DIALOG_STYLE_INPUT, "Custom {FF0000}Radio", sStr, "Listen", "Close");
  100. }
  101. public s_StopA(playerid) return StopAudioStreamForPlayer(playerid);
  102.  
  103. stock s_ReturnName(playerid)
  104. {
  105.     new pName[MAX_PLAYER_NAME];
  106.     GetPlayerName(playerid, pName, 20);
  107.     return pName;
  108. }
  109. #if defined s_Radio Footer
  110. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  111. ::       Copyright by [XSS]Seby - 2014 - All Rights Reserved. - End Here.     ::
  112. ::                      Contact: samp_theseby@yahoo.com                       ::
  113. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  114. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement