Advertisement
Guest User

Muisc System

a guest
May 26th, 2014
662
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.46 KB | None | 0 0
  1. /*=============================================================
  2. =============================================================
  3. Music System by HitterHitman a.k.a Kick_Ass.
  4. Credits:
  5. HitterHitman a.k.a Kick_Ass(me) for the script.
  6. Diclaimer:
  7. Don't remove or add any credits.
  8. Don't release it without my permission.
  9. Don't post any edited versions.
  10. =============================================================
  11. =============================================================*/
  12. //includes
  13. #include <a_samp>//by SA-MP Team
  14. #include <zcmd>//by Zeex
  15. //=============================================================
  16. //=============================================================
  17. //Defines//
  18. #define Song1 "~r~T~w~umbourine"
  19. #define Song1URL "http://k007.kiwi6.com/download/qwfrxp3ko6"
  20. #define Song1Info "Album: ~r~None~n~~w~Author: ~r~Eve~n~~w~Length: ~r~3:12~n~"
  21. //=============================================================
  22. #define Song2 "~r~B~w~lack & ~r~Y~w~ellow"
  23. #define Song2URL "http://allinonegame.weebly.com/uploads/1/3/2/9/13299580/black_and_yellow.mp3"
  24. #define Song2Info "Album: ~r~Unknown~n~~w~Author: ~r~Unknown~n~~w~Length: ~r~Unknown~n~"
  25. //=============================================================
  26. #define Song3 "~r~D~w~o ~r~f~w~or ~r~l~w~ove"
  27. #define Song3URL "http://www.directlinkupload.com/uploads/117.200.242.54/P%20Holla%20-%20Do%20it%20for%20love.mp3"
  28. #define Song3Info "Album: ~r~None~n~~w~Author: ~r~P holla~n~~w~Length: ~r~3:04~n~"
  29. //=============================================================
  30. #define Song4 "Song 4"
  31. #define Song4URL " "
  32. #define Song4Info "Album: ~n~Author: ~n~Length: ~n~"
  33. //=============================================================
  34. #define Song5 "Song 5"
  35. #define Song5URL " "
  36. #define Song5Info "Album: ~n~Author: ~n~Length: ~n~"
  37. //=============================================================
  38. //=============================================================
  39. //Variables//
  40. new Text:MusicText[17];
  41. new PlayerText:Discription[MAX_PLAYERS];
  42. //=============================================================
  43. //=============================================================
  44. public OnFilterScriptInit()
  45. {
  46. print("\n-----------------------------------------------");
  47. print(" Music System by HitterHitman a.k.a. Kick_Ass");
  48. print("------------------->Loaded<-------------------");
  49. print("----------------------------------------------\n");
  50.  
  51. MusicText[0] = TextDrawCreate(478.000000, 121.000000, "~n~");
  52. TextDrawBackgroundColor(MusicText[0], 255);
  53. TextDrawFont(MusicText[0], 1);
  54. TextDrawLetterSize(MusicText[0], 0.500000, 1.000000);
  55. TextDrawColor(MusicText[0], -1);
  56. TextDrawSetOutline(MusicText[0], 0);
  57. TextDrawSetProportional(MusicText[0], 1);
  58. TextDrawSetShadow(MusicText[0], 1);
  59. TextDrawUseBox(MusicText[0], 1);
  60. TextDrawBoxColor(MusicText[0], 255);
  61. TextDrawTextSize(MusicText[0], 143.000000, 0.000000);
  62. TextDrawSetSelectable(MusicText[0], 0);
  63.  
  64. MusicText[1] = TextDrawCreate(478.000000, 342.000000, "~n~");
  65. TextDrawBackgroundColor(MusicText[1], 255);
  66. TextDrawFont(MusicText[1], 1);
  67. TextDrawLetterSize(MusicText[1], 0.500000, 1.000000);
  68. TextDrawColor(MusicText[1], -1);
  69. TextDrawSetOutline(MusicText[1], 0);
  70. TextDrawSetProportional(MusicText[1], 1);
  71. TextDrawSetShadow(MusicText[1], 1);
  72. TextDrawUseBox(MusicText[1], 1);
  73. TextDrawBoxColor(MusicText[1], 255);
  74. TextDrawTextSize(MusicText[1], 143.000000, 0.000000);
  75. TextDrawSetSelectable(MusicText[1], 0);
  76.  
  77. MusicText[2] = TextDrawCreate(478.000000, 138.000000, "~n~");
  78. TextDrawBackgroundColor(MusicText[2], 255);
  79. TextDrawFont(MusicText[2], 1);
  80. TextDrawLetterSize(MusicText[2], 0.500000, 9.599998);
  81. TextDrawColor(MusicText[2], -1);
  82. TextDrawSetOutline(MusicText[2], 0);
  83. TextDrawSetProportional(MusicText[2], 1);
  84. TextDrawSetShadow(MusicText[2], 1);
  85. TextDrawUseBox(MusicText[2], 1);
  86. TextDrawBoxColor(MusicText[2], 100);
  87. TextDrawTextSize(MusicText[2], 143.000000, 0.000000);
  88. TextDrawSetSelectable(MusicText[2], 0);
  89.  
  90. MusicText[3] = TextDrawCreate(149.000000, 232.000000, " Description");
  91. TextDrawBackgroundColor(MusicText[3], 255);
  92. TextDrawFont(MusicText[3], 3);
  93. TextDrawLetterSize(MusicText[3], 0.500000, 1.000000);
  94. TextDrawColor(MusicText[3], -1);
  95. TextDrawSetOutline(MusicText[3], 1);
  96. TextDrawSetProportional(MusicText[3], 1);
  97. TextDrawUseBox(MusicText[3], 1);
  98. TextDrawBoxColor(MusicText[3], 255);
  99. TextDrawTextSize(MusicText[3], 472.000000, 0.000000);
  100. TextDrawSetSelectable(MusicText[3], 0);
  101.  
  102. MusicText[4] = TextDrawCreate(477.000000, 138.000000, "~n~");
  103. TextDrawBackgroundColor(MusicText[4], 255);
  104. TextDrawFont(MusicText[4], 1);
  105. TextDrawLetterSize(MusicText[4], 0.500000, 9.599993);
  106. TextDrawColor(MusicText[4], -1);
  107. TextDrawSetOutline(MusicText[4], 0);
  108. TextDrawSetProportional(MusicText[4], 1);
  109. TextDrawSetShadow(MusicText[4], 1);
  110. TextDrawUseBox(MusicText[4], 1);
  111. TextDrawBoxColor(MusicText[4], 255);
  112. TextDrawTextSize(MusicText[4], 362.000000, 0.000000);
  113. TextDrawSetSelectable(MusicText[4], 0);
  114.  
  115. MusicText[5] = TextDrawCreate(478.000000, 248.000000, "~n~");
  116. TextDrawBackgroundColor(MusicText[5], 255);
  117. TextDrawFont(MusicText[5], 1);
  118. TextDrawLetterSize(MusicText[5], 0.500000, 9.599998);
  119. TextDrawColor(MusicText[5], -1);
  120. TextDrawSetOutline(MusicText[5], 0);
  121. TextDrawSetProportional(MusicText[5], 1);
  122. TextDrawSetShadow(MusicText[5], 1);
  123. TextDrawUseBox(MusicText[5], 1);
  124. TextDrawBoxColor(MusicText[5], 100);
  125. TextDrawTextSize(MusicText[5], 143.000000, 0.000000);
  126. TextDrawSetSelectable(MusicText[5], 0);
  127.  
  128. MusicText[6] = TextDrawCreate(156.000000, 141.000000, "Songs");
  129. TextDrawBackgroundColor(MusicText[6], 255);
  130. TextDrawFont(MusicText[6], 3);
  131. TextDrawLetterSize(MusicText[6], 0.509999, 1.200000);
  132. TextDrawColor(MusicText[6], -1);
  133. TextDrawSetOutline(MusicText[6], 1);
  134. TextDrawSetProportional(MusicText[6], 1);
  135. TextDrawSetSelectable(MusicText[6], 0);
  136.  
  137. MusicText[7] = TextDrawCreate(156.000000, 159.000000, Song1);
  138. TextDrawBackgroundColor(MusicText[7], 255);
  139. TextDrawFont(MusicText[7], 2);
  140. TextDrawLetterSize(MusicText[7], 0.400000, 1.300000);
  141. TextDrawColor(MusicText[7], -1);
  142. TextDrawSetOutline(MusicText[7], 0);
  143. TextDrawSetProportional(MusicText[7], 1);
  144. TextDrawSetShadow(MusicText[7], 1);
  145. TextDrawUseBox(MusicText[7], 1);
  146. TextDrawBoxColor(MusicText[7], 0);
  147. TextDrawTextSize(MusicText[7], 357.000000, 10.000000);
  148. TextDrawSetSelectable(MusicText[7], 1);
  149.  
  150. MusicText[8] = TextDrawCreate(156.000000, 172.000000, Song2);
  151. TextDrawBackgroundColor(MusicText[8], 255);
  152. TextDrawFont(MusicText[8], 2);
  153. TextDrawLetterSize(MusicText[8], 0.400000, 1.300000);
  154. TextDrawColor(MusicText[8], -1);
  155. TextDrawSetOutline(MusicText[8], 0);
  156. TextDrawSetProportional(MusicText[8], 1);
  157. TextDrawSetShadow(MusicText[8], 1);
  158. TextDrawUseBox(MusicText[8], 1);
  159. TextDrawBoxColor(MusicText[8], 0);
  160. TextDrawTextSize(MusicText[8], 357.000000, 10.000000);
  161. TextDrawSetSelectable(MusicText[8], 1);
  162.  
  163. MusicText[9] = TextDrawCreate(156.000000, 185.000000, Song3);
  164. TextDrawBackgroundColor(MusicText[9], 255);
  165. TextDrawFont(MusicText[9], 2);
  166. TextDrawLetterSize(MusicText[9], 0.400000, 1.300000);
  167. TextDrawColor(MusicText[9], -1);
  168. TextDrawSetOutline(MusicText[9], 0);
  169. TextDrawSetProportional(MusicText[9], 1);
  170. TextDrawSetShadow(MusicText[9], 1);
  171. TextDrawUseBox(MusicText[9], 1);
  172. TextDrawBoxColor(MusicText[9], 0);
  173. TextDrawTextSize(MusicText[9], 357.000000, 10.000000);
  174. TextDrawSetSelectable(MusicText[9], 1);
  175.  
  176. MusicText[10] = TextDrawCreate(156.000000, 198.000000, Song4);
  177. TextDrawBackgroundColor(MusicText[10], 255);
  178. TextDrawFont(MusicText[10], 2);
  179. TextDrawLetterSize(MusicText[10], 0.400000, 1.300000);
  180. TextDrawColor(MusicText[10], -1);
  181. TextDrawSetOutline(MusicText[10], 0);
  182. TextDrawSetProportional(MusicText[10], 1);
  183. TextDrawSetShadow(MusicText[10], 1);
  184. TextDrawUseBox(MusicText[10], 1);
  185. TextDrawBoxColor(MusicText[10], 0);
  186. TextDrawTextSize(MusicText[10], 357.000000, 10.000000);
  187. TextDrawSetSelectable(MusicText[10], 1);
  188.  
  189. MusicText[11] = TextDrawCreate(156.000000, 210.000000, Song5);
  190. TextDrawBackgroundColor(MusicText[11], 255);
  191. TextDrawFont(MusicText[11], 2);
  192. TextDrawLetterSize(MusicText[11], 0.400000, 1.300000);
  193. TextDrawColor(MusicText[11], -1);
  194. TextDrawSetOutline(MusicText[11], 0);
  195. TextDrawSetProportional(MusicText[11], 1);
  196. TextDrawSetShadow(MusicText[11], 1);
  197. TextDrawUseBox(MusicText[11], 1);
  198. TextDrawBoxColor(MusicText[11], 0);
  199. TextDrawTextSize(MusicText[11], 357.000000, 10.000000);
  200. TextDrawSetSelectable(MusicText[11], 1);
  201.  
  202. MusicText[12] = TextDrawCreate(156.000000, 322.000000, "Stop Playing");
  203. TextDrawBackgroundColor(MusicText[12], 255);
  204. TextDrawFont(MusicText[12], 3);
  205. TextDrawLetterSize(MusicText[12], 0.500000, 1.200000);
  206. TextDrawColor(MusicText[12], -16776961);
  207. TextDrawSetOutline(MusicText[12], 1);
  208. TextDrawSetProportional(MusicText[12], 1);
  209. TextDrawUseBox(MusicText[12], 1);
  210. TextDrawBoxColor(MusicText[12], 0);
  211. TextDrawTextSize(MusicText[12], 268.000000, 10.000000);
  212. TextDrawSetSelectable(MusicText[12], 1);
  213.  
  214. MusicText[13] = TextDrawCreate(456.000000, 117.000000, "ld_chat:thumbdn");
  215. TextDrawBackgroundColor(MusicText[13], 255);
  216. TextDrawFont(MusicText[13], 4);
  217. TextDrawLetterSize(MusicText[13], 0.500000, 1.000000);
  218. TextDrawColor(MusicText[13], -1);
  219. TextDrawSetOutline(MusicText[13], 0);
  220. TextDrawSetProportional(MusicText[13], 1);
  221. TextDrawSetShadow(MusicText[13], 1);
  222. TextDrawUseBox(MusicText[13], 1);
  223. TextDrawBoxColor(MusicText[13], 255);
  224. TextDrawTextSize(MusicText[13], 18.000000, 19.000000);
  225. TextDrawSetSelectable(MusicText[13], 1);
  226.  
  227. MusicText[14] = TextDrawCreate(371.000000, 141.000000, "loadsc2:loadsc2");
  228. TextDrawBackgroundColor(MusicText[14], 255);
  229. TextDrawFont(MusicText[14], 4);
  230. TextDrawLetterSize(MusicText[14], 0.500000, 1.000000);
  231. TextDrawColor(MusicText[14], -1);
  232. TextDrawSetOutline(MusicText[14], 0);
  233. TextDrawSetProportional(MusicText[14], 1);
  234. TextDrawSetShadow(MusicText[14], 1);
  235. TextDrawUseBox(MusicText[14], 1);
  236. TextDrawBoxColor(MusicText[14], 255);
  237. TextDrawTextSize(MusicText[14], 98.000000, 82.000000);
  238.  
  239. MusicText[15] = TextDrawCreate(374.000000, 197.000000, "~w~By ~n~~r~K~w~ick_~r~A~w~ss");//don't remove this textdraw
  240. TextDrawBackgroundColor(MusicText[15], 255);
  241. TextDrawFont(MusicText[15], 3);
  242. TextDrawLetterSize(MusicText[15], 0.490000, 1.200000);
  243. TextDrawColor(MusicText[15], -1);
  244. TextDrawSetOutline(MusicText[15], 1);
  245. TextDrawSetProportional(MusicText[15], 1);
  246.  
  247. MusicText[16] = TextDrawCreate(10.000000, 118.000000, "New Textdraw");
  248. TextDrawBackgroundColor(MusicText[16], 0);
  249. TextDrawFont(MusicText[16], 5);
  250. TextDrawLetterSize(MusicText[16], 0.500000, 1.000000);
  251. TextDrawColor(MusicText[16], -1);
  252. TextDrawSetOutline(MusicText[16], 0);
  253. TextDrawSetProportional(MusicText[16], 1);
  254. TextDrawSetShadow(MusicText[16], 1);
  255. TextDrawUseBox(MusicText[16], 1);
  256. TextDrawBoxColor(MusicText[16], 255);
  257. TextDrawTextSize(MusicText[16], 230.000000, 247.000000);
  258. TextDrawSetPreviewModel(MusicText[16], 3);
  259. TextDrawSetPreviewRot(MusicText[16], -16.000000, 0.000000, 20.000000, 1.000000);
  260. TextDrawSetSelectable(MusicText[16], 0);
  261.  
  262. return 1;
  263. }
  264. //=============================================================
  265. //=============================================================
  266. public OnFilterScriptExit()
  267. {
  268. for(new i = 0; i < 17; i++)
  269. {
  270. TextDrawHideForAll(MusicText[i]);
  271. TextDrawDestroy(MusicText[i]);
  272. }
  273. return 1;
  274. }
  275. //=============================================================
  276. //=============================================================
  277. public OnPlayerConnect(playerid)
  278. {
  279. Discription[playerid] = CreatePlayerTextDraw(playerid, 156.000000, 256.000000, "No description available.");
  280. PlayerTextDrawBackgroundColor(playerid, Discription[playerid], 255);
  281. PlayerTextDrawFont(playerid, Discription[playerid], 2);
  282. PlayerTextDrawLetterSize(playerid, Discription[playerid], 0.400000, 1.300000);
  283. PlayerTextDrawColor(playerid, Discription[playerid], -1);
  284. PlayerTextDrawSetOutline(playerid, Discription[playerid], 0);
  285. PlayerTextDrawSetProportional(playerid, Discription[playerid], 1);
  286. PlayerTextDrawSetShadow(playerid, Discription[playerid], 1);
  287. return 1;
  288. }
  289. //=============================================================
  290. //=============================================================
  291. public OnPlayerDisconnect(playerid, reason)
  292. {
  293. PlayerTextDrawHide(playerid, Discription[playerid]);
  294. PlayerTextDrawDestroy(playerid, Discription[playerid]);
  295. return 1;
  296. }
  297. //=============================================================
  298. //=============================================================
  299. public OnPlayerSpawn(playerid)
  300. {
  301. return 1;
  302. }
  303. //=============================================================
  304. //=============================================================
  305. CMD:music(playerid, params[])
  306. {
  307. for(new i = 0; i < 17; i++)
  308. {
  309. TextDrawShowForPlayer(playerid, MusicText[i]);
  310. }
  311. PlayerTextDrawShow(playerid, Discription[playerid]);
  312. PlayerTextDrawSetString(playerid, Discription[playerid], "No description available.");
  313. SelectTextDraw(playerid, 0x00FF00FF); // Highlight green when hovering over
  314. return 1;
  315. }
  316. //=============================================================
  317. //=============================================================
  318. public OnPlayerClickTextDraw(playerid, Text:clickedid)
  319. {
  320. if(clickedid == MusicText[7])//song 1
  321. {
  322. PlayAudioStreamForPlayer(playerid, Song1URL);
  323. PlayerTextDrawSetString(playerid, Discription[playerid], Song1Info);
  324. return 1;
  325. }
  326. else if(clickedid == MusicText[8])//song 2
  327. {
  328. PlayAudioStreamForPlayer(playerid, Song2URL);
  329. PlayerTextDrawSetString(playerid, Discription[playerid], Song2Info);
  330. return 1;
  331. }
  332. else if(clickedid == MusicText[9])//song 3
  333. {
  334. PlayAudioStreamForPlayer(playerid, Song3URL);
  335. PlayerTextDrawSetString(playerid, Discription[playerid], Song3Info);
  336. return 1;
  337. }
  338. else if(clickedid == MusicText[10])//song 4
  339. {
  340. PlayAudioStreamForPlayer(playerid, Song4URL);
  341. PlayerTextDrawSetString(playerid, Discription[playerid], Song4Info);
  342. return 1;
  343. }
  344. else if(clickedid == MusicText[11])//song 5
  345. {
  346. PlayAudioStreamForPlayer(playerid, Song5URL);
  347. PlayerTextDrawSetString(playerid, Discription[playerid], Song5Info);
  348. return 1;
  349. }
  350. else if(clickedid == MusicText[12])//"Stop Playing" Button
  351. {
  352. StopAudioStreamForPlayer(playerid);
  353. SendClientMessage(playerid, -1, "Playback Stopped.");
  354. return 1;
  355. }
  356. else if(clickedid == MusicText[13])//"x"(close) button
  357. {
  358. for(new i = 0; i < 17; i++)
  359. {
  360. TextDrawHideForPlayer(playerid, MusicText[i]);
  361. }
  362. PlayerTextDrawHide(playerid, Discription[playerid]);
  363. CancelSelectTextDraw(playerid);
  364. return 1;
  365. }
  366. return 1;
  367. }
  368. //=============================================================
  369. //=============================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement