Guest User

Untitled

a guest
Oct 23rd, 2021
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.06 KB | None | 0 0
  1. //===============================DJ SYSTEM==========================//
  2. // DJ system by PinkPanter (Rossi) //
  3. // Komande: /djh /pustimuziku /ugasimuziku //
  4. // Facebook: Rossi CH //
  5.  
  6. #include <a_samp>
  7. #include <dini>
  8. #include <zcmd>
  9. #include <sscanf2>
  10. #include <foreach>
  11. #define FILE1 "DJ/%s.ini"
  12. #define COLOR_YELLOW 0xFFFF00FF
  13. #define COLOR_WHITE 0xFFFFFFFF
  14. #define COLOR_ORANGE 0xFF9900FF
  15. #define COLOR_RED 0xFF0000FF
  16.  
  17.  
  18. new DJ[MAX_PLAYERS];
  19.  
  20. public OnFilterScriptInit()
  21. {
  22. print("\n==========================");
  23. print(" DJ SYSTEM BY PinkPanter Rossi");
  24. print("============================/n");
  25. return 1;
  26. }
  27.  
  28. public OnFilterScriptExit()
  29. {
  30. return 1;
  31. }
  32. main()
  33. {
  34. }
  35. public OnPlayerConnect(playerid)
  36. {
  37. new file[MAX_PLAYERS];
  38. format(file, sizeof(file), FILE1, IsPlayerName(playerid));
  39. if(!fexist(file))
  40. {
  41. dini_Create(file);
  42. dini_IntSet(file, "DJ", 0);
  43. DJ[playerid] = dini_Int(file, "DJ");
  44. } else {
  45. DJ[playerid] = dini_Int(file, "DJ");
  46. }
  47. return 1;
  48. }
  49. public OnPlayerDisconnect(playerid, reason)
  50. {
  51. new file[MAX_PLAYERS];
  52. format(file, sizeof(file), FILE1, IsPlayerName(playerid));
  53. dini_IntSet(file, "DJ", DJ[playerid]);
  54. DJ[playerid] = 0;
  55. return 1;
  56. }
  57. stock IsPlayerName(playerid)
  58. {
  59. new name[MAX_PLAYER_NAME];
  60. GetPlayerName(playerid, name, sizeof(name));
  61. return name;
  62. }
  63. CMD:djh(playerid, params[])
  64. {
  65. new playername[25];
  66. GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
  67. if(DJ[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "Greska Nisi DJ.");
  68. SendClientMessage(playerid, COLOR_YELLOW, "DJ Komande");
  69. SendClientMessage(playerid, COLOR_WHITE, "/Pustimuziku, /Ugasimuziku, /DJ Chat, /dodajmuziku, /izbisimuziku");
  70. return 1;
  71. }
  72.  
  73. CMD:ugasimuziku(playerid, params[])
  74. {
  75. new playername[25];
  76. GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
  77. if(DJ[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "Greska Nisi DJ.");
  78. GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
  79. for(new i = 0; i < MAX_PLAYERS; i++)
  80. StopAudioStreamForPlayer(i);
  81. SendClientMessageToAll(playerid, "{FFFF00}[DJ]: DJ Staff je ugasio muziku.");
  82. return 1;
  83. }
  84.  
  85. CMD:stoppjesma(playerid, params[])
  86. {
  87. SendClientMessage(playerid, COLOR_WHITE, "Ugasili ste pjesmu");
  88. StopAudioStreamForPlayer(playerid);
  89. return 1;
  90. }
  91.  
  92. CMD:dj(playerid, params[])
  93. {
  94. new Nam[MAX_PLAYERS], message[128], str[256], playername[25];
  95. GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
  96. if(DJ[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "Greska Nisi DJ.");
  97. if(sscanf(params,"s",message)) return SendClientMessage(playerid,COLOR_WHITE,"DJ CHAT: /DJ [Text]");
  98. GetPlayerName(playerid,Nam,sizeof(Nam));
  99. format(str,sizeof(str),"DJ Chat [%s] %s",Nam,message);
  100. for (new a=0;a<MAX_PLAYERS;a++)
  101. {
  102. if (IsPlayerConnected(a))
  103. {
  104. if(DJ[playerid] == 1)
  105. {
  106. SendClientMessage(a, COLOR_ORANGE, str);
  107. }
  108. }
  109. }
  110. return 1;
  111. }
  112.  
  113. CMD:pustimuziku(playerid, params[])
  114. {
  115. new playername[25];
  116. GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
  117. if(DJ[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "Greska nisi DJ.");
  118. if(sscanf(params, "s[200]", params)) return SendClientMessage(playerid, -1, "Koristi: /pustimuziku [Link pjesme]");
  119. SendClientMessageToAll(playerid, "{FFFF00}[DJ]: DJ Je pustio muziku. /stoppjesma da ugasis");
  120. foreach(Player, i)
  121. {
  122. PlayAudioStreamForPlayer(i, params);
  123. }
  124. return 1;
  125. }
  126. CMD:postavidja(playerid, params[])
  127. {
  128. if(IsPlayerAdmin(playerid))
  129. {
  130. new string[MAX_PLAYERS], targetid, license;
  131. if(sscanf(params, "ud", targetid, license)) return SendClientMessage(playerid, -1, "{FF9900}Koristi: /postavidj [Nick] [1- da postavite 0 - da skinete]");
  132. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1, "{FF9900}Greska: Igrac nije na serveru!");
  133. if(license == 1)
  134. {
  135. DJ[targetid] = 1;
  136. format(string, sizeof(string), "{FFFFFF}[PinkPanter]:{6EF83C} Postavili ste {FFFFFF}%s{6EF83C} za DJ-a", IsPlayerName(targetid));
  137. SendClientMessage(playerid, -1, string);
  138. format(string, sizeof(string), "{FFFFFF}[PinkPanter]:{6EF83C} Admin {FFFFFF}%s{6EF83C} vam je dao DJ-a!");
  139. SendClientMessage(targetid, -1, string);
  140. } else {
  141. DJ[targetid] = 0;
  142. format(string, sizeof(string), "{FFFF00}Uklonili ste %s DJa.", IsPlayerName(targetid));
  143. SendClientMessage(playerid, -1, string);
  144. format(string, sizeof(string), "{FFFF00}Admin vam je uklonio DJa.");
  145. SendClientMessage(targetid, -1, string);
  146. }
  147.  
  148. }
  149. return 1;
  150. }
Advertisement
Add Comment
Please, Sign In to add comment