Advertisement
Guest User

Untitled

a guest
Nov 14th, 2012
1,189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.27 KB | None | 0 0
  1. #include <a_samp>
  2. #include <zcmd>
  3. #include <foreach>
  4.  
  5.  
  6. #define D_MUSIC 1
  7. #define D_MFORALL 2
  8. #define D_MFORSELF 3
  9. #define D_MPOS 4
  10. #define D_MPOS1 5
  11. #define D_MFORP 6
  12. #define D_MFORP1 7
  13. #define D_MFORALL1 8
  14. #define D_MFORP2 9
  15.  
  16. #define SPD ShowPlayerDialog
  17. new link[255];
  18. new link1[255];
  19.  
  20. main() {return 1;}
  21.  
  22.  
  23.  
  24. public OnPlayerCommandPerformed(playerid, cmdtext[], success)
  25. {
  26. return 1;
  27. }
  28.  
  29. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  30. {
  31. new string[128];
  32.  
  33. if(dialogid == D_MFORP2)
  34. {
  35. if(response)
  36. {
  37. new igr = strval(inputtext);
  38. if(igr != INVALID_PLAYER_ID)
  39. {
  40. StopAudioStreamForPlayer(igr);
  41. }
  42. }
  43. }
  44.  
  45. if(dialogid == D_MFORALL1)
  46. {
  47. foreach(Player, i)
  48. {
  49. StopAudioStreamForPlayer(i);
  50. }
  51. }
  52.  
  53. if(dialogid == D_MFORP1)
  54. {
  55. if(response)
  56. {
  57. new igr = strval(inputtext);
  58. if(igr != INVALID_PLAYER_ID)
  59. {
  60. format(string, sizeof(string), "%s", link1);
  61. PlayAudioStreamForPlayer(igr, string);
  62. }
  63. }
  64. }
  65.  
  66. if(dialogid == D_MFORP)
  67. {
  68. if(response)
  69. {
  70. SPD(playerid, D_MFORP1, DIALOG_STYLE_INPUT, "For player", "Type the ID of the player.", "Select", "Cancel");
  71. strmid(link1,inputtext, 0, strlen(inputtext), 255);
  72. }
  73. }
  74.  
  75. if(dialogid == D_MPOS1)
  76. {
  77. new radius = strlen(inputtext);
  78. new Float:X, Float:Y, Float:Z;
  79. GetPlayerPos(playerid, X, Y, Z);
  80. format(string, sizeof(string), "%s", link);
  81. PlayAudioStreamForPlayer(playerid, string, X, Y, Z, radius, 1);
  82. }
  83.  
  84. if(dialogid == D_MPOS)
  85. {
  86. strmid(link,inputtext, 0, strlen(inputtext), 255);
  87. SPD(playerid, D_MPOS1, DIALOG_STYLE_INPUT, "Position", "Enter the radius in the blank.", "Select", "Cancel");
  88. }
  89.  
  90. if(dialogid == D_MFORSELF)
  91. {
  92. format(string, sizeof(string), "%s", inputtext);
  93. PlayAudioStreamForPlayer(playerid, string);
  94. }
  95.  
  96. if(dialogid == D_MFORALL)
  97. {
  98. foreach(Player, i)
  99. {
  100. format(string, sizeof(string), "%s", inputtext);
  101. PlayAudioStreamForPlayer(i, string);
  102. }
  103. }
  104.  
  105. if(dialogid == D_MUSIC)
  106. {
  107. if(response)
  108. {
  109. if(listitem == 0)
  110. {
  111. SPD(playerid, D_MFORALL, DIALOG_STYLE_INPUT, "For all players", "Paste the link of the song, it must be .mp3 !", "Select", "Cancel");
  112. }
  113. if(listitem == 1)
  114. {
  115. SPD(playerid, D_MFORSELF, DIALOG_STYLE_INPUT, "For yourself", "Paste the link of the song, it must be .mp3 !", "Select", "Cancel");
  116. }
  117. if(listitem == 2)
  118. {
  119. SPD(playerid, D_MPOS, DIALOG_STYLE_INPUT, "Position (radius)", "Paste the link of the song, it must be .mp3 !", "Select", "Cancel");
  120. }
  121. if(listitem == 3)
  122. {
  123. SPD(playerid, D_MFORP, DIALOG_STYLE_INPUT, "For player", "Paste the link of the song, it must be .mp3 !", "Select", "Cancel");
  124. }
  125. if(listitem == 4)
  126. {
  127. SPD(playerid, D_MFORALL1, DIALOG_STYLE_MSGBOX, "For everyone", "Choose 'Yes' if you want to stop, or choose 'No' co cancel.", "Yes", "No");
  128. }
  129. if(listitem == 5)
  130. {
  131. SPD(playerid, D_MFORP2, DIALOG_STYLE_INPUT, "For player", "Type the ID of player you want to stop audio stream.", "Yes", "No");
  132. }
  133. }
  134. }
  135. return 0;
  136. }
  137.  
  138. CMD:music(playerid, params[])
  139. {
  140. SPD(playerid, D_MUSIC, DIALOG_STYLE_LIST, "Choose", "For all players\nYourself\nSome position\nFor player\nStop everyone\nStop for player", "Select", "Cancel");
  141. return 1;
  142. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement