Advertisement
ejdrienxd

Untitled

Nov 21st, 2019
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.78 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <dhudmessage>
  4.  
  5. #define PLUGIN "Spreeeee!"
  6. #define VERSION "0.07"
  7. #define AUTHOR "R3X"
  8. #define MAX_PLAYERS 32
  9.  
  10. new g_points[MAX_PLAYERS+1][2];
  11. new g_pointsThisRound[MAX_PLAYERS+1][2];
  12. new g_cvarEndShow;
  13.  
  14. public plugin_init(){
  15. register_plugin(PLUGIN, VERSION, AUTHOR);
  16. register_event("DeathMsg","onDeath","a");
  17. register_event("TextMsg", "resetAll", "a", "2&#Game_will_restart_in" );
  18. register_event("TextMsg", "resetAll", "a", "2&#Game_C");
  19. register_logevent("onEndRound", 2, "1=Round_End")
  20. register_logevent("resetAllThisRound", 2, "1=Round_Start")
  21. g_cvarEndShow=register_cvar("amx_endshow","1");
  22. #if defined DEBUG
  23. register_concmd("show_points","cmd_show_points",ADMIN_KICK);
  24. #endif
  25. }
  26. reset(id){
  27. g_points[id][0]=0;
  28. g_points[id][1]=0;
  29. }
  30. resetRound(id){
  31. g_pointsThisRound[id][0]=0;
  32. g_pointsThisRound[id][1]=0;
  33. }
  34. public resetAllThisRound(){
  35. for(new i=0;i<=MAX_PLAYERS;i++)
  36. {
  37. if(is_user_hltv(i))
  38. continue;
  39.  
  40. if(!is_user_connected(i))
  41. continue;
  42.  
  43. resetRound(i);
  44. }
  45. }
  46. public resetAll(){
  47. for(new i=0;i<=MAX_PLAYERS;i++)
  48. {
  49. if(is_user_hltv(i))
  50. continue;
  51.  
  52. if(!is_user_connected(i))
  53. continue;
  54.  
  55. reset(i);
  56. }
  57. }
  58. public onEndRound(){
  59. if(get_pcvar_num(g_cvarEndShow))
  60. set_task(0.3,"podsumowanie");
  61. }
  62. public podsumowanie()
  63. {
  64. new bool:double=false;
  65. new id=0;
  66. for(new i=1;i<=MAX_PLAYERS;i++)
  67. {
  68. if(is_user_hltv(i))
  69. continue;
  70.  
  71. if(!is_user_connected(i))
  72. continue;
  73.  
  74. if(g_pointsThisRound[id][0]==g_pointsThisRound[i][0]){
  75. if(g_pointsThisRound[id][1] == g_pointsThisRound[i][1]){
  76. double=true;
  77. }
  78. else if(g_pointsThisRound[id][1] < g_pointsThisRound[i][1]){
  79. id=i;
  80. double=false;
  81. }
  82. }
  83. else if(g_pointsThisRound[id][0] < g_pointsThisRound[i][0]){
  84. id=i;
  85. double=false;
  86. }
  87. }
  88.  
  89. if(!double && id)
  90. {
  91. new szNick[33];
  92. get_user_name(id,szNick,32);
  93. set_dhudmessage(0, 255, 0, -1.0, 0.2, 0, 5.0, 5.0, 0.8, 0.1);
  94.  
  95. for(new i=0; i < 33; i++)
  96. if(is_user_connected(i))
  97. if(!is_user_hltv(i))
  98. show_dhudmessage(i, "[MVP]^x01 Zdobyl %s majac %d zabic w tym %d HS",szNick,g_pointsThisRound[id][0],g_pointsThisRound[id][1]);
  99. }
  100. }
  101. public client_putinserver(id){
  102. reset(id);
  103. resetRound(id);
  104. }
  105. public client_disconnect(id){
  106. reset(id);
  107. resetRound(id);
  108. }
  109. public onDeath(){
  110. new kid=read_data(1);
  111. new vid=read_data(2);
  112.  
  113. if(is_user_hltv(kid))
  114. return PLUGIN_HANDLED;
  115.  
  116. if(is_user_hltv(vid))
  117. return PLUGIN_HANDLED;
  118.  
  119. if(!is_user_connected(kid)){
  120. reset(vid);
  121. return PLUGIN_CONTINUE;
  122. }
  123. g_points[kid][0]++;
  124. g_pointsThisRound[kid][0]++;
  125.  
  126. if(read_data(3)){
  127. g_points[kid][1]++;
  128. g_pointsThisRound[kid][1]++;
  129. }
  130. reset(vid);
  131. return PLUGIN_CONTINUE;
  132. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement