Advertisement
Guest User

Untitled

a guest
Dec 3rd, 2011
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.37 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. public OnFilterScriptInit()
  34. {
  35.     print("\n--------------------------------------");
  36.     print(" PlayHard Radio 0.1a is running.");
  37.     print("--------------------------------------\n");
  38.     return 1;
  39. }
  40.  
  41. public OnFilterScriptExit()
  42. {
  43.     return 1;
  44. }
  45.  
  46. public OnPlayerCommandText(playerid, cmdtext[])
  47. {
  48.     if (strcmp("/phradio", cmdtext, true, 10) == 0)
  49.     {
  50.         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");
  51.         return 1;
  52.     }
  53.     if (strcmp("/stopradio", cmdtext, true, 10) == 0)
  54.     {
  55.         StopAudioStreamForPlayer(playerid);
  56.         return 1;
  57.     }
  58.     return 0;
  59. }
  60. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  61. {
  62.     switch(dialogid)
  63.     {
  64.         case 354: {
  65.             if(!response) return SendClientMessage(playerid, COLOR_WHITE, "You have escaped from the stations list.");
  66.             switch(listitem) {
  67.                 case 0:
  68.                     PlayAudioStreamForPlayer(playerid, ""station1stream""),
  69.                     SendClientMessage(playerid, COLOR_WHITE, "-"red"PlayHard: "yellow"Type /stopradio to stop audio streaming.");
  70.                 case 1:
  71.                     PlayAudioStreamForPlayer(playerid, ""station2stream""),
  72.                     SendClientMessage(playerid, COLOR_WHITE, "-"red"PlayHard: "yellow"Type /stopradio to stop audio streaming.");
  73.                 case 2:
  74.                     PlayAudioStreamForPlayer(playerid, ""station3stream""),
  75.                     SendClientMessage(playerid, COLOR_WHITE, "-"red"PlayHard: "yellow"Type /stopradio to stop audio streaming.");
  76.                 case 3:
  77.                     PlayAudioStreamForPlayer(playerid, ""station4stream""),
  78.                     SendClientMessage(playerid, COLOR_WHITE, "-"red"PlayHard: "yellow"Type /stopradio to stop audio streaming.");
  79.                 case 4:
  80.                     PlayAudioStreamForPlayer(playerid, ""station5stream""),
  81.                     SendClientMessage(playerid, COLOR_WHITE, "-"red"PlayHard: "yellow"Type /stopradio to stop audio streaming.");
  82.                 case 5:
  83.                     PlayAudioStreamForPlayer(playerid, ""station6stream""),
  84.                     SendClientMessage(playerid, COLOR_WHITE, "-"red"PlayHard: "yellow"Type /stopradio to stop audio streaming.");
  85.             }
  86.         }
  87.     }
  88.     return 1;
  89. }
  90.  
  91.  
  92.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement