回复: 最强反作弊套装武器(最好最全的防作弊模块和插件集合)
还是不行,人一进来就死机。回复: 最强反作弊套装武器(最好最全的防作弊模块和插件集合)
很多反作弊插件针对1.6开发的1.5不适用
回复: 最强反作弊套装武器(最好最全的防作弊模块和插件集合)
发的时候没有替换hack所以1.5使用受限制,如果需要可以在论坛下我发的hack修改版直接替换原文件即可解决你一动就死机的问题回复: 最强反作弊套装武器(最好最全的防作弊模块和插件集合)
感谢,注册即可下载!回复: 最强反作弊套装武器(最好最全的防作弊模块和插件集合)
这里谁都有这样的过程,您和我都要经历,谁也不会例外!:cool:回复: 最强反作弊套装武器(最好最全的防作弊模块和插件集合)
替换sma内容后,显示“host_error:precache:file events、galil,sc missing from server”无法启动服务器。
回复: 最强反作弊套装武器(最好最全的防作弊模块和插件集合)
论坛有hack的修改包,你用我发的那个替换的?我发个sma你自行替换吧记得配置hackhunter_settings.cfg#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fakemeta_util>
#define PLUGIN "Hack Hunter"
#define VERSION "1.1"
#define AUTHOR "Alka & SAMURAI"
#define CharsMax(%1) sizeof %1 - 1
#define MAX_FLASHBUG_ZONES 20
#define ADVERTISING_TIME 240.0
#define FM_HITGROUP_HEAD (1 << 1)
#define FM_TEAM_OFFSET 114
#define ADMIN_IGNORE_FLAG ADMIN_BAN
enum _:Enum_Settings {
PLUGIN_STATUS = 0,
PLUGIN_LOG_ACTIONS,
PLUGIN_ADVERTISING,
PUNISH_TYPE,
BAN_TYPE,
BAN_TIME,
IGNORE_ADMINS,
SPEEDHACK_SECURE,
CHECK_RAPIDFIRE,
CHECK_SPINHACK,
CHECK_SPEEDHACK,
CHECK_SHAKE,
CHECK_LOWRECOIL,
CHECK_AIMBOT,
CHECK_BHOP,
CHECK_MOVEKEYS,
CHECK_DOUBLEATTACK,
CHECK_FLASHBUG,
CHECK_WALLHACK,
WALLHACK_MAX_DETECTS,
CHECK_FASTNAME,
CHECK_NAME,
CHECK_NAME_SYMBOLS,
CNS_SHOW_REASON,
CHECK_IPS
};
enum _:Cheats {
RAPIDFIRE = 0,
SPINHACK,
SPEEDHACK,
SHAKE,
RECOIL,
AIMBOT
};
new const gSettings_Name[][] = {
"Plugin_Status",
"Plugin_Log_Actions",
"Plugin_Advertising",
"Punish_Type",
"Punish_Ban_Type",
"Punish_Bantime",
"Ignore_Admins",
"Speedhack_Secure",
"Check_Rapidfire",
"Check_Spinhack",
"Check_Speedhack",
"Check_Shake",
"Check_Lowrecoil",
"Check_Aimbot",
"Check_Bhop",
"Check_Movekeys",
"Check_Doubleattack",
"Check_Flashbug",
"Check_Wallhack",
"Wallhack_Max_Detects",
"Check_Name_Fastchange",
"Check_Name",
"Check_Name_Symbols",
"CNS_Show_Reason",
"Check_IPs"
};
//new const gWarningSounds[][] = {
//"hackhunter/spray.wav",
//"hackhunter/warning.wav"
//};
new const gOldCheats[][] = {
"EcstaticCheat",
"TeKilla",
"MicCheat",
"AlphaCheat",
"PimP",
"LCD",
"Chapman",
"_PRJVDC"
};
new const gGunsEvents[][] = {
"events/awp.sc",
"events/g3sg1.sc",
"events/ak47.sc",
"events/scout.sc",
"events/m249.sc",
"events/m4a1.sc",
"events/sg552.sc",
"events/aug.sc",
"events/sg550.sc",
"events/m3.sc",
"events/xm1014.sc",
"events/usp.sc",
"events/mac10.sc",
"events/ump45.sc",
"events/fiveseven.sc",
"events/p90.sc",
"events/deagle.sc",
"events/p228.sc",
"events/glock18.sc",
"events/mp5n.sc",
"events/tmp.sc",
"events/elite_left.sc",
"events/elite_right.sc"
//"events/galil.sc",//
//"events/famas.sc",//
};
new gGunsEventsId;
new gSettings = {0, ...};
new gMapName;
new FlashVectors;
new FlashZones;
new bool:IsDetected;
new Detections;
new Float:fOldAimAngles;
new Float:fLastAngles;
new Float:fTotalAngle;
new Float:fRecoilLastAngles;
new Float:fLastOrigin;
new Float:fAimOrigin;
new WallKills;
new BhopScript;
new NamesChangesNum;
new RestrictedSymbols;
new Float:fNextAimCheck;
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR);
register_dictionary("hack_hunter.txt");
register_forward(FM_Think, "Fwd_Think");
register_forward(FM_EmitSound, "Fwd_EmitSound");
register_forward(FM_PlayerPostThink, "Fwd_PlayerPostThink");
register_forward(FM_PlayerPreThink, "Fwd_PlayerPreThink");
register_forward(FM_PlaybackEvent, "Fwd_PlaybackEvent");
register_forward(FM_TraceLine, "Fwd_TraceLine");
register_event("DeathMsg", "EventDeathMsg", "a");
//register_event("HLTV", "EventNewRound", "a", "1=0", "2=0");
register_event("ResetHUD", "EventNewRound","be");
formatex(BhopScript, CharsMax(BhopScript), "plop%d%d%d", random(100), random(100), random(100));
register_clcmd(BhopScript, "cmdDetectBhop");
}
public plugin_precache()
{
//for(new i = 0 ; i < sizeof gWarningSounds ; i++)
//precache_sound(gWarningSounds);
for(new x = 0 ; x < sizeof gGunsEvents ; x++)
gGunsEventsId = engfunc(EngFunc_PrecacheEvent, 1, gGunsEvents);
}
public plugin_cfg()
{
static BaseDir, HackHunterDir, File;
get_basedir(BaseDir, CharsMax(BaseDir));
formatex(HackHunterDir, CharsMax(HackHunterDir), "%s/hackhunter", BaseDir);
formatex(File, CharsMax(File), "%s/hackhunter_settings.cfg", HackHunterDir);
if(!dir_exists(HackHunterDir))
mkdir(HackHunterDir);
if(!file_exists(File))
{
server_print("%L",LANG_SERVER,"PRINT_SRV_ERROR");
return;
}
else
server_print("%L",LANG_PLAYER,"SUCC_LOADED");
static iFile, Buffer, Key, Status;
iFile = fopen(File, "rt");
while(!feof(iFile))
{
fgets(iFile, Buffer, CharsMax(Buffer));
if((Buffer == ';') || (Buffer == '/' && Buffer == '/'))
continue;
strtok(Buffer, Key, CharsMax(Key), Status, CharsMax(Status), '=', 1);
for(new i = 0 ; i < sizeof gSettings_Name ; i++)
{
if(equali(gSettings_Name, Key))
{
if(equali(Key, "Check_Name_Symbols"))
{
trim(Status);
formatex(RestrictedSymbols, CharsMax(RestrictedSymbols), "%s", Status);
//server_print(" Setting: %s have string %s", gSettings_Name, Status);
server_print("%L",LANG_SERVER,"SETTINGS_STR",gSettings_Name, Status);
continue;
}
gSettings = str_to_num(Status);
//server_print(" Setting: %s is %s", gSettings_Name, gSettings ? "Enabled" : "Disabled");
server_print("%L",LANG_SERVER,"SET_V_2",gSettings_Name, gSettings ? "Enabled" : "Disabled");
}
}
}
fclose(iFile);
LoadFlashVectors();
if(!gSettings)
{
pause("a");
return;
}
if(gSettings)
set_task(ADVERTISING_TIME, "cmdAdvertising", random(1337), "", 0, "b", 0);
if(gSettings)
set_task(1.0, "CheckRapidFire", random(1337), "", 0, "b", 0);
if(gSettings)
set_task(1.0, "CheckSpinTotal", random(1337), "", 0, "b", 0);
if(gSettings)
set_task(0.5, "CheckSpeedHack", random(1337), "", 0, "b", 0);
if(gSettings)
set_task(1.0, "ClearRecoil", random(1337), "", 0, "b", 0);
}
public cmdAdvertising()
{
set_hudmessage(random(256), random(256), random(256), random_float(0.01, 0.55), random_float(0.01, 0.7), 1, 6.0, 6.0, 1.0, 1.0, -1);
//show_hudmessage(0, "Hack Hunter v%s the ultimate Anti-Cheat.^nAuthors: %s", VERSION, AUTHOR);
show_hudmessage(0,"%L",LANG_PLAYER,"HUD_ADVERT",VERSION, AUTHOR);
}
public client_connect(id)
{
for(new i = 0 ; i < sizeof Detections[] ; i++)
{
Detections = 0;
}
IsDetected = false;
WallKills = 0;
NamesChangesNum = 0;
if(gSettings)
{
static Name;
get_user_name(id, Name, CharsMax(Name))
for(new i = 0 ; i < strlen(RestrictedSymbols) ; i++)
{
for(new j = 0 ; j < strlen(Name) ; j++)
{
if(Name == RestrictedSymbols)
{
//server_cmd("kick #%d ^"You have a restricted symbol in name! Change it.^"", get_user_userid(id));
server_cmd("kick #%d ^"%L^"", get_user_userid(id), LANG_PLAYER,"WRONG_CH");
if(gSettings)
//client_print(0, print_chat, " %s was kicked by Hack Hunter for having a restricted symbol in name.", Name);
client_print(0, print_chat, "%L",LANG_PLAYER,"KICK_WR_CH", Name);
break;
}
}
}
}
if(gSettings)
{
static BaseDir, File;
get_basedir(BaseDir, sizeof BaseDir - 1);
formatex(File, sizeof File - 1, "%s/hackhunter/hackhuntre_ips.ini", BaseDir);
if(Exists_IP(id, File))
//server_cmd("kick #%d ^"You'r IP is restricted.^"", get_user_userid(id));
server_cmd("kick #%d ^"%L^"",get_user_userid(id), LANG_PLAYER,"WRONG_IP");
}
return 0;
}
public client_putinserver(id)
{
static Name;
get_user_name(id, Name, CharsMax(Name));
static Info;
for(new i = 0 ; i < sizeof gOldCheats ; i++)
{
get_user_info(id, gOldCheats, Info, CharsMax(Info));
if(strlen(Info) > 0)
{
//client_print(0, print_chat, "%s is detected having cheats!", Name);
client_print(0,print_chat,"%L",LANG_PLAYER,"DEC_CON",Name);
PunishUser(id);
return 1;
}
}
//client_print(0, print_chat, " %s's config(.CFG) has been scaned successfully.", Name);
client_print(0,print_chat,"%L",LANG_PLAYER,"CFG_SC",Name);
return 0;
}
public LoadFlashVectors()
{
static BaseDir, HackHunterDir, File;
get_basedir(BaseDir, CharsMax(BaseDir));
get_mapname(gMapName, CharsMax(gMapName));
formatex(HackHunterDir, CharsMax(HackHunterDir), "%s/hackhunter", BaseDir);
formatex(File, CharsMax(File), "%s/flash_bug/%s.ini", HackHunterDir, gMapName);
if(!file_exists(File))
{
//server_print(" Couldn't load flash bug vectors for ^"%s^".", gMapName);
server_print("%L",LANG_SERVER,"LD_VECTORS",gMapName);
return;
}
static iFile, Buffer, Temp, LineParams, i;
iFile = fopen(File, "rt");
while(!feof(iFile))
{
fgets(iFile, Buffer, CharsMax(Buffer));
if((Buffer == ';') || (Buffer == '/' && Buffer == '/') || strlen(Buffer) < 2)
continue;
LineParams = parse(Buffer, Temp, sizeof Temp[] - 1, Temp, sizeof Temp[] - 1, Temp, sizeof Temp[] - 1, Temp, sizeof Temp[] - 1);
if(LineParams != 4)
{
//server_print(" Error in flash bug file for ^"%s^".", gMapName);
server_print("%L",LANG_SERVER,"SV_PRINT_VEC",gMapName);
continue;
}
FlashVectors = str_to_num(Temp);
FlashVectors = str_to_num(Temp);
FlashVectors = str_to_num(Temp);
FlashVectors = str_to_num(Temp);
i++;
}
fclose(iFile);
FlashZones = i;
//server_print(" Successfully loaded %d flash bug vectors for ^"%s^".", FlashZones, gMapName);
server_print("%L",LANG_SERVER,"SUC_VEC_LOAD",FlashZones,gMapName);
}
public EventNewRound()
{
static Players, iNum;
get_players(Players, iNum, "ch");
for(new i = 0 ; i < iNum ; i++)
{
if(gSettings)
{
static Float:fOrigin;
pev(Players, pev_origin, fOrigin);
CopyVector(fOrigin, fLastOrigin]);
}
if(gSettings)
{
WallKills] = 0;
}
}
}
public Fwd_Think(Ent)
{
if(!pev_valid(Ent))
return FMRES_IGNORED;
if(!gSettings)
return FMRES_IGNORED;
static Float:fOrigin, iOrigin, BugZone;
static Model;
pev(Ent, pev_model, Model, CharsMax(Model));
if(!equali(Model, "models/w_flashbang.mdl"))
return FMRES_IGNORED;
static id;
id = pev(Ent, pev_owner);
pev(Ent, pev_origin, fOrigin);
iOrigin = floatround(fOrigin);
iOrigin = floatround(fOrigin);
iOrigin = floatround(fOrigin);
for(new i = 0 ; i < FlashZones ; i++)
{
BugZone = FlashVectors;
BugZone = FlashVectors;
BugZone = FlashVectors;
if(get_distance(iOrigin, BugZone) <=FlashVectors)
{
//client_print(0, print_chat, " Removed a flashbang from (%d %d %d).", iOrigin, iOrigin, iOrigin);
client_print(0,print_chat,"%L",LANG_PLAYER,"SUCC_RMV_FLB",iOrigin, iOrigin, iOrigin);
engfunc(EngFunc_RemoveEntity, Ent);
set_hudmessage(255, 0, 0, -1.0, -1.0, 0, 6.0, 5.0, 1.0, 1.0, 3);
//show_hudmessage(id, " Ilegal map bug exploit warning!");
show_hudmessage(id,"%L",LANG_PLAYER,"ILG_MAP_EXPLOIT");
Fm_user_slap(id, 10.0);
return FMRES_SUPERCEDE;
}
}
return FMRES_IGNORED;
}
public Fwd_PlayerPostThink(id)
{
if(!is_user_alive(id) || is_user_bot(id))
return FMRES_IGNORED;
if(gSettings)
CheckSpinHack_Post(id);
if(gSettings)
CheckShake(id);
return FMRES_IGNORED;
}
public Fwd_PlayerPreThink(id)
{
if(!is_user_alive(id) || is_user_bot(id))
return FMRES_IGNORED;
if(gSettings)
CheckScriptBlock(id);
if(gSettings)
{
if(!(pev(id, pev_flags) & FL_ONGROUND) && (!(pev(id, pev_button) & IN_JUMP) || pev(id, pev_oldbuttons) & IN_JUMP))
client_cmd(id, ";alias _special %s", BhopScript);
}
return FMRES_IGNORED;
}
public cmdDetectBhop(id)
{
if(!gSettings)
return 1;
if(!(pev(id,pev_flags) & FL_ONGROUND) && (!(pev(id, pev_button) & IN_JUMP) || pev(id, pev_oldbuttons) & IN_JUMP))
return 1;
return 0;
}
public CheckShake(id)
{
static Float:fAimAngles;
pev(id, pev_angles, fAimAngles);
static Weapon, Trash;
Weapon = get_user_weapon(id, Trash, Trash);
if(Weapon == CSW_M249)
return FMRES_IGNORED;
if(((fAimAngles ==fOldAimAngles) && (fAimAngles ==fOldAimAngles)) || (pev(id, pev_button) & IN_JUMP))
{
Detections -= 10;
if(Detections < 0)
Detections = 0;
}
else
Detections++;
if(Detections > 350)
{
set_hudmessage(255, 0, 0, -1.0, -1.0, 0, 6.0, 5.0, 1.0, 1.0, 3);
//show_hudmessage(id, " Shake warning!");
show_hudmessage(id,"%L",LANG_PLAYER,"SHAKE_WARN");
//client_cmd(id, "spk %s", gWarningSounds);
}
if(Detections > 550)
PunishUser(id);
CopyVector(fAimAngles, fOldAimAngles);
return FMRES_IGNORED;
}
public CheckSpinHack_Post(id)
{
static Float:fAngles;
pev(id, pev_angles, fAngles);
fTotalAngle += vector_distance(fLastAngles, fAngles);
CopyVector(fAngles, fLastAngles);
static Button;
Button = pev(id, pev_button);
if((Button & IN_LEFT) || (Button & IN_RIGHT))
Detections = 0;
}
public Fwd_PlaybackEvent(flags, id, eventindex)
{
if(!gSettings)
return FMRES_IGNORED;
for(new i = 0 ; i < sizeof gGunsEvents ; i++)
{
if(eventindex == gGunsEventsId)
{
static Weapon, Trash;
Weapon = get_user_weapon(id, Trash, Trash);
static Float:fAimAngles;
pev(id, pev_v_angle, fAimAngles);
if(Weapon == CSW_GLOCK18)
return FMRES_IGNORED;
if(gSettings)
Detections++;
if(gSettings)
{
if((fAimAngles == fRecoilLastAngles) && fRecoilLastAngles != 0.0)
Detections++;
else
Detections--;
fRecoilLastAngles = fAimAngles;
if(Detections > 6)
{
set_hudmessage(255, 0, 0, -1.0, -1.0, 0, 6.0, 5.0, 1.0, 1.0, 3);
//show_hudmessage(id, " Low-recoil warning!");
show_hudmessage(id,"%L",LANG_PLAYER,"LOW_RECOIL");
//client_cmd(id, "spk %s", gWarningSounds);
}
if(Detections > 8)
PunishUser(id);
}
}
}
return FMRES_IGNORED;
}
public ClearRecoil()
{
static Players, iNum;
get_players(Players, iNum, "ach");
for(new i = 0 ; i < iNum ; i++)
{
Detections] -= 10;
if(Detections] < 0)
Detections] = 0;
}
}
public CheckSpeedHack()
{
static Players, iNum, id;
get_players(Players, iNum, "ach");
for(new i = 0 ; i < iNum ; i++)
{
id = Players;
if(cs_get_user_driving(id) >= 0)
continue;
static Float:fOrigin, Float:fOldOrigin, Float:fDistance;
pev(id, pev_origin, fOrigin);
CopyVector(fLastOrigin, fOldOrigin);
if(gSettings)
{
fOrigin = 0.0;
fOldOrigin = 0.0;
}
fDistance = get_distance_f(fOrigin, fOldOrigin);
if(Detections >= 3)
Detections--;
if(Detections < 0)
Detections = 0;
if(fDistance >= 240.0)
Detections += 3;
if(Detections >= 6)
{
set_hudmessage(255, 0, 0, -1.0, -1.0, 0, 6.0, 5.0, 1.0, 1.0, 3);
//show_hudmessage(id, " Speedhack warning!");
show_hudmessage(id,"%L",LANG_PLAYER,"SPEED_HACK");
//client_cmd(id, "spk %s", gWarningSounds);
}
if(Detections >= 8)
PunishUser(id);
CopyVector(fOrigin, fLastOrigin);
}
}
public CheckSpinTotal()
{
static Players, iNum, id;
get_players(Players, iNum, "ach");
for(new i = 0 ; i < iNum ; i++)
{
id = Players;
if(fTotalAngle >= 1500.0)
{
if(Detections >= 25 / 3)
{
set_hudmessage(255, 0, 0, -1.0, -1.0, 0, 6.0, 5.0, 1.0, 1.0, 3);
//show_hudmessage(id, " Spinhack warning!");
show_hudmessage(id,"%L",LANG_PLAYER,"SPIN_HACK");
//client_cmd(id, "spk %s", gWarningSounds);
}
if(Detections >= 25)
PunishUser(id);
Detections++;
}
else
Detections = 0;
fTotalAngle = 0.0;
}
}
public CheckRapidFire()
{
static Players, iNum, id;
get_players(Players, iNum, "ach");
for(new i = 0 ; i < iNum ; i++)
{
id = Players;
if(Detections >= 15)
PunishUser(id);
Detections = 0;
}
}
public CheckScriptBlock(id)
{
static Float:fAimAngles;
pev(id, pev_angles, fAimAngles);
CopyVector(fAimAngles, fAimOrigin);
static Button;
Button = pev(id, pev_button);
if(Button & IN_LEFT)
{
client_cmd(id, "-left");
CopyVector(fAimOrigin, fAimAngles);
set_pev(id, pev_angles, fAimAngles);
set_pev(id, pev_fixangle, 1);
set_hudmessage(255, 0, 0, -1.0, -1.0, 0, 6.0, 5.0, 1.0, 1.0, 3);
//show_hudmessage(id, " Left and Right keys are disabled!");
show_hudmessage(id,"%L",LANG_PLAYER,"LF_R_L_KEYS");
}
else if(Button & IN_RIGHT)
{
client_cmd(id, "-right");
CopyVector(fAimOrigin, fAimAngles);
set_pev(id, pev_angles, fAimAngles);
set_pev(id, pev_fixangle, 1);
set_hudmessage(255, 0, 0, -1.0, -1.0, 0, 6.0, 5.0, 1.0, 1.0, 3);
//show_hudmessage(id, " Left and Right keys are disabled!");
show_hudmessage(id,"%L",LANG_PLAYER,"LF_R_L_KEYS");
}
if(gSettings)
{
if((Button & IN_ATTACK) && (Button & IN_ATTACK2))
{
Button = Button & ~IN_ATTACK2;
set_pev(id, pev_button, Button);
set_hudmessage(255, 0, 0, -1.0, -1.0, 0, 6.0, 5.0, 1.0, 1.0, 3);
//show_hudmessage(id, " Dual attack is not allowed!");
show_hudmessage(id,"%L",LANG_PLAYER,"DUAL_ATTACK");
return FMRES_SUPERCEDE;
}
}
return FMRES_IGNORED;
}
public EventDeathMsg()
{
if(!gSettings)
return 1;
static Killer, Victim, Weapon;
read_data(4, Weapon, CharsMax(Weapon));
if(equali(Weapon, "grenade"))
return 1;
Killer = read_data(1);
Victim = read_data(2);
static bool:IsVisible;
IsVisible = fm_is_ent_visible(Killer, Victim, 1);
if(!IsVisible)
WallKills++;
if(WallKills >= gSettings)
PunishUser(Killer);
return 0;
}
public client_infochanged(id)
{
static NewName, OldName;
get_user_name(id, OldName, CharsMax(OldName));
get_user_info(id, "name", NewName, CharsMax(NewName));
if(!equali(NewName, OldName))
{
if(!gSettings)
return 1;
NamesChangesNum++;
if(NamesChangesNum >= 4)
PunishUser(id);
if(!task_exists(id))
set_task(4.0, "ClearChangesNum", id);
}
return 0;
}
public ClearChangesNum(id)
NamesChangesNum = 0;
public Fwd_TraceLine(Float:StartPos, Float:EndPos, SkipMonsters, id, Trace)
{
if(!is_user_alive(id))
return FMRES_IGNORED;
if(!gSettings)
return FMRES_IGNORED;
static Float:fGameTime;
fGameTime = get_gametime();
if(fNextAimCheck < fGameTime)
{
static iTarget, iHitGroup, Button;
iTarget = get_tr2(Trace, TR_pHit);
iHitGroup = (1 << get_tr2(Trace, TR_iHitgroup));
Button = pev(id, pev_button);
if(!is_user_alive(iTarget))
return FMRES_IGNORED;
if(get_pdata_int(id, FM_TEAM_OFFSET) != get_pdata_int(iTarget, FM_TEAM_OFFSET))
{
if((iHitGroup & FM_HITGROUP_HEAD) && (Button != 0))
Detections++;
else if(!(iHitGroup & FM_HITGROUP_HEAD) || (Button <= 0))
Detections = 0;
if(Detections >= 6)
{
set_hudmessage(255, 0, 0, -1.0, -1.0, 0, 6.0, 5.0, 1.0, 1.0, 3);
//show_hudmessage(id, " Aimbot warning!");
show_hudmessage(id,"%L",LANG_PLAYER,"AIM_BOT");
//client_cmd(id, "spk %s", gWarningSounds);
}
if(Detections >= 7)
PunishUser(id);
fNextAimCheck = fGameTime + 0.5;
}
}
return FMRES_IGNORED;
}
stock CountCheaters()
{
static BaseDir, File;
get_basedir(BaseDir, CharsMax(BaseDir));
formatex(File, CharsMax(File), "%s/hackhunter/hackhunter_detects.txt", BaseDir);
if(!file_exists(File))
write_file(File, ";Hack Hunter number of players detected.", -1);
static Line, Len, Buffer;
Line = read_file(File, Line, Buffer, CharsMax(Buffer), Len);
static Num;
Num = str_to_num(Buffer);
Num++;
num_to_str(Num, Buffer, CharsMax(Buffer));
write_file(File, Buffer, 0);
}
stock Fm_user_slap(index, Float:fDamage = 0.0)
{
static Float:fPunchangle;
pev(index, pev_punchangle, fPunchangle);
fPunchangle += random_float(-8.0, 8.0);
fPunchangle += random_float(-8.0, 8.0);
set_pev(index, pev_punchangle, fPunchangle);
static Float:fVelocity;
pev(index, pev_velocity, fVelocity);
fVelocity += random_num(0, 1) ? 264.0 : -264.0;
fVelocity += random_num(0, 1) ? 264.0 : -264.0;
set_pev(index, pev_basevelocity, fVelocity);
fm_fakedamage(index, "worldspawn", fDamage, 1);
return 1;
}
stock PunishUser(index)
{
if(!is_user_connected(index))
return;
if(gSettings)
{
if(access(index, ADMIN_IGNORE_FLAG))
{
WriteToLog(index, 0, "");
return;
}
}
if(!IsDetected)
{
static Name, authid, uid;
get_user_name(index, Name, CharsMax(Name));
get_user_authid(index,authid,sizeof authid - 1);
uid = get_user_userid(index);
switch(gSettings)
{
case 0 :
{
//client_cmd(index, "spk %s", gWarningSounds);
set_hudmessage(255, 0, 0, -1.0, 0.85, 0, 6.0, 5.0, 1.0, 1.0, 3);
//show_hudmessage(index, " You have been detected with cheats!");
show_hudmessage(index,"%L",LANG_PLAYER,"HACK_DETECT");
//client_print(0, print_chat, " %s was detected with cheats!", Name);
client_print(0,print_chat,"%L",LANG_PLAYER,"ID_WITH_HACK",Name);
}
case 1 :
{
//client_cmd(index, "spk %s", gWarningSounds);
//server_cmd("kick #%d ^" You have been detected with cheats!", uid);
server_cmd("kick #%d ^"%L^"",uid,LANG_PLAYER,"HACK_DETECT");
//client_print(0, print_chat, " %s was kicked by Hack Hunter for having cheats!", Name);
client_print(0,print_chat,"%L",LANG_PLAYER,"KICK_HAVE_CHEAT",Name);
}
case 2 :
{
switch(gSettings)
{
// STEAM ID
case 0:
{
//client_cmd(index, "spk %s", gWarningSounds)
server_cmd("kick #%d;wait;wait;wait;banid %d ^"%s^";wait;wait;wait;writeid", uid, gSettings, authid);
//client_print(0, print_chat, " %s was banned for %d min by Hack Hunter for having cheats!", Name, gSettings);
client_print(0,print_chat,"%L",LANG_PLAYER,"BAN_MIN_CHEAT",Name, gSettings);
}
// IP
case 1:
{
static Ip;
get_user_ip(index, Ip, CharsMax(Ip), 1);
//client_cmd(index, "spk %s", gWarningSounds);
server_cmd("kick #%d;wait;wait;wait;addip %d ^"%s^";wait;wait;writeip", uid, gSettings, Ip);
//client_print(0, print_chat, " %s was banned for %d min by Hack Hunter for having cheats!", Name, gSettings);
client_print(0,print_chat,"%L",LANG_PLAYER,"BAN_MIN_CHEAT",Name, gSettings);
}
// AMX BANS
case 2:
{
//client_cmd(index, "spk %s", gWarningSounds);
server_cmd("amx_ban %d %s",gSettings, Name);
//client_print(0, print_chat, " %s was banned for %d min by Hack Hunter for having cheats!", Name, gSettings);
client_print(0,print_chat,"%L",LANG_PLAYER,"BAN_MIN_CHEAT",Name, gSettings);
}
}
}
}
CountCheaters();
WriteToLog(index, gSettings, "");
IsDetected = true;
}
}
stock CopyVector(Float:fVec1, Float:fVec2)
{
fVec2 = fVec1;
fVec2 = fVec1;
fVec2 = fVec1;
}
stock WriteToLog(id, _:Log_Type, String[])
{
if(!gSettings)
return;
static BaseDir, LogsDir, File;
get_basedir(BaseDir, CharsMax(BaseDir));
formatex(LogsDir, CharsMax(LogsDir), "%s/hackhunter/logs", BaseDir);
formatex(File, CharsMax(File), "%s/Log.log", LogsDir);
if(!dir_exists(LogsDir))
mkdir(LogsDir);
if(!file_exists(File))
write_file(File, ";Hack Hunter logs file.", -1);
static Name, Ip;
if(Log_Type != -1)
{
get_user_name(id, Name, CharsMax(Name));
get_user_ip(id, Ip, CharsMax(Ip), 1);
}
switch(Log_Type)
{
case -1 : { log_to_file(File, "%s", String); }
case 0 : { log_to_file(File, "%L",LANG_PLAYER,"LOG_F_1", Name, Ip); }
case 1 : { log_to_file(File, "%L",LANG_PLAYER,"LOG_F_2", Name, Ip); }
case 2 : { log_to_file(File, "%L",LANG_PLAYER,"LOG_F_3", Name, Ip); }
}
}
stock bool:Exists_IP(id, const File[])
{
new iFile = fopen(File, "rt");
if(!iFile)
write_file(File, "", -1);
new Ip
get_user_ip(id, Ip, sizeof Ip - 1, 1);
while(!feof(iFile))
{
static Buffer;
fgets(iFile, Buffer, sizeof Buffer - 1);
if(Buffer == ';')
continue;
new nLen = strlen(Ip);
if(equali(Ip, Buffer, nLen))
{
fclose(iFile);
return true;
}
}
fclose(iFile);
return false;
}
回复: 最强反作弊套装武器(最好最全的防作弊模块和插件集合)
论坛有hack的修改包,你用我发的那个替换的?我发个sma你自行替换吧记得配置hackhunter_settings.cfg#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fakemeta_util>
#define PLUGIN "Hack Hunter"
#define VERSION "1.1"
#define AUTHOR "Alka & SAMURAI"
#define CharsMax(%1) sizeof %1 - 1
#define MAX_FLASHBUG_ZONES 20
#define ADVERTISING_TIME 240.0
#define FM_HITGROUP_HEAD (1 << 1)
#define FM_TEAM_OFFSET 114
#define ADMIN_IGNORE_FLAG ADMIN_BAN
enum _:Enum_Settings {
PLUGIN_STATUS = 0,
PLUGIN_LOG_ACTIONS,
PLUGIN_ADVERTISING,
PUNISH_TYPE,
BAN_TYPE,
BAN_TIME,
IGNORE_ADMINS,
SPEEDHACK_SECURE,
CHECK_RAPIDFIRE,
CHECK_SPINHACK,
CHECK_SPEEDHACK,
CHECK_SHAKE,
CHECK_LOWRECOIL,
CHECK_AIMBOT,
CHECK_BHOP,
CHECK_MOVEKEYS,
CHECK_DOUBLEATTACK,
CHECK_FLASHBUG,
CHECK_WALLHACK,
WALLHACK_MAX_DETECTS,
CHECK_FASTNAME,
CHECK_NAME,
CHECK_NAME_SYMBOLS,
CNS_SHOW_REASON,
CHECK_IPS
};
enum _:Cheats {
RAPIDFIRE = 0,
SPINHACK,
SPEEDHACK,
SHAKE,
RECOIL,
AIMBOT
};
new const gSettings_Name[][] = {
"Plugin_Status",
"Plugin_Log_Actions",
"Plugin_Advertising",
"Punish_Type",
"Punish_Ban_Type",
"Punish_Bantime",
"Ignore_Admins",
"Speedhack_Secure",
"Check_Rapidfire",
"Check_Spinhack",
"Check_Speedhack",
"Check_Shake",
"Check_Lowrecoil",
"Check_Aimbot",
"Check_Bhop",
"Check_Movekeys",
"Check_Doubleattack",
"Check_Flashbug",
"Check_Wallhack",
"Wallhack_Max_Detects",
"Check_Name_Fastchange",
"Check_Name",
"Check_Name_Symbols",
"CNS_Show_Reason",
"Check_IPs"
};
//new const gWarningSounds[][] = {
//"hackhunter/spray.wav",
//"hackhunter/warning.wav"
//};
new const gOldCheats[][] = {
"EcstaticCheat",
"TeKilla",
"MicCheat",
"AlphaCheat",
"PimP",
"LCD",
"Chapman",
"_PRJVDC"
};
new const gGunsEvents[][] = {
"events/awp.sc",
"events/g3sg1.sc",
"events/ak47.sc",
"events/scout.sc",
"events/m249.sc",
"events/m4a1.sc",
"events/sg552.sc",
"events/aug.sc",
"events/sg550.sc",
"events/m3.sc",
"events/xm1014.sc",
"events/usp.sc",
"events/mac10.sc",
"events/ump45.sc",
"events/fiveseven.sc",
"events/p90.sc",
"events/deagle.sc",
"events/p228.sc",
"events/glock18.sc",
"events/mp5n.sc",
"events/tmp.sc",
"events/elite_left.sc",
"events/elite_right.sc"
//"events/galil.sc",//
//"events/famas.sc",//
};
new gGunsEventsId;
new gSettings = {0, ...};
new gMapName;
new FlashVectors;
new FlashZones;
new bool:IsDetected;
new Detections;
new Float:fOldAimAngles;
new Float:fLastAngles;
new Float:fTotalAngle;
new Float:fRecoilLastAngles;
new Float:fLastOrigin;
new Float:fAimOrigin;
new WallKills;
new BhopScript;
new NamesChangesNum;
new RestrictedSymbols;
new Float:fNextAimCheck;
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR);
register_dictionary("hack_hunter.txt");
register_forward(FM_Think, "Fwd_Think");
register_forward(FM_EmitSound, "Fwd_EmitSound");
register_forward(FM_PlayerPostThink, "Fwd_PlayerPostThink");
register_forward(FM_PlayerPreThink, "Fwd_PlayerPreThink");
register_forward(FM_PlaybackEvent, "Fwd_PlaybackEvent");
register_forward(FM_TraceLine, "Fwd_TraceLine");
register_event("DeathMsg", "EventDeathMsg", "a");
//register_event("HLTV", "EventNewRound", "a", "1=0", "2=0");
register_event("ResetHUD", "EventNewRound","be");
formatex(BhopScript, CharsMax(BhopScript), "plop%d%d%d", random(100), random(100), random(100));
register_clcmd(BhopScript, "cmdDetectBhop");
}
public plugin_precache()
{
//for(new i = 0 ; i < sizeof gWarningSounds ; i++)
//precache_sound(gWarningSounds);
for(new x = 0 ; x < sizeof gGunsEvents ; x++)
gGunsEventsId = engfunc(EngFunc_PrecacheEvent, 1, gGunsEvents);
}
public plugin_cfg()
{
static BaseDir, HackHunterDir, File;
get_basedir(BaseDir, CharsMax(BaseDir));
formatex(HackHunterDir, CharsMax(HackHunterDir), "%s/hackhunter", BaseDir);
formatex(File, CharsMax(File), "%s/hackhunter_settings.cfg", HackHunterDir);
if(!dir_exists(HackHunterDir))
mkdir(HackHunterDir);
if(!file_exists(File))
{
server_print("%L",LANG_SERVER,"PRINT_SRV_ERROR");
return;
}
else
server_print("%L",LANG_PLAYER,"SUCC_LOADED");
static iFile, Buffer, Key, Status;
iFile = fopen(File, "rt");
while(!feof(iFile))
{
fgets(iFile, Buffer, CharsMax(Buffer));
if((Buffer == ';') || (Buffer == '/' && Buffer == '/'))
continue;
strtok(Buffer, Key, CharsMax(Key), Status, CharsMax(Status), '=', 1);
for(new i = 0 ; i < sizeof gSettings_Name ; i++)
{
if(equali(gSettings_Name, Key))
{
if(equali(Key, "Check_Name_Symbols"))
{
trim(Status);
formatex(RestrictedSymbols, CharsMax(RestrictedSymbols), "%s", Status);
//server_print(" Setting: %s have string %s", gSettings_Name, Status);
server_print("%L",LANG_SERVER,"SETTINGS_STR",gSettings_Name, Status);
continue;
}
gSettings = str_to_num(Status);
//server_print(" Setting: %s is %s", gSettings_Name, gSettings ? "Enabled" : "Disabled");
server_print("%L",LANG_SERVER,"SET_V_2",gSettings_Name, gSettings ? "Enabled" : "Disabled");
}
}
}
fclose(iFile);
LoadFlashVectors();
if(!gSettings)
{
pause("a");
return;
}
if(gSettings)
set_task(ADVERTISING_TIME, "cmdAdvertising", random(1337), "", 0, "b", 0);
if(gSettings)
set_task(1.0, "CheckRapidFire", random(1337), "", 0, "b", 0);
if(gSettings)
set_task(1.0, "CheckSpinTotal", random(1337), "", 0, "b", 0);
if(gSettings)
set_task(0.5, "CheckSpeedHack", random(1337), "", 0, "b", 0);
if(gSettings)
set_task(1.0, "ClearRecoil", random(1337), "", 0, "b", 0);
}
public cmdAdvertising()
{
set_hudmessage(random(256), random(256), random(256), random_float(0.01, 0.55), random_float(0.01, 0.7), 1, 6.0, 6.0, 1.0, 1.0, -1);
//show_hudmessage(0, "Hack Hunter v%s the ultimate Anti-Cheat.^nAuthors: %s", VERSION, AUTHOR);
show_hudmessage(0,"%L",LANG_PLAYER,"HUD_ADVERT",VERSION, AUTHOR);
}
public client_connect(id)
{
for(new i = 0 ; i < sizeof Detections[] ; i++)
{
Detections = 0;
}
IsDetected = false;
WallKills = 0;
NamesChangesNum = 0;
if(gSettings)
{
static Name;
get_user_name(id, Name, CharsMax(Name))
for(new i = 0 ; i < strlen(RestrictedSymbols) ; i++)
{
for(new j = 0 ; j < strlen(Name) ; j++)
{
if(Name == RestrictedSymbols)
{
//server_cmd("kick #%d ^"You have a restricted symbol in name! Change it.^"", get_user_userid(id));
server_cmd("kick #%d ^"%L^"", get_user_userid(id), LANG_PLAYER,"WRONG_CH");
if(gSettings)
//client_print(0, print_chat, " %s was kicked by Hack Hunter for having a restricted symbol in name.", Name);
client_print(0, print_chat, "%L",LANG_PLAYER,"KICK_WR_CH", Name);
break;
}
}
}
}
if(gSettings)
{
static BaseDir, File;
get_basedir(BaseDir, sizeof BaseDir - 1);
formatex(File, sizeof File - 1, "%s/hackhunter/hackhuntre_ips.ini", BaseDir);
if(Exists_IP(id, File))
//server_cmd("kick #%d ^"You'r IP is restricted.^"", get_user_userid(id));
server_cmd("kick #%d ^"%L^"",get_user_userid(id), LANG_PLAYER,"WRONG_IP");
}
return 0;
}
public client_putinserver(id)
{
static Name;
get_user_name(id, Name, CharsMax(Name));
static Info;
for(new i = 0 ; i < sizeof gOldCheats ; i++)
{
get_user_info(id, gOldCheats, Info, CharsMax(Info));
if(strlen(Info) > 0)
{
//client_print(0, print_chat, "%s is detected having cheats!", Name);
client_print(0,print_chat,"%L",LANG_PLAYER,"DEC_CON",Name);
PunishUser(id);
return 1;
}
}
//client_print(0, print_chat, " %s's config(.CFG) has been scaned successfully.", Name);
client_print(0,print_chat,"%L",LANG_PLAYER,"CFG_SC",Name);
return 0;
}
public LoadFlashVectors()
{
static BaseDir, HackHunterDir, File;
get_basedir(BaseDir, CharsMax(BaseDir));
get_mapname(gMapName, CharsMax(gMapName));
formatex(HackHunterDir, CharsMax(HackHunterDir), "%s/hackhunter", BaseDir);
formatex(File, CharsMax(File), "%s/flash_bug/%s.ini", HackHunterDir, gMapName);
if(!file_exists(File))
{
//server_print(" Couldn't load flash bug vectors for ^"%s^".", gMapName);
server_print("%L",LANG_SERVER,"LD_VECTORS",gMapName);
return;
}
static iFile, Buffer, Temp, LineParams, i;
iFile = fopen(File, "rt");
while(!feof(iFile))
{
fgets(iFile, Buffer, CharsMax(Buffer));
if((Buffer == ';') || (Buffer == '/' && Buffer == '/') || strlen(Buffer) < 2)
continue;
LineParams = parse(Buffer, Temp, sizeof Temp[] - 1, Temp, sizeof Temp[] - 1, Temp, sizeof Temp[] - 1, Temp, sizeof Temp[] - 1);
if(LineParams != 4)
{
//server_print(" Error in flash bug file for ^"%s^".", gMapName);
server_print("%L",LANG_SERVER,"SV_PRINT_VEC",gMapName);
continue;
}
FlashVectors = str_to_num(Temp);
FlashVectors = str_to_num(Temp);
FlashVectors = str_to_num(Temp);
FlashVectors = str_to_num(Temp);
i++;
}
fclose(iFile);
FlashZones = i;
//server_print(" Successfully loaded %d flash bug vectors for ^"%s^".", FlashZones, gMapName);
server_print("%L",LANG_SERVER,"SUC_VEC_LOAD",FlashZones,gMapName);
}
public EventNewRound()
{
static Players, iNum;
get_players(Players, iNum, "ch");
for(new i = 0 ; i < iNum ; i++)
{
if(gSettings)
{
static Float:fOrigin;
pev(Players, pev_origin, fOrigin);
CopyVector(fOrigin, fLastOrigin]);
}
if(gSettings)
{
WallKills] = 0;
}
}
}
public Fwd_Think(Ent)
{
if(!pev_valid(Ent))
return FMRES_IGNORED;
if(!gSettings)
return FMRES_IGNORED;
static Float:fOrigin, iOrigin, BugZone;
static Model;
pev(Ent, pev_model, Model, CharsMax(Model));
if(!equali(Model, "models/w_flashbang.mdl"))
return FMRES_IGNORED;
static id;
id = pev(Ent, pev_owner);
pev(Ent, pev_origin, fOrigin);
iOrigin = floatround(fOrigin);
iOrigin = floatround(fOrigin);
iOrigin = floatround(fOrigin);
for(new i = 0 ; i < FlashZones ; i++)
{
BugZone = FlashVectors;
BugZone = FlashVectors;
BugZone = FlashVectors;
if(get_distance(iOrigin, BugZone) <= FlashVectors)
{
//client_print(0, print_chat, " Removed a flashbang from (%d %d %d).", iOrigin, iOrigin, iOrigin);
client_print(0,print_chat,"%L",LANG_PLAYER,"SUCC_RMV_FLB",iOrigin, iOrigin, iOrigin);
engfunc(EngFunc_RemoveEntity, Ent);
set_hudmessage(255, 0, 0, -1.0, -1.0, 0, 6.0, 5.0, 1.0, 1.0, 3);
//show_hudmessage(id, " Ilegal map bug exploit warning!");
show_hudmessage(id,"%L",LANG_PLAYER,"ILG_MAP_EXPLOIT");
Fm_user_slap(id, 10.0);
return FMRES_SUPERCEDE;
}
}
return FMRES_IGNORED;
}
public Fwd_PlayerPostThink(id)
{
if(!is_user_alive(id) || is_user_bot(id))
return FMRES_IGNORED;
if(gSettings)
CheckSpinHack_Post(id);
if(gSettings)
CheckShake(id);
return FMRES_IGNORED;
}
public Fwd_PlayerPreThink(id)
{
if(!is_user_alive(id) || is_user_bot(id))
return FMRES_IGNORED;
if(gSettings)
CheckScriptBlock(id);
if(gSettings)
{
if(!(pev(id, pev_flags) & FL_ONGROUND) && (!(pev(id, pev_button) & IN_JUMP) || pev(id, pev_oldbuttons) & IN_JUMP))
client_cmd(id, ";alias _special %s", BhopScript);
}
return FMRES_IGNORED;
}
public cmdDetectBhop(id)
{
if(!gSettings)
return 1;
if(!(pev(id,pev_flags) & FL_ONGROUND) && (!(pev(id, pev_button) & IN_JUMP) || pev(id, pev_oldbuttons) & IN_JUMP))
return 1;
return 0;
}
public CheckShake(id)
{
static Float:fAimAngles;
pev(id, pev_angles, fAimAngles);
static Weapon, Trash;
Weapon = get_user_weapon(id, Trash, Trash);
if(Weapon == CSW_M249)
return FMRES_IGNORED;
if(((fAimAngles == fOldAimAngles) && (fAimAngles == fOldAimAngles)) || (pev(id, pev_button) & IN_JUMP))
{
Detections -= 10;
if(Detections < 0)
Detections = 0;
}
else
Detections++;
if(Detections > 350)
{
set_hudmessage(255, 0, 0, -1.0, -1.0, 0, 6.0, 5.0, 1.0, 1.0, 3);
//show_hudmessage(id, " Shake warning!");
show_hudmessage(id,"%L",LANG_PLAYER,"SHAKE_WARN");
//client_cmd(id, "spk %s", gWarningSounds);
}
if(Detections > 550)
PunishUser(id);
CopyVector(fAimAngles, fOldAimAngles);
return FMRES_IGNORED;
}
public CheckSpinHack_Post(id)
{
static Float:fAngles;
pev(id, pev_angles, fAngles);
fTotalAngle += vector_distance(fLastAngles, fAngles);
CopyVector(fAngles, fLastAngles);
static Button;
Button = pev(id, pev_button);
if((Button & IN_LEFT) || (Button & IN_RIGHT))
Detections = 0;
}
public Fwd_PlaybackEvent(flags, id, eventindex)
{
if(!gSettings)
return FMRES_IGNORED;
for(new i = 0 ; i < sizeof gGunsEvents ; i++)
{
if(eventindex == gGunsEventsId)
{
static Weapon, Trash;
Weapon = get_user_weapon(id, Trash, Trash);
static Float:fAimAngles;
pev(id, pev_v_angle, fAimAngles);
if(Weapon == CSW_GLOCK18)
return FMRES_IGNORED;
if(gSettings)
Detections++;
if(gSettings)
{
if((fAimAngles == fRecoilLastAngles) && fRecoilLastAngles != 0.0)
Detections++;
else
Detections--;
fRecoilLastAngles = fAimAngles;
if(Detections > 6)
{
set_hudmessage(255, 0, 0, -1.0, -1.0, 0, 6.0, 5.0, 1.0, 1.0, 3);
//show_hudmessage(id, " Low-recoil warning!");
show_hudmessage(id,"%L",LANG_PLAYER,"LOW_RECOIL");
//client_cmd(id, "spk %s", gWarningSounds);
}
if(Detections > 8)
PunishUser(id);
}
}
}
return FMRES_IGNORED;
}
public ClearRecoil()
{
static Players, iNum;
get_players(Players, iNum, "ach");
for(new i = 0 ; i < iNum ; i++)
{
Detections] -= 10;
if(Detections] < 0)
Detections] = 0;
}
}
public CheckSpeedHack()
{
static Players, iNum, id;
get_players(Players, iNum, "ach");
for(new i = 0 ; i < iNum ; i++)
{
id = Players;
if(cs_get_user_driving(id) >= 0)
continue;
static Float:fOrigin, Float:fOldOrigin, Float:fDistance;
pev(id, pev_origin, fOrigin);
CopyVector(fLastOrigin, fOldOrigin);
if(gSettings)
{
fOrigin = 0.0;
fOldOrigin = 0.0;
}
fDistance = get_distance_f(fOrigin, fOldOrigin);
if(Detections >= 3)
Detections--;
if(Detections < 0)
Detections = 0;
if(fDistance >= 240.0)
Detections += 3;
if(Detections >= 6)
{
set_hudmessage(255, 0, 0, -1.0, -1.0, 0, 6.0, 5.0, 1.0, 1.0, 3);
//show_hudmessage(id, " Speedhack warning!");
show_hudmessage(id,"%L",LANG_PLAYER,"SPEED_HACK");
//client_cmd(id, "spk %s", gWarningSounds);
}
if(Detections >= 8)
PunishUser(id);
CopyVector(fOrigin, fLastOrigin);
}
}
public CheckSpinTotal()
{
static Players, iNum, id;
get_players(Players, iNum, "ach");
for(new i = 0 ; i < iNum ; i++)
{
id = Players;
if(fTotalAngle >= 1500.0)
{
if(Detections >= 25 / 3)
{
set_hudmessage(255, 0, 0, -1.0, -1.0, 0, 6.0, 5.0, 1.0, 1.0, 3);
//show_hudmessage(id, " Spinhack warning!");
show_hudmessage(id,"%L",LANG_PLAYER,"SPIN_HACK");
//client_cmd(id, "spk %s", gWarningSounds);
}
if(Detections >= 25)
PunishUser(id);
Detections++;
}
else
Detections = 0;
fTotalAngle = 0.0;
}
}
public CheckRapidFire()
{
static Players, iNum, id;
get_players(Players, iNum, "ach");
for(new i = 0 ; i < iNum ; i++)
{
id = Players;
if(Detections >= 15)
PunishUser(id);
Detections = 0;
}
}
public CheckScriptBlock(id)
{
static Float:fAimAngles;
pev(id, pev_angles, fAimAngles);
CopyVector(fAimAngles, fAimOrigin);
static Button;
Button = pev(id, pev_button);
if(Button & IN_LEFT)
{
client_cmd(id, "-left");
CopyVector(fAimOrigin, fAimAngles);
set_pev(id, pev_angles, fAimAngles);
set_pev(id, pev_fixangle, 1);
set_hudmessage(255, 0, 0, -1.0, -1.0, 0, 6.0, 5.0, 1.0, 1.0, 3);
//show_hudmessage(id, " Left and Right keys are disabled!");
show_hudmessage(id,"%L",LANG_PLAYER,"LF_R_L_KEYS");
}
else if(Button & IN_RIGHT)
{
client_cmd(id, "-right");
CopyVector(fAimOrigin, fAimAngles);
set_pev(id, pev_angles, fAimAngles);
set_pev(id, pev_fixangle, 1);
set_hudmessage(255, 0, 0, -1.0, -1.0, 0, 6.0, 5.0, 1.0, 1.0, 3);
//show_hudmessage(id, " Left and Right keys are disabled!");
show_hudmessage(id,"%L",LANG_PLAYER,"LF_R_L_KEYS");
}
if(gSettings)
{
if((Button & IN_ATTACK) && (Button & IN_ATTACK2))
{
Button = Button & ~IN_ATTACK2;
set_pev(id, pev_button, Button);
set_hudmessage(255, 0, 0, -1.0, -1.0, 0, 6.0, 5.0, 1.0, 1.0, 3);
//show_hudmessage(id, " Dual attack is not allowed!");
show_hudmessage(id,"%L",LANG_PLAYER,"DUAL_ATTACK");
return FMRES_SUPERCEDE;
}
}
return FMRES_IGNORED;
}
public EventDeathMsg()
{
if(!gSettings)
return 1;
static Killer, Victim, Weapon;
read_data(4, Weapon, CharsMax(Weapon));
if(equali(Weapon, "grenade"))
return 1;
Killer = read_data(1);
Victim = read_data(2);
static bool:IsVisible;
IsVisible = fm_is_ent_visible(Killer, Victim, 1);
if(!IsVisible)
WallKills++;
if(WallKills >= gSettings)
PunishUser(Killer);
return 0;
}
public client_infochanged(id)
{
static NewName, OldName;
get_user_name(id, OldName, CharsMax(OldName));
get_user_info(id, "name", NewName, CharsMax(NewName));
if(!equali(NewName, OldName))
{
if(!gSettings)
return 1;
NamesChangesNum++;
if(NamesChangesNum >= 4)
PunishUser(id);
if(!task_exists(id))
set_task(4.0, "ClearChangesNum", id);
}
return 0;
}
public ClearChangesNum(id)
NamesChangesNum = 0;
public Fwd_TraceLine(Float:StartPos, Float:EndPos, SkipMonsters, id, Trace)
{
if(!is_user_alive(id))
return FMRES_IGNORED;
if(!gSettings)
return FMRES_IGNORED;
static Float:fGameTime;
fGameTime = get_gametime();
if(fNextAimCheck < fGameTime)
{
static iTarget, iHitGroup, Button;
iTarget = get_tr2(Trace, TR_pHit);
iHitGroup = (1 << get_tr2(Trace, TR_iHitgroup));
Button = pev(id, pev_button);
if(!is_user_alive(iTarget))
return FMRES_IGNORED;
if(get_pdata_int(id, FM_TEAM_OFFSET) != get_pdata_int(iTarget, FM_TEAM_OFFSET))
{
if((iHitGroup & FM_HITGROUP_HEAD) && (Button != 0))
Detections++;
else if(!(iHitGroup & FM_HITGROUP_HEAD) || (Button <= 0))
Detections = 0;
if(Detections >= 6)
{
set_hudmessage(255, 0, 0, -1.0, -1.0, 0, 6.0, 5.0, 1.0, 1.0, 3);
//show_hudmessage(id, " Aimbot warning!");
show_hudmessage(id,"%L",LANG_PLAYER,"AIM_BOT");
//client_cmd(id, "spk %s", gWarningSounds);
}
if(Detections >= 7)
PunishUser(id);
fNextAimCheck = fGameTime + 0.5;
}
}
return FMRES_IGNORED;
}
stock CountCheaters()
{
static BaseDir, File;
get_basedir(BaseDir, CharsMax(BaseDir));
formatex(File, CharsMax(File), "%s/hackhunter/hackhunter_detects.txt", BaseDir);
if(!file_exists(File))
write_file(File, ";Hack Hunter number of players detected.", -1);
static Line, Len, Buffer;
Line = read_file(File, Line, Buffer, CharsMax(Buffer), Len);
static Num;
Num = str_to_num(Buffer);
Num++;
num_to_str(Num, Buffer, CharsMax(Buffer));
write_file(File, Buffer, 0);
}
stock Fm_user_slap(index, Float:fDamage = 0.0)
{
static Float:fPunchangle;
pev(index, pev_punchangle, fPunchangle);
fPunchangle += random_float(-8.0, 8.0);
fPunchangle += random_float(-8.0, 8.0);
set_pev(index, pev_punchangle, fPunchangle);
static Float:fVelocity;
pev(index, pev_velocity, fVelocity);
fVelocity += random_num(0, 1) ? 264.0 : -264.0;
fVelocity += random_num(0, 1) ? 264.0 : -264.0;
set_pev(index, pev_basevelocity, fVelocity);
fm_fakedamage(index, "worldspawn", fDamage, 1);
return 1;
}
stock PunishUser(index)
{
if(!is_user_connected(index))
return;
if(gSettings)
{
if(access(index, ADMIN_IGNORE_FLAG))
{
WriteToLog(index, 0, "");
return;
}
}
if(!IsDetected)
{
static Name, authid, uid;
get_user_name(index, Name, CharsMax(Name));
get_user_authid(index,authid,sizeof authid - 1);
uid = get_user_userid(index);
switch(gSettings)
{
case 0 :
{
//client_cmd(index, "spk %s", gWarningSounds);
set_hudmessage(255, 0, 0, -1.0, 0.85, 0, 6.0, 5.0, 1.0, 1.0, 3);
//show_hudmessage(index, " You have been detected with cheats!");
show_hudmessage(index,"%L",LANG_PLAYER,"HACK_DETECT");
//client_print(0, print_chat, " %s was detected with cheats!", Name);
client_print(0,print_chat,"%L",LANG_PLAYER,"ID_WITH_HACK",Name);
}
case 1 :
{
//client_cmd(index, "spk %s", gWarningSounds);
//server_cmd("kick #%d ^" You have been detected with cheats!", uid);
server_cmd("kick #%d ^"%L^"",uid,LANG_PLAYER,"HACK_DETECT");
//client_print(0, print_chat, " %s was kicked by Hack Hunter for having cheats!", Name);
client_print(0,print_chat,"%L",LANG_PLAYER,"KICK_HAVE_CHEAT",Name);
}
case 2 :
{
switch(gSettings)
{
// STEAM ID
case 0:
{
//client_cmd(index, "spk %s", gWarningSounds)
server_cmd("kick #%d;wait;wait;wait;banid %d ^"%s^";wait;wait;wait;writeid", uid, gSettings, authid);
//client_print(0, print_chat, " %s was banned for %d min by Hack Hunter for having cheats!", Name, gSettings);
client_print(0,print_chat,"%L",LANG_PLAYER,"BAN_MIN_CHEAT",Name, gSettings);
}
// IP
case 1:
{
static Ip;
get_user_ip(index, Ip, CharsMax(Ip), 1);
//client_cmd(index, "spk %s", gWarningSounds);
server_cmd("kick #%d;wait;wait;wait;addip %d ^"%s^";wait;wait;writeip", uid, gSettings, Ip);
//client_print(0, print_chat, " %s was banned for %d min by Hack Hunter for having cheats!", Name, gSettings);
client_print(0,print_chat,"%L",LANG_PLAYER,"BAN_MIN_CHEAT",Name, gSettings);
}
// AMX BANS
case 2:
{
//client_cmd(index, "spk %s", gWarningSounds);
server_cmd("amx_ban %d %s",gSettings, Name);
//client_print(0, print_chat, " %s was banned for %d min by Hack Hunter for having cheats!", Name, gSettings);
client_print(0,print_chat,"%L",LANG_PLAYER,"BAN_MIN_CHEAT",Name, gSettings);
}
}
}
}
CountCheaters();
WriteToLog(index, gSettings, "");
IsDetected = true;
}
}
stock CopyVector(Float:fVec1, Float:fVec2)
{
fVec2 = fVec1;
fVec2 = fVec1;
fVec2 = fVec1;
}
stock WriteToLog(id, _:Log_Type, String[])
{
if(!gSettings)
return;
static BaseDir, LogsDir, File;
get_basedir(BaseDir, CharsMax(BaseDir));
formatex(LogsDir, CharsMax(LogsDir), "%s/hackhunter/logs", BaseDir);
formatex(File, CharsMax(File), "%s/Log.log", LogsDir);
if(!dir_exists(LogsDir))
mkdir(LogsDir);
if(!file_exists(File))
write_file(File, ";Hack Hunter logs file.", -1);
static Name, Ip;
if(Log_Type != -1)
{
get_user_name(id, Name, CharsMax(Name));
get_user_ip(id, Ip, CharsMax(Ip), 1);
}
switch(Log_Type)
{
case -1 : { log_to_file(File, "%s", String); }
case 0 : { log_to_file(File, "%L",LANG_PLAYER,"LOG_F_1", Name, Ip); }
case 1 : { log_to_file(File, "%L",LANG_PLAYER,"LOG_F_2", Name, Ip); }
case 2 : { log_to_file(File, "%L",LANG_PLAYER,"LOG_F_3", Name, Ip); }
}
}
stock bool:Exists_IP(id, const File[])
{
new iFile = fopen(File, "rt");
if(!iFile)
write_file(File, "", -1);
new Ip
get_user_ip(id, Ip, sizeof Ip - 1, 1);
while(!feof(iFile))
{
static Buffer;
fgets(iFile, Buffer, sizeof Buffer - 1);
if(Buffer == ';')
continue;
new nLen = strlen(Ip);
if(equali(Ip, Buffer, nLen))
{
fclose(iFile);
return true;
}
}
fclose(iFile);
return false;
}
回复: 最强反作弊套装武器(最好最全的防作弊模块和插件集合)
不是本论坛的附件啊====================