Advertisement
Guest User

Untitled

a guest
Feb 13th, 2023
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.00 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <csx>
  4. #include <colorchat>
  5.  
  6. #define PLUGIN "Stats:BZP"
  7. #define VERSION "1.0"
  8. #define AUTHOR "Boski Z Polski"
  9.  
  10. public plugin_init()
  11. {
  12. #define FORUM_S "PsychaSiada.pl"
  13. #define SERWER_IP "54.38.141.242:27015"
  14. new g_miesiac[3];
  15. get_time("%m",g_miesiac, charsmax(g_miesiac));
  16. new MIESIAC = str_to_num(g_miesiac);
  17.  
  18. register_plugin(PLUGIN, VERSION, AUTHOR);
  19.  
  20. register_clcmd("say", "top_wlasna");
  21. register_clcmd("say /ostatni", "top_last");
  22. register_clcmd("say /topme", "topme_rank");
  23. register_clcmd("say /rank", "rank_gracza");
  24. register_clcmd("say /rankstats", "rankstats_gracza");
  25. register_clcmd("say /me", "runda_gracza");
  26. }
  27.  
  28. public top_wlasna(id)
  29. {
  30. motd(id);
  31. motd_gracza(id);
  32. }
  33.  
  34. public motd(id)
  35. {
  36. new g_slowa[32];
  37. read_args(g_slowa, charsmax(g_slowa))
  38. remove_quotes(g_slowa);
  39.  
  40. if(contain(g_slowa, "/top") != -1)
  41. {
  42. if(contain(g_slowa, "monety") != -1)
  43. {
  44. return PLUGIN_CONTINUE;
  45. }
  46.  
  47. replace(g_slowa, charsmax(g_slowa), "/top", "");
  48. new liczba = str_to_num(g_slowa);
  49.  
  50. if(liczba <= 0 || liczba > get_statsnum())
  51. {
  52. return PLUGIN_CONTINUE;
  53. }
  54.  
  55. if(liczba <= 15)
  56. {
  57. top_rank(id);
  58. }
  59. else
  60. {
  61. pokaz_wlasne_motd(id, liczba);
  62. }
  63. }
  64. return PLUGIN_CONTINUE;
  65. }
  66.  
  67. public motd_gracza(id)
  68. {
  69. new g_slowa[32];
  70. read_args(g_slowa, charsmax(g_slowa))
  71. remove_quotes(g_slowa);
  72.  
  73. if(contain(g_slowa, "/tops") != -1)
  74. {
  75. if(contain(g_slowa, "monety") != -1)
  76. {
  77. return PLUGIN_CONTINUE;
  78. }
  79.  
  80. replace(g_slowa, charsmax(g_slowa), "/tops", "");
  81. new liczba = str_to_num(g_slowa);
  82.  
  83. if(liczba <= 0 || liczba > get_statsnum())
  84. {
  85. return PLUGIN_CONTINUE;
  86. }
  87.  
  88. w_motd(id, liczba);
  89. }
  90. return PLUGIN_CONTINUE;
  91. }
  92.  
  93. public w_motd(id, liczba)
  94. {
  95. #define g_Buffer 2536
  96.  
  97. new name[33];
  98. new stats[8];
  99. new bodyhits[8];
  100. new rank = get_stats(liczba - 1, stats, bodyhits, name, charsmax(name));
  101.  
  102. new Data[g_Buffer];
  103. new Len;
  104. const giMax = sizeof Data;
  105. Len = formatex(Data[Len], giMax - Len, "<body background=^"https://i.imgur.com/Kq87nof.jpg^"></body>");
  106. Len = formatex(Data[Len], giMax - Len, "<font color=^"aqua^"><br><center><font size=^"3^">RankStats:</b><br><br>");
  107. Len += formatex(Data[Len], giMax - Len,"<font color=^"aqua^"><br><b>Nick: ^"%s^"</b><font color=^"auqa^">", name);
  108.  
  109. Len += formatex(Data[Len], giMax - Len,"<br><font color=^"aqua^"><b>Pozycja w rankingu: ^"%d/%d^"</b>",rank, get_statsnum());
  110. Len += formatex(Data[Len], giMax - Len,"<br><font color=^"aqua^"><b></b>")
  111. Len += formatex(Data[Len], giMax - Len,"<br><font color=^"aqua^"><b>Zabojstwa: ^"%i^"</b>",stats[0]);
  112. Len += formatex(Data[Len], giMax - Len,"<br><font color=^"aqua^"><b>Zabojstwa HS: ^"%i^"</b>",stats[2]);
  113. Len += formatex(Data[Len], giMax - Len,"<br><font color=^"aqua^"><b>Smierci: ^"%i^"</b>",stats[1]);
  114. Len += formatex(Data[Len], giMax - Len,"<br><font color=^"aqua^"><b>Liczba strzalow: ^"%i^"</b>", stats[4]);
  115. Len += formatex(Data[Len], giMax - Len,"<br><font color=^"aqua^"><b>Liczba celnych strzalow: ^"%i^"</b>", stats[5]);
  116. Len += formatex(Data[Len], giMax - Len,"<br><font color=^"aqua^"><b>Obrazenia: ^"%i^"</b>", stats[6]);
  117. Len += formatex(Data[Len], giMax - Len,"</font></div></body></html>");
  118.  
  119. new nazwa_gracza[128];
  120. formatex(nazwa_gracza, charsmax(nazwa_gracza), "%s", name);
  121. show_motd(id, Data, nazwa_gracza);
  122. }
  123.  
  124. public pokaz_wlasne_motd(id, numer)
  125. {
  126. #define g_Buffer 2536
  127. new Data[g_Buffer];
  128. new Len;
  129. new staty[8];
  130. new trafienia[8];
  131. new name[32];
  132. new rank = numer;
  133.  
  134. Len = formatex(Data[Len], g_Buffer - Len, "<body background=^"https://i.imgur.com/Kq87nof.jpg^"></body>");
  135. Len += formatex(Data[Len], g_Buffer - Len, "<center><table frame=^"border^" width=^"600^" cellspacing=^"0^" bordercolor=#4A4344 style=^"color:#56A5EC;text-align:center;^">");
  136. Len += formatex(Data[Len], g_Buffer - Len, "<tr><td><b><font size=^"3^">TOP%i Serwera</b></td></tr>", rank);
  137.  
  138. for(new i = rank - 1; i < (rank + 14); i++)
  139. {
  140. if(i >= get_statsnum())
  141. {
  142. continue;
  143. }
  144.  
  145. get_stats(i, staty, trafienia, name, charsmax(name));
  146.  
  147. new fragi = staty[0];
  148. new zgony = staty[1];
  149.  
  150. Len += formatex(Data[Len], g_Buffer - Len, "<td>TOP %i %s %i zabojstw - %i zgonow</td>", i + 1, name, fragi, zgony);
  151. Len += formatex(Data[Len], g_Buffer - Len, "</tr>");
  152. }
  153.  
  154. Len += formatex(Data[Len],g_Buffer - Len,"</center></body></html>");
  155.  
  156. new ktory_top[128];
  157. formatex(ktory_top, charsmax(ktory_top), "TOP%i Serwera", rank);
  158. show_motd(id, Data, ktory_top);
  159. }
  160.  
  161. public top_rank(id)
  162. {
  163. #define g_Buffer 2536
  164. new Data[g_Buffer];
  165. new Len;
  166.  
  167. Len = formatex(Data[Len], g_Buffer - Len, "<body background=^"https://i.imgur.com/Kq87nof.jpg^"></body>");
  168. Len += formatex(Data[Len], g_Buffer - Len, "<center><table frame=^"border^" width=^"600^" cellspacing=^"0^" bordercolor=#4A4344 style=^"color:#56A5EC;text-align:center;^">");
  169. Len += formatex(Data[Len], g_Buffer - Len, "<tr><td><b><font size=^"3^">TOP15 Serwera</b></td></tr>");
  170.  
  171. for(new i = 0; i < 15; i++)
  172. {
  173. new staty[8], trafienia[8], name[32];
  174. get_stats(i, staty, trafienia, name, charsmax(name));
  175.  
  176. new fragi = staty[0];
  177. new zgony = staty[1];
  178.  
  179. Len += formatex(Data[Len], g_Buffer - Len, "<td>TOP %i %s %i zabojstw - %i zgonow</td>", i + 1, name, fragi, zgony);
  180. Len += formatex(Data[Len], g_Buffer - Len, "</tr>");
  181. }
  182.  
  183. Len += formatex(Data[Len],g_Buffer - Len,"</center></body></html>");
  184.  
  185. show_motd(id, Data, "TOP15 Serwera");
  186. }
  187.  
  188. public topme_rank(id)
  189. {
  190. #define g_Buffer 2536
  191. new Data[g_Buffer];
  192. new Len;
  193. new staty[8];
  194. new trafienia[8];
  195. new name[32];
  196. new rank = get_user_stats(id, staty, trafienia);
  197.  
  198. Len = formatex(Data[Len], g_Buffer - Len, "<body background=^"https://i.imgur.com/Kq87nof.jpg^"></body>");
  199. Len += formatex(Data[Len], g_Buffer - Len, "<center><table frame=^"border^" width=^"600^" cellspacing=^"0^" bordercolor=#4A4344 style=^"color:#56A5EC;text-align:center;^">");
  200. Len += formatex(Data[Len], g_Buffer - Len, "<tr><td><b><font size=^"3^">TOP%i Serwera</b></td></tr>", rank);
  201.  
  202. for(new i = rank - 1; i < (rank + 14); i++)
  203. {
  204. if(i >= get_statsnum())
  205. {
  206. continue;
  207. }
  208.  
  209. get_stats(i, staty, trafienia, name, charsmax(name));
  210.  
  211. new fragi = staty[0];
  212. new zgony = staty[1];
  213.  
  214. Len += formatex(Data[Len], g_Buffer - Len, "<td>TOP %i %s %i zabojstw - %i zgonow</td>", i + 1, name, fragi, zgony);
  215. Len += formatex(Data[Len], g_Buffer - Len, "</tr>");
  216. }
  217.  
  218. Len += formatex(Data[Len],g_Buffer - Len,"</center></body></html>");
  219.  
  220. new ktory_top[128];
  221. formatex(ktory_top, charsmax(ktory_top), "TOP%i Serwera", rank);
  222. show_motd(id, Data, ktory_top);
  223. }
  224.  
  225. public top_last(id)
  226. {
  227. #define g_Buffer 2536
  228. new Data[g_Buffer];
  229. new Len;
  230. new staty[8];
  231. new trafienia[8];
  232. new name[32];
  233. new rank = get_statsnum();
  234.  
  235. Len = formatex(Data[Len], g_Buffer - Len, "<body background=^"https://i.imgur.com/Kq87nof.jpg^"></body>");
  236. Len += formatex(Data[Len], g_Buffer - Len, "<center><table frame=^"border^" width=^"600^" cellspacing=^"0^" bordercolor=#4A4344 style=^"color:#56A5EC;text-align:center;^">");
  237. Len += formatex(Data[Len], g_Buffer - Len, "<tr><td><b><font size=^"3^">TOP%i Serwera</b></td></tr>", rank);
  238.  
  239. get_stats(get_statsnum() - 1, staty, trafienia, name, charsmax(name));
  240.  
  241. new fragi = staty[0];
  242. new zgony = staty[1];
  243.  
  244. Len += formatex(Data[Len], g_Buffer - Len, "<td>TOP %i %s %i zabojstw - %i zgonow</td>", get_statsnum(), name, fragi, zgony);
  245. Len += formatex(Data[Len], g_Buffer - Len, "</tr>");
  246.  
  247. Len += formatex(Data[Len],g_Buffer - Len,"</center></body></html>");
  248.  
  249. new ktory_top[128];
  250. formatex(ktory_top, charsmax(ktory_top), "TOP%i Serwera", rank);
  251. show_motd(id, Data, ktory_top);
  252. }
  253.  
  254. public rank_gracza(id)
  255. {
  256. new stats[8];
  257. new bodyhits[8];
  258. new rank = get_user_stats(id, stats, bodyhits);
  259.  
  260. get_user_stats(id, stats, bodyhits);
  261. new fragi = stats[0];
  262. new zgony = stats[1];
  263.  
  264. ColorChat(id, TEAM_COLOR, "^x04[DD2]^x03 Jestes^x04 %i^x03 w rankingu na^x04 %i^x03 Posiadasz^x04 %i fragow^x03 oraz^x04 %i smierci", rank, get_statsnum(), fragi, zgony);
  265. }
  266.  
  267. public rankstats_gracza(id)
  268. {
  269. #define g_Buffer 2536
  270.  
  271. new name[33];
  272. get_user_name(id, name, charsmax(name));
  273.  
  274. new stats[8];
  275. new bodyhits[8];
  276. get_user_stats(id, stats, bodyhits);
  277. new rank = get_user_stats(id, stats, bodyhits);
  278. new rank_max = get_statsnum() - 1;
  279.  
  280. new Data[g_Buffer];
  281. new Len;
  282. const giMax = sizeof Data;
  283. Len = formatex(Data[Len], giMax - Len, "<body background=^"https://i.imgur.com/Kq87nof.jpg^"></body>");
  284. Len = formatex(Data[Len], giMax - Len, "<font color=^"aqua^"><br><center><font size=^"3^">RankStats:</b><br><br>");
  285. Len += formatex(Data[Len], giMax - Len,"<font color=^"aqua^"><br><b>Nick: ^"%s^"</b><font color=^"auqa^">", name);
  286.  
  287. Len += formatex(Data[Len], giMax - Len,"<br><font color=^"aqua^"><b>Pozycja w rankingu: ^"%d/%d^"</b>",rank,rank_max);
  288. Len += formatex(Data[Len], giMax - Len,"<br><font color=^"aqua^"><b></b>")
  289. Len += formatex(Data[Len], giMax - Len,"<br><font color=^"aqua^"><b>Zabojstwa: ^"%i^"</b>",stats[0]);
  290. Len += formatex(Data[Len], giMax - Len,"<br><font color=^"aqua^"><b>Zabojstwa HS: ^"%i^"</b>",stats[2]);
  291. Len += formatex(Data[Len], giMax - Len,"<br><font color=^"aqua^"><b>Smierci: ^"%i^"</b>",stats[1]);
  292. Len += formatex(Data[Len], giMax - Len,"<br><font color=^"aqua^"><b>Liczba strzalow: ^"%i^"</b>", stats[4]);
  293. Len += formatex(Data[Len], giMax - Len,"<br><font color=^"aqua^"><b>Liczba celnych strzalow: ^"%i^"</b>", stats[5]);
  294. Len += formatex(Data[Len], giMax - Len,"<br><font color=^"aqua^"><b>Obrazenia: ^"%i^"</b>", stats[6]);
  295. Len += formatex(Data[Len], giMax - Len,"</font></div></body></html>");
  296.  
  297. new nazwa_gracza[128];
  298. formatex(nazwa_gracza, charsmax(nazwa_gracza), "%s", name);
  299. show_motd(id, Data, nazwa_gracza);
  300. }
  301.  
  302. public runda_gracza(id)
  303. {
  304. new stats[8], bodyhits[8];
  305. get_user_rstats(id, stats, bodyhits);
  306.  
  307. ColorChat(id, TEAM_COLOR, "^x04[DD2]^x03 Trafiles^x04 %i (%i HS) razy^x03 Zadales^x04 %i obrazen", bodyhits[0], bodyhits[1], stats[6]);
  308. }
  309.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement