Advertisement
Guest User

PlayHard Radio 0.1a RC1

a guest
Dec 3rd, 2011
423
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.70 KB | None | 0 0
  1. //================================//
  2. //                                //
  3. //        PlayHard Radio          //
  4. //                                //
  5. //                                //
  6. // A simple audio-streaming radio //
  7. //                                //
  8. //============------==============//
  9. #include <a_samp>
  10.  
  11. //---========Station Names==========---
  12. //-If you want to change the station name just change the name between the brackets " ".
  13. #define station1 "Blues"
  14. #define station2 "Rock"
  15. #define station3 "Pop"
  16. #define station4 "Country"
  17. #define station5 "Dance"
  18. #define station6 "Rap and Hiphop"
  19. //---=====Audio Streaming URLS======---
  20. //-If you want to change the Audio streaming url change the url from the brackets. Make sure it goes with station#.
  21. #define station1stream "http://stream.laut.fm/bluesclub"
  22. #define station2stream "http://67.159.45.87:8226"
  23. #define station3stream "http://live2.radyotvonline:8025"
  24. #define station4stream "http://72.13.81.5:5010"
  25. #define station5stream "http://tai.egihosting.com/dance-32k-mp3"
  26. #define station6stream "http://105-stream-02.datacomm.ch:8000/105dope"
  27. //---===============================---
  28.  
  29. #define red "{FF002B}"
  30. #define yellow "{FAF623}"
  31. #define COLOR_WHITE 0xFFFFFFFF
  32.  
  33. #if defined FILTERSCRIPT
  34.  
  35. public OnFilterScriptInit()
  36. {
  37.     print("\n--------------------------------------");
  38.     print(" PlayHard Radio 0.1a is running.");
  39.     print("--------------------------------------\n");
  40.     return 1;
  41. }
  42.  
  43. public OnFilterScriptExit()
  44. {
  45.     return 1;
  46. }
  47.  
  48. #else
  49.  
  50. main()
  51. {
  52.     print("\n----------------------------------");
  53.     print(" PlayHard Radio 0.1a");
  54.     print("----------------------------------\n");
  55. }
  56.  
  57. #endif
  58.  
  59. public OnPlayerCommandText(playerid, cmdtext[])
  60. {
  61.     if (strcmp("/phradio", cmdtext, true, 10) == 0)
  62.     {
  63.         ShowPlayerDialog(playerid,354,DIALOG_STYLE_LIST,""red"Stations "yellow"List","1. "station1"\r\n2. "station2"\r\n3. "station3"\r\n4. "station4"\r\n5. "station5"\r\n6. "station6"","Select", "Cancel");
  64.         return 1;
  65.     }
  66.     if (strcmp("/stopradio", cmdtext, true, 10) == 0)
  67.     {
  68.         StopAudioStreamForPlayer(playerid);
  69.         return 1;
  70.     }
  71.     return 0;
  72. }
  73.  
  74. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  75. {
  76.     switch(dialogid)
  77.     {
  78.         case 354:
  79.         {
  80.             if(!response)
  81.             {
  82.                 SendClientMessage(playerid, COLOR_WHITE, "You have escaped from the stations list.");
  83.                 return 1;
  84.             }
  85.            
  86.             switch(listitem)
  87.             {
  88.                 case 0:
  89.                 {
  90.                     PlayAudioStreamForPlayer(playerid, ""station1stream"");
  91.                     SendClientMessage(playerid, COLOR_WHITE, "-"red"PlayHard: "yellow"Type /stopradio to stop audio streaming.");
  92.                 }
  93.                 case 1:
  94.                 {
  95.                     PlayAudioStreamForPlayer(playerid, ""station2stream"");
  96.                     SendClientMessage(playerid, COLOR_WHITE, "-"red"PlayHard: "yellow"Type /stopradio to stop audio streaming.");
  97.                 }
  98.                 case 2:
  99.                 {
  100.                     PlayAudioStreamForPlayer(playerid, ""station3stream"");
  101.                     SendClientMessage(playerid, COLOR_WHITE, "-"red"PlayHard: "yellow"Type /stopradio to stop audio streaming.");
  102.                 }
  103.                 case 3:
  104.                 {
  105.                     PlayAudioStreamForPlayer(playerid, ""station4stream"");
  106.                     SendClientMessage(playerid, COLOR_WHITE, "-"red"PlayHard: "yellow"Type /stopradio to stop audio streaming.");
  107.                 }
  108.                 case 4:
  109.                 {
  110.                     PlayAudioStreamForPlayer(playerid, ""station5stream"");
  111.                     SendClientMessage(playerid, COLOR_WHITE, "-"red"PlayHard: "yellow"Type /stopradio to stop audio streaming.");
  112.                 }
  113.                 case 5:
  114.                 {
  115.                     PlayAudioStreamForPlayer(playerid, ""station6stream"");
  116.                     SendClientMessage(playerid, COLOR_WHITE, "-"red"PlayHard: "yellow"Type /stopradio to stop audio streaming.");
  117.                 }
  118.             }
  119.         }
  120.     }
  121.     return 1;
  122. }
  123.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement