seroff

Anti Bhop 1.8 By Seroff

Dec 27th, 2015
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.55 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <fakemeta>
  4. #include <hamsandwich>
  5. #include <colorchat>
  6.  
  7. new Perfect_Jump[33],g_iJumpCount[33],g_iDuckCount[33],GroundFrame[33],War_Bhop[33];
  8.  
  9. public plugin_init()
  10. {
  11. register_plugin("Anti-Bhop","1.8","Seroff");
  12. register_cvar("Check_Bhop", "1")
  13. register_forward(FM_PlayerPreThink, "FM_PlayerPreThink_Pre");
  14. RegisterHam(Ham_Player_Jump, "player", "CPlayer__Jump_Post", .Post = true);
  15.  
  16. }
  17. public CPlayer__Jump_Post(id)
  18. {
  19. if(!is_user_alive(id) || ~pev(id, pev_flags) & FL_ONGROUND || pev(id, pev_oldbuttons) & IN_JUMP) return HAM_IGNORED;
  20.  
  21. static Float:flLastJumpTime[33];//,Float:Gametime;Gametime = get_gametime();
  22. if(get_gametime() - flLastJumpTime[id] < 0.5)
  23. {
  24. Perfect_Jump[id] = 0;
  25. if(War_Bhop[id] >= 3 && War_Bhop[id] <= 5)
  26. War_Bhop[id] -= 1;
  27. }
  28. flLastJumpTime[id] = get_gametime();
  29. return HAM_IGNORED;
  30. }
  31. public FM_PlayerPreThink_Pre(id,uc_handle,seed,admin)
  32. {
  33. if(is_user_alive(id) && is_user_connected(id) && get_cvar_num("Check_Bhop_New"))
  34. {
  35. new szName[32],szIP[32],players[32], pnum;
  36. get_user_name(id, szName, charsmax(szName));
  37. get_user_ip(id, szIP, charsmax(szIP));
  38. get_players(players, pnum, "ch");
  39.  
  40. static buttons,oldbutton,bool:on_ground;
  41. buttons = pev(id, pev_button);
  42. oldbutton = pev(id, pev_oldbuttons);
  43. on_ground = bool:(pev(id, pev_flags) & FL_ONGROUND);
  44.  
  45. if(buttons & IN_JUMP && !(oldbutton & IN_JUMP))
  46. g_iJumpCount[id] += 1;
  47. if(buttons & IN_DUCK && !(oldbutton & IN_DUCK))
  48. g_iDuckCount[id] += 1;
  49.  
  50. if(on_ground)
  51. GroundFrame[id] += 1;
  52.  
  53. else if(GroundFrame[id])
  54. {
  55.  
  56.  
  57. if((GroundFrame[id] >= 1 && GroundFrame[id] <= 5)
  58. && (g_iJumpCount[id] >= 1 && g_iJumpCount[id] <= 5
  59. || g_iJumpCount[id] >= 16))
  60. {
  61. Perfect_Jump[id] += 1;
  62. if(Perfect_Jump[id] >= 3) //6
  63. {
  64. Perfect_Jump[id] = 0;
  65. War_Bhop[id] += 1;
  66. if(War_Bhop[id] >= 6)
  67. {
  68. user_kill(id,1);
  69. War_Bhop[id] = 0;
  70. server_cmd("amx_ban 0 %s ^"Auto Bhop Detected^"",szIP);
  71. ColorChat(0,NORMAL,"^3[Анти-Чит]^1Игрок ^4%s ^1Использует ^1[^4Auto Bhop^1]",szName);
  72. log_to_file("addons/amxmodx/logs/Anti-Bhop.log", "Игрок %s использует Auto Bhop",szName);
  73. }
  74. if(War_Bhop[id] >= 1 && War_Bhop[id] <= 5)
  75. {
  76. for(new i = 0; i < pnum; i++)
  77. {
  78. admin = players[i];
  79. if(get_user_flags(admin) & ADMIN_BAN)
  80. {
  81. ColorChat(admin,NORMAL,"^3[Анти-Чит]^1Игрок ^4%s ^1Использует ^1[^4Auto Bhop %d Warning^1]",szName,War_Bhop[id]);
  82. }
  83. }
  84. }
  85. }
  86. }
  87. else
  88. {
  89. Perfect_Jump[id] = 0;
  90. if(War_Bhop[id] >= 3 && War_Bhop[id] <= 5)
  91. War_Bhop[id] -= 1;
  92. }
  93. GroundFrame[id] = 0;
  94. g_iJumpCount[id] = 0;
  95. g_iDuckCount[id] = 0;
  96. }
  97. }
  98. return FMRES_IGNORED;
  99. }
Advertisement
Add Comment
Please, Sign In to add comment