seroff

Anti Fast Strafe 10.1 By Proffi+Seroff

Jan 10th, 2017
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <fakemeta>
  3. #include <hamsandwich>
  4. #include <colorchat>
  5.  
  6. new cvarBan_Type, cvarMax_Strafe,Float:FTimeJump[33],Float:FLastJumps[33],StrafeNum[33];
  7.  
  8. public plugin_init()
  9. {
  10. register_plugin("Anti Fast Strafe","10.1","Proffi+Seroff");
  11. cvarBan_Type = register_cvar("Ban_Type", "1");
  12. cvarMax_Strafe = register_cvar("Max_Strafe", "8");
  13. register_forward(FM_CmdStart, "Player_CmdStart");
  14. RegisterHam(Ham_Player_Jump, "player", "Player_Jump",1);
  15. }
  16.  
  17. public Player_Jump(id)
  18. {
  19. if(is_user_alive(id))
  20. {
  21. if(FTimeJump[id] >= get_gametime()) return HAM_IGNORED;
  22. FTimeJump[id] = get_gametime() + 1.0; // 1.0
  23. }
  24. return HAM_IGNORED;
  25. }
  26.  
  27. public Player_CmdStart(id, uc_handle)
  28. {
  29. if(get_cvar_num("Max_Strafe") && is_user_alive(id))
  30. {
  31. if(FTimeJump[id] <= get_gametime()){
  32. return FMRES_IGNORED;
  33. }
  34. else
  35. {
  36. if(pev(id,pev_flags) & (FL_ONGROUND | FL_FLY | FL_FROZEN)) StrafeNum[id] = 0;
  37. static Float:Gametime;Gametime = get_gametime();
  38. if(Gametime > (FLastJumps[id] + 0.3))
  39. {
  40. StrafeNum[id] = 0;
  41. FLastJumps[id] = Gametime;
  42. }
  43. }
  44. if(pev(id,pev_flags) & (FL_ONGROUND | FL_FLY | FL_FROZEN)) StrafeNum[id] = 0;
  45. if(get_pdata_int(id, 247, 5) & (IN_MOVELEFT | IN_MOVERIGHT | IN_FORWARD | IN_BACK) )
  46. {
  47. if( ++StrafeNum[id] >= get_pcvar_num(cvarMax_Strafe))
  48. {
  49. static szIP[32],szName[32];
  50. get_user_ip(id, szIP, charsmax(szIP));
  51. get_user_name(id, szName, charsmax(szName));
  52. user_kill(id,1);
  53. switch(get_pcvar_num(cvarBan_Type))
  54. {
  55. case 0: server_cmd("kick #%d ^"Fast Strafe Detected^"",get_user_userid(id));
  56. case 1: server_cmd("amx_ban 0 %s ^"Fast Strafe Detected^"",szIP);
  57. }
  58. FTimeJump[id] = get_gametime() + 10.0;
  59. ColorChat(0,NORMAL,"^3[Анти-Чит]^1Игрок ^4%s ^1Использует ^1[^4Fast Strafe^1]",szName);
  60. }
  61. }
  62. }
  63. return FMRES_IGNORED;
  64. }
  65.  
  66. public client_putinserver( id ) FTimeJump[id] = 0.0;
Advertisement
Add Comment
Please, Sign In to add comment