Advertisement
Guest User

Dialog Music System By RandomDude

a guest
Apr 21st, 2013
521
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.42 KB | None | 0 0
  1. /*==============================================================================
  2. | Music System By RandomDude. |
  3. | Keep My Credits |
  4. | Enjoy! |
  5. | LOL |
  6. ==============================================================================*/
  7. #include <a_samp>
  8. #include <zcmd>
  9.  
  10. #define ORANGE 0xFF9933AA
  11. #define Dialog_Music 123
  12. #define Dialog_WizKhalifa 145
  13.  
  14. #if defined FILTERSCRIPT
  15.  
  16.  
  17. public OnFilterScriptInit()
  18. {
  19. print("\n--------------------------------------");
  20. print("Music System By RandomDude.");
  21. print("--------------------------------------\n");
  22. return 1;
  23. }
  24.  
  25. public OnFilterScriptExit()
  26. {
  27. return 1;
  28. }
  29.  
  30. #else
  31.  
  32. main()
  33. {
  34. print("\n----------------------------------");
  35. print(" Blank Gamemode by your name here");
  36. print("----------------------------------\n");
  37. }
  38.  
  39. #endif
  40. public OnPlayerRequestClass(playerid, classid)
  41. {
  42. SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  43. SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  44. SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  45. return 1;
  46. }
  47.  
  48. public OnPlayerConnect(playerid)
  49. {
  50. return 1;
  51. }
  52.  
  53. public OnPlayerDisconnect(playerid, reason)
  54. {
  55. return 1;
  56. }
  57.  
  58. public OnPlayerSpawn(playerid)
  59. {
  60. return 1;
  61. }
  62.  
  63. public OnPlayerDeath(playerid, killerid, reason)
  64. {
  65. return 1;
  66. }
  67. public OnPlayerText(playerid, text[])
  68. {
  69. return 1;
  70. }
  71. CMD:music(playerid,params[])
  72. {
  73. ShowPlayerDialog(playerid,Dialog_Music,2,"Music [FS] By RandomDude.","Wiz Khalifa\nLiL Wayne\nRick Ross\nWale\n50 Cent\nTupac Shakur","Okay","Cancel");
  74. return 1;
  75. }
  76. CMD:stopmusic(playerid,params[])
  77. {
  78. YoutubeStopStreamForPlayer(playerid);
  79. return 1;
  80. }
  81. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  82. {
  83. if(dialogid == Dialog_Music)
  84. {
  85. if(response)
  86. {
  87. if(listitem==0)
  88. {
  89. ShowPlayerDialog(playerid,Dialog_WizKhalifa,2,"Music Thats By Wiz Khalifa"," Let It Go\nBlack And Yellow\nRoll Up\nWork Hard Play Hard\nWild and Free\nOn My Level","Okay","Cancel");
  90. }
  91. }
  92. }
  93. if(dialogid == Dialog_WizKhalifa)
  94. {
  95. if(response)
  96. {
  97. if(listitem==0)
  98. {
  99. YoutubeStreamForPlayer(playerid,"http://www.youtube.com/watch?v=IJn-EHd7VeU");
  100. SendClientMessage(playerid,ORANGE,"Please wait a few seconds if your track does not turn on.");
  101. }
  102. if(listitem==1)
  103. {
  104. YoutubeStreamForPlayer(playerid,"http://www.youtube.com/watch?v=UePtoxDhJSw");
  105. SendClientMessage(playerid,ORANGE,"Please wait a few seconds if your track does not turn on.");
  106. }
  107. if(listitem==2)
  108. {
  109. YoutubeStreamForPlayer(playerid,"http://www.youtube.com/watch?v=UhQz-0QVmQ0");
  110. SendClientMessage(playerid,ORANGE,"Please wait a few seconds if your track does not turn on.");
  111. }
  112. if(listitem==3)
  113. {
  114. YoutubeStreamForPlayer(playerid,"http://www.youtube.com/watch?v=TWHNr0BrNgo");
  115. SendClientMessage(playerid,ORANGE,"Please wait a few seconds if your track does not turn on.");
  116. }
  117. if(listitem==4)
  118. {
  119. YoutubeStreamForPlayer(playerid,"http://www.youtube.com/watch?v=Wa5B22KAkEk");
  120. SendClientMessage(playerid,ORANGE,"Please wait a few seconds if your track does not turn on.");
  121. }
  122. if(listitem==5)
  123. {
  124. YoutubeStreamForPlayer(playerid,"http://www.youtube.com/watch?v=hmP7TYtDVUU");
  125. SendClientMessage(playerid,ORANGE,"Please wait a few seconds if your track does not turn on.");
  126. }
  127. }
  128. }
  129. return 1;
  130. }
  131. stock YoutubeStreamForPlayer(playerid, vlink[])
  132. {
  133. new videoid[128], mp3link[128];
  134. strmid(videoid,vlink,strfind(vlink,"v=")+2,strfind(vlink,"v=")+15);
  135. format(mp3link, 128, "http://mwrserver.com/youtube.php?videoid=%s", videoid);
  136. PlayAudioStreamForPlayer(playerid,mp3link);
  137. return 1;
  138. }
  139. stock YoutubeStreamForAll(vlink[])
  140. {
  141. new videoid[128], mp3link[128];
  142. strmid(videoid,vlink,strfind(vlink,"v=")+2,strfind(vlink,"v=")+15);
  143. format(mp3link, 128, "http://mwrserver.com/youtube.php?videoid=%s", videoid);
  144. for(new i=0;i<MAX_PLAYERS;i++) PlayAudioStreamForPlayer(i,mp3link);
  145. return 1;
  146. }
  147. stock YoutubeStopStreamForAll()
  148. {
  149. for(new i=0;i<MAX_PLAYERS;i++) StopAudioStreamForPlayer(i);
  150. return 1;
  151. }
  152. stock YoutubeStopStreamForPlayer(playerid)
  153. {
  154. StopAudioStreamForPlayer(playerid);
  155. return 1;
  156. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement