Guest User

REAL Everystuff Radio Command

a guest
Feb 26th, 2013
497
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.05 KB | None | 0 0
  1. #include <a_samp>
  2. #include "../include/gl_common.inc" // for strtok usage
  3.  
  4. // top of script
  5. #define D_RADIO 1258
  6. #define D_RADIOMUSIC 1259
  7. #define D_RADIO_PINPUT 1260
  8.  
  9.  
  10. public OnFilterScriptInit()
  11. {
  12. print("\n--------------------------------------");
  13. print(" Generic radio command");
  14. print(" kaisersouse - use it all you want");
  15. print("--------------------------------------\n");
  16.  
  17. return 1;
  18. }
  19. //------------------------------------------------------------------------------
  20. public OnFilterScriptExit()
  21. {
  22. return 1;
  23. }
  24. //------------------------------------------------------------------------------
  25. public OnPlayerCommandText(playerid, cmdtext[])
  26. {
  27. new cmd[256+1];
  28. new idx;
  29. cmd = strtok(cmdtext, idx);
  30. if(strcmp("/radio", cmd, true) == 0)
  31. {
  32. ShowPlayerDialog(playerid, D_RADIO, DIALOG_STYLE_LIST, "Choose Radio Feed","-- TURN OFF RADIO --\n{33AA33}++Add Your URL{FFFFFF}\nMusic/News Radio","Listen","Exit");
  33. return 1;
  34. }
  35. return 0;
  36. }
  37. //------------------------------------------------------------------------------
  38. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  39. {
  40. if(dialogid == D_RADIO && response)
  41. {
  42. switch(listitem)
  43. {
  44. case 0:
  45. {
  46. StopAudioStreamForPlayer(playerid);
  47. return SendClientMessage(playerid,-1,"You may have to exit/re-enter vehicle for stereo to work again");
  48. }
  49. case 1: ShowPlayerDialog(playerid, D_RADIO_PINPUT,DIALOG_STYLE_INPUT,"Enter stream URL","If you hear nothing, its a bad URL!","Play URL","Cancel");
  50. case 2: ShowPlayerDialog(playerid, D_RADIOMUSIC, DIALOG_STYLE_LIST, "Choose Music Radio",".977 Hitz\n90s Alternative\nTop 40\nDub Step\nHip Hop\nUnderground Rap\nRock and Roll\nOpera\nClassical\nBlues\nTechno\nTrip Hop\nBollywood\nVideo Game\nMovie\nMetal\nNews\n50s and 60s Oldies\nThe 70s\nThe 80s\nCrazyBob's CnR SAMP Radio\nBeat Basement ","Listen","Exit");
  51. }
  52. return 1;
  53. }
  54. else if (dialogid == D_RADIO_PINPUT && response)
  55. {
  56. if(strlen(inputtext) > 0)
  57. {
  58. PlayAudioStreamForPlayer(playerid,inputtext);
  59. }
  60. else
  61. {
  62. SendClientMessage(playerid,-1,"Your input was too short.");
  63. }
  64.  
  65. }
  66. else if(dialogid == D_RADIOMUSIC && response)
  67. {
  68. switch(listitem) //music stations
  69. {
  70. case 0: PlayAudioStreamForPlayer(playerid,"http://7609.live.streamtheworld.com:80/977_HITS_SC"); //.977 hitz
  71. case 1: PlayAudioStreamForPlayer(playerid, "http://7639.live.streamtheworld.com:80/977_ALTERN_SC"); // alternative
  72. case 2: PlayAudioStreamForPlayer(playerid,"http://yp.shoutcast.com/sbin/tunein-station.pls?id=38370"); // top 40
  73. case 3: PlayAudioStreamForPlayer(playerid,"http://yp.shoutcast.com/sbin/tunein-station.pls?id=319038"); //dubstep
  74. case 4: PlayAudioStreamForPlayer(playerid,"http://yp.shoutcast.com/sbin/tunein-station.pls?id=71829"); // hip-hop / rap
  75. case 5: PlayAudioStreamForPlayer(playerid,"http://yp.shoutcast.com/sbin/tunein-station.pls?id=9054"); // underground rap
  76. case 6: PlayAudioStreamForPlayer(playerid,"http://yp.shoutcast.com/sbin/tunein-station.pls?id=29469"); //rock
  77. case 7: PlayAudioStreamForPlayer(playerid,"http://yp.shoutcast.com/sbin/tunein-station.pls?id=1269951"); //opera
  78. case 8: PlayAudioStreamForPlayer(playerid,"http://yp.shoutcast.com/sbin/tunein-station.pls?id=403280"); //classical
  79. case 9: PlayAudioStreamForPlayer(playerid,"http://yp.shoutcast.com/sbin/tunein-station.pls?id=205177"); //blues
  80. case 10: PlayAudioStreamForPlayer(playerid,"http://yp.shoutcast.com/sbin/tunein-station.pls?id=1377200"); // techno
  81. case 11: PlayAudioStreamForPlayer(playerid,"http://yp.shoutcast.com/sbin/tunein-station.pls?id=82343"); //trip hop
  82. case 12: PlayAudioStreamForPlayer(playerid,"http://yp.shoutcast.com/sbin/tunein-station.pls?id=817801"); //bollywood
  83. case 13: PlayAudioStreamForPlayer(playerid,"http://yp.shoutcast.com/sbin/tunein-station.pls?id=15706"); //video game music
  84. case 14: PlayAudioStreamForPlayer(playerid,"http://yp.shoutcast.com/sbin/tunein-station.pls?id=5266"); //movie soundtracks
  85. case 15: PlayAudioStreamForPlayer(playerid,"http://yp.shoutcast.com/sbin/tunein-station.pls?id=318248"); //metal
  86. case 16: PlayAudioStreamForPlayer(playerid,"http://yp.shoutcast.com/sbin/tunein-station.pls?id=1279013"); //world news
  87. case 17: PlayAudioStreamForPlayer(playerid,"http://7659.live.streamtheworld.com:80/977_OLDIES_SC"); //50s 60s oldies
  88. case 18: PlayAudioStreamForPlayer(playerid,"http://7649.live.streamtheworld.com:80/977_CLASSROCK_SC"); //70s
  89. case 19: PlayAudioStreamForPlayer(playerid,"http://7649.live.streamtheworld.com:80/977_80_SC"); //80s
  90. case 20: PlayAudioStreamForPlayer(playerid,"http://cnr-radio.com/listen.m3u"); //CBs CnR
  91. case 21: PlayAudioStreamForPlayer(playerid,"http://yp.shoutcast.com/sbin/tunein-station.pls?id=1377877");
  92. }
  93. }
  94. return 1;
  95. }
  96. //------------------------------------------------------------------------------
  97. public OnPlayerDisconnect(playerid, reason)
  98. {
  99. StopAudioStreamForPlayer(playerid);
  100. return 1;
  101. }
  102. //------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment