Kucin666

Alhambra Club Music System

Jul 14th, 2015
692
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.46 KB | None | 0 0
  1. #include <a_samp>
  2. #include <zcmd>
  3. #include <streamer>
  4.  
  5. #define COLOR_GREEN 0x33AA33AA
  6. #define COLOR_RED 0xAA3333AA
  7. #define COLOR_YELLOW 0xFFFF00AA
  8. #define COLOR_BLUE 0x0000BBAA
  9.  
  10. new pickupenter;
  11.  
  12. public OnFilterScriptInit()
  13. {
  14. print("\n--------------------------------------------------");
  15. print(" Alhambra Club Music System By Kucin666 Loaded...");
  16. print("--------------------------------------------------\n");
  17. return 1;
  18. }
  19.  
  20. public OnFilterScriptExit()
  21. {
  22. print("\n--------------------------------------------------");
  23. print(" Alhambra Club Music System By Kucin666 Unloaded...");
  24. print("--------------------------------------------------\n");
  25. return 1;
  26. }
  27.  
  28. public OnPlayerConnect(playerid)
  29. {
  30. pickupenter = CreatePickup(1318, 1, 1836.6548,-1682.4631,13.3389); /*Location in Idlewood, Los Santos */
  31. CreateDynamicMapIcon(1836.1119,-1681.7277,13.3616, 12, 0); /*Location in Idlewood, Los Santos */
  32. return 1;
  33. }
  34.  
  35. public OnPlayerPickUpPickup(playerid, pickupid)
  36. {
  37. if(pickupid == pickupenter)
  38. {
  39. GameTextForPlayer(playerid,"Type /enterac to enter Alhambra Club",3000,1);
  40. }
  41. return 1;
  42. }
  43.  
  44. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  45. {
  46. for(new i=0; i < MAX_PLAYERS; i++)
  47. {
  48. new string[256], Name[MAX_PLAYER_NAME];
  49. GetPlayerName(playerid, Name, sizeof(Name));
  50. if(dialogid == 1)
  51. {
  52. if(response)
  53. {
  54. if(IsPlayerInRangeOfPoint(i, 30.0 ,493.390991,-22.722799,1000.679687))
  55. {
  56. if(listitem == 0)
  57. {
  58. ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Music Catalog", "Radio paradise \nSlipknot - Psychosocial \nUdo - Go back to hell", "Select", "Cancel");
  59. return 1;
  60. }
  61. if(listitem == 1)
  62. {
  63. ShowPlayerDialog(playerid, 3, DIALOG_STYLE_INPUT, "External Music", "Paste the link of the song, it must be .mp3", "Play", "Cancel");
  64. }
  65. if(listitem == 2)
  66. {
  67. StopAudioStreamForPlayer(i);
  68. format(string, sizeof(string), "Admin %s has stop the Music.", Name);
  69. SendClientMessage(i, COLOR_GREEN, string);
  70. }
  71. }
  72. }
  73. }
  74. if(dialogid == 2)
  75. {
  76. if(response)
  77. {
  78. if(IsPlayerInRangeOfPoint(i, 30.0 ,493.390991,-22.722799,1000.679687))
  79. {
  80. if(listitem == 0)
  81. {
  82. PlayAudioStreamForPlayer(i, "http://www.radioparadise.com/musiclinks/rp_128.m3u"); /* Replace the song with which you like */
  83. format(string, sizeof(string), "Admin %s has play the Music.", Name);
  84. SendClientMessage(i, COLOR_GREEN, string);
  85. }
  86. if(listitem == 1)
  87. {
  88. PlayAudioStreamForPlayer(i, "http://dl.dropbox.com/u/54368978/Slipknot%20-%20Psychosocial.mp3"); /* Replace the song with which you like */
  89. format(string, sizeof(string), "Admin %s has play the Music.", Name);
  90. SendClientMessage(i, COLOR_GREEN, string);
  91. }
  92. if(listitem == 2)
  93. {
  94. PlayAudioStreamForPlayer(i, "http://dl.dropbox.com/u/54368978/UDO%20-%20Go%20back%20to%20hell.mp3"); /* Replace the song with which you like */
  95. format(string, sizeof(string), "Admin %s has play the Music.", Name);
  96. SendClientMessage(i, COLOR_GREEN, string);
  97. }
  98. /* You can add listitem to add music as you like with the numbers 3,4,5 and so on and do not forget to add it in the Music Catalog*/
  99. }
  100. else
  101. {
  102. StopAudioStreamForPlayer(i);
  103. SendClientMessage(i, COLOR_YELLOW, "Alhambra Club has played Music, to be able to hear just join the Alhambra Club to know the location type /whereac");
  104. }
  105. }
  106. }
  107. if(dialogid == 3)
  108. {
  109. if(response)
  110. {
  111. if(IsPlayerInRangeOfPoint(i, 30.0 ,493.390991,-22.722799,1000.679687))
  112. {
  113. PlayAudioStreamForPlayer(i, inputtext);
  114. format(string, sizeof(string), "Admin %s has play the Music.", Name);
  115. SendClientMessage(i, COLOR_GREEN, string);
  116. }
  117. else
  118. {
  119. SendClientMessage(i, COLOR_YELLOW, "Alhambra Club has played Music, to be able to hear just join the Alhambra Club to know the location type /whereac");
  120. }
  121. }
  122. }
  123. }
  124. return 0;
  125. }
  126.  
  127. CMD:whereac(playerid,params[]) {
  128. new Float: DistanceAC = GetPlayerDistanceFromPoint(playerid, 1836.6548,-1682.4631,13.3389), Message[256];
  129. format(Message, sizeof(Message), "Alhambra Club located in Idlewood, Los Santos at map by letter C picture or %0.2f meters away from your position", DistanceAC);
  130. SendClientMessage(playerid, COLOR_GREEN, Message);
  131. return 1;
  132. }
  133.  
  134. CMD:enterac(playerid,params[]) {
  135. if(IsPlayerInRangeOfPoint(playerid, 3.0, 1836.6548,-1682.4631,13.3389))
  136. {
  137. SetPlayerPos(playerid, 493.1443,-24.2607,1000.6797);
  138. SetPlayerInterior(playerid, 17);
  139. SendClientMessage(playerid, 0x55AADDFF, "You have entered a Alhambra Club.. type /exitac to leave");
  140. }
  141. else
  142. {
  143. SendClientMessage(playerid, COLOR_RED, "You must be in Alhambra Club Entry to use this command");
  144. }
  145. return 1;
  146. }
  147.  
  148. CMD:exitac(playerid,params[]) {
  149. if(IsPlayerInRangeOfPoint(playerid, 3.0, 493.1443,-24.2607,1000.6797))
  150. {
  151. StopAudioStreamForPlayer(playerid);
  152. SetPlayerPos(playerid, 1834.5427,-1682.4440,13.4272);
  153. SetPlayerInterior(playerid, 0);
  154. }
  155. else
  156. {
  157. SendClientMessage(playerid, COLOR_RED, "You must be near the exit Alhambra Club to /exitac");
  158. }
  159. return 1;
  160. }
  161.  
  162. CMD:musicac(playerid,params[]) {
  163. if(IsPlayerAdmin(playerid)){
  164. IsPlayerInAlhambraClub(playerid);
  165. return 1;
  166. }
  167. else
  168. {
  169. SendClientMessage(playerid, COLOR_RED, "ERROR: You must be an Admin to use this command");
  170. }
  171. return 1;
  172. }
  173.  
  174. CMD:gotoac(playerid,params[]) {
  175. if(IsPlayerAdmin(playerid)){
  176. new vehid = GetPlayerVehicleID(playerid);
  177. SetPlayerPos(playerid,503.0094,-11.5719,1000.6797);
  178. SetPlayerInterior(playerid,17);
  179. PutPlayerInVehicle(playerid,vehid,0);
  180. SendClientMessage(playerid, 0x55AADDFF, "You have entered a Alhambra Club.. type /exitac to leave");
  181. return 1;
  182. }
  183. else
  184. {
  185. SendClientMessage(playerid, COLOR_RED, "ERROR: You must be an Admin to use this command");
  186. }
  187. return 1;
  188. }
  189.  
  190. stock IsPlayerInAlhambraClub(playerid)
  191. {
  192. if(IsPlayerInRangeOfPoint(playerid, 30.0 ,493.390991,-22.722799,1000.679687))
  193. {
  194. ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Alhambra Club Music List", "Music Catalog \nExternal Music \nStop Music", "Select", "Cancel");
  195. return 1;
  196. }
  197. else
  198. {
  199. SendClientMessage(playerid, COLOR_RED, "ERROR: You must be in a Alhambra Club in order to use Music");
  200. }
  201. return 1;
  202. }
Advertisement
Add Comment
Please, Sign In to add comment