Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <fakemeta>
- #include <hamsandwich>
- #include <colorchat>
- new cvarBan_Type, cvarMax_Strafe,Float:FTimeJump[33],Float:FLastJumps[33],StrafeNum[33];
- public plugin_init()
- {
- register_plugin("Anti Fast Strafe","10.1","Proffi+Seroff");
- cvarBan_Type = register_cvar("Ban_Type", "1");
- cvarMax_Strafe = register_cvar("Max_Strafe", "8");
- register_forward(FM_CmdStart, "Player_CmdStart");
- RegisterHam(Ham_Player_Jump, "player", "Player_Jump",1);
- }
- public Player_Jump(id)
- {
- if(is_user_alive(id))
- {
- if(FTimeJump[id] >= get_gametime()) return HAM_IGNORED;
- FTimeJump[id] = get_gametime() + 1.0; // 1.0
- }
- return HAM_IGNORED;
- }
- public Player_CmdStart(id, uc_handle)
- {
- if(get_cvar_num("Max_Strafe") && is_user_alive(id))
- {
- if(FTimeJump[id] <= get_gametime()){
- return FMRES_IGNORED;
- }
- else
- {
- if(pev(id,pev_flags) & (FL_ONGROUND | FL_FLY | FL_FROZEN)) StrafeNum[id] = 0;
- static Float:Gametime;Gametime = get_gametime();
- if(Gametime > (FLastJumps[id] + 0.3))
- {
- StrafeNum[id] = 0;
- FLastJumps[id] = Gametime;
- }
- }
- if(pev(id,pev_flags) & (FL_ONGROUND | FL_FLY | FL_FROZEN)) StrafeNum[id] = 0;
- if(get_pdata_int(id, 247, 5) & (IN_MOVELEFT | IN_MOVERIGHT | IN_FORWARD | IN_BACK) )
- {
- if( ++StrafeNum[id] >= get_pcvar_num(cvarMax_Strafe))
- {
- static szIP[32],szName[32];
- get_user_ip(id, szIP, charsmax(szIP));
- get_user_name(id, szName, charsmax(szName));
- user_kill(id,1);
- switch(get_pcvar_num(cvarBan_Type))
- {
- case 0: server_cmd("kick #%d ^"Fast Strafe Detected^"",get_user_userid(id));
- case 1: server_cmd("amx_ban 0 %s ^"Fast Strafe Detected^"",szIP);
- }
- FTimeJump[id] = get_gametime() + 10.0;
- ColorChat(0,NORMAL,"^3[Анти-Чит]^1Игрок ^4%s ^1Использует ^1[^4Fast Strafe^1]",szName);
- }
- }
- }
- return FMRES_IGNORED;
- }
- public client_putinserver( id ) FTimeJump[id] = 0.0;
Advertisement
Add Comment
Please, Sign In to add comment