Guest User

Zero's Radio System

a guest
Mar 11th, 2012
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.36 KB | None | 0 0
  1. //-------------------------------------------------
  2. //
  3. // Zeros Radio Scrip~ please do not remove credits
  4. //
  5. //-------------------------------------------------
  6. #include <a_samp>
  7.  
  8. #if defined FILTERSCRIPT
  9.  
  10. public OnFilterScriptInit()
  11. {
  12. print("\n--------------------------------------");
  13. print(" Radio System is starting ..");
  14. print(" Radio system has started.");
  15. print("--------------------------------------\n");
  16. return 1;
  17. }
  18.  
  19. public OnFilterScriptExit()
  20. {
  21. print("\n--------------------------------------");
  22. print(" Radio System has been shut down due to a Filterscript unload/Exit.");
  23. print("--------------------------------------\n");
  24. return 1;
  25. }
  26.  
  27. #else
  28.  
  29. main()
  30. {
  31. print("\n----------------------------------");
  32. print(" Radio By Zero");
  33. print("----------------------------------\n");
  34. }
  35.  
  36. #endif
  37.  
  38.  
  39. public OnPlayerCommandText(playerid, cmdtext[])
  40. {
  41. if (strcmp("/radio", cmdtext, true, 10) == 0) //Change this one to whatever you want.
  42. {
  43. ShowPlayerDialog(playerid,90,DIALOG_STYLE_LIST,"EuG Music List Created by zero","1. Dance\r\n2. R&B\r\n3. Rock\r\n4. Electro\r\n5.Country\r\n6.Top40\r\n7.DirtyMix","Start", "Quit");
  44. }
  45. if (strcmp("/stopradio", cmdtext, true, 10) == 0)
  46. {
  47. StopAudioStreamForPlayer(playerid);//This is the function we need to stop the audio from streaming the music.
  48. return 1;
  49. }
  50. return 0;
  51. }
  52.  
  53.  
  54. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  55. {
  56. switch(dialogid)
  57. {
  58. case 90: //Remember the ID we changed in ShowPlayerDialog? (90) That's how the DialogResponse will get to know which Dialog it's going to use.
  59. {
  60. if(!response)// This one is used for option 2 which we changed to (Cancel).
  61. {
  62. SendClientMessage(playerid, 0x42F3F198, "You quit the dialog.");//This one sends a message when you close the dialog using (Cancel).
  63. return 1;
  64. }
  65.  
  66. switch(listitem)//This one will list the items.
  67. {
  68. case 0://Case 0 is basically the first line we made in ShowPlayerDialog (1.)
  69. {
  70. PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1275319");//This function will play our desired radio. So we have to put the url between its brackets.
  71. SendClientMessage(playerid, 0x42F3F198, "Type /stopradio to stop audio streaming."); //This line sends a message to the listener that he can stop it using /stopradio.
  72. }
  73. case 1://Case 1 is the second line we put in ShowPlayerDialog (\r\n2.)
  74. {
  75. PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=663859/");//This function will play our desired radio. So we have to put the url between its brackets.
  76. SendClientMessage(playerid, 0x42F3F198, "Type /stopradio to stop audio streaming.");//This line sends a message to the listener that he can stop it using /stopradio.
  77. }
  78. case 2://Case 2 is the third line we put in ShowPlayerDialog(\r\n3.)
  79. {
  80. PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=21585/");//This function will play our desired radio. So we have to put the url between its brackets.
  81. SendClientMessage(playerid, 0x42F3F198, "Type /stopradio to stop audio streaming.");//This line sends a message to the listener that he can stop it using /stopradio.
  82. }
  83. case 3://Case 1 is the second line we put in ShowPlayerDialog (\r\n4.)
  84. {
  85. PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1275319/");//This function will play our desired radio. So we have to put the url between its brackets.
  86. SendClientMessage(playerid, 0x42F3F198, "Type /stopradio to stop audio streaming.");//This line sends a message to the listener that he can stop it using /stopradio.
  87. }
  88. case 4://Case 1 is the second line we put in ShowPlayerDialog (\r\n5.)
  89. {
  90. PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=668943/");//This function will play our desired radio. So we have to put the url between its brackets.
  91. SendClientMessage(playerid, 0x42F3F198, "Type /stopradio to stop audio streaming.");//This line sends a message to the listener that he can stop it using /stopradio.
  92. }
  93. case 5://Case 1 is the second line we put in ShowPlayerDialog (\r\n5.)
  94. {
  95. PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1281016/");//This function will play our desired radio. So we have to put the url between its brackets.
  96. SendClientMessage(playerid, 0x42F3F198, "Type /stopradio to stop audio streaming.");//This line sends a message to the listener that he can stop it using /stopradio.
  97. }
  98. case 6://Case 1 is the second line we put in ShowPlayerDialog (\r\n6.)
  99. {
  100. PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1283896/");//This function will play our desired radio. So we have to put the url between its brackets.
  101. SendClientMessage(playerid, 0x42F3F198, "Type /stopradio to stop audio streaming.");//This line sends a message to the listener that he can stop it using /stopradio.
  102. }
  103. case 7://Case 1 is the second line we put in ShowPlayerDialog (\r\n6.)
  104. {
  105. PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=4490/");//This function will play our desired radio. So we have to put the url between its brackets.
  106. SendClientMessage(playerid, 0x42F3F198, "Type /stopradio to stop audio streaming.");//This line sends a message to the listener that he can stop it using /stopradio.
  107. }
  108. //You can continue cases here but make sure you make a new line in the ShowPlayerDialog on /radio command \r\n4. 4th \r\n5. 5th channel etc..
  109. }
  110. }
  111. }
  112. return 1;
  113. }
Advertisement
Add Comment
Please, Sign In to add comment