圖 1.
new PLUGIN_VERSION[7] =
{
86, 49, 46, 48, 53, 97, 0
}
new cheats_words[50][0];
new Float:gf_LastAng[33][3];
new Float:gf_TotalAng[33];
new Float:fOldAimAngles[33][3];
new Float:fNextAimCheck[33];
new g_spinhack_detections[33];
new g_flashkill_detections[33];
new g_aimbot_detections[33];
new g_shakehack_detections[33];
new g_countbullets[33];
new g_nCurWeapon[32][2];
new g_user_warning[33];
new detect_bhop_cmd[32];
new Float:old[33][3];
new Float:holdTime;
new g_maxplayers;
new bool:has_joinedteam[33];
new bool:checked[33];
new bool:g_playerflashed[33];
new cvar_antispeedhack;
new cvar_antispeedhack_maxwarning;
new cvar_antispeedhack_maxspeed;
new cvar_playerupdatetime;
new cvar_logcommands;
new cvar_tdmac_adminnotallow;
new cvar_antispeedhack_prompt;
new cvar_antispeedhack_bantime;
new cvar_punish_type;
new cvar_cdhack_enabled;
new cvar_cdhack_bantype;
new cvar_cdhack_bantime;
new cvar_ecchack_punish_type;
new cvar_ecchack_enabled;
new cvar_antibhop_config;
new cvar_bhopconfig_bantype;
new cvar_bhopconfig_bantime;
new cvar_cheatmessage_bantype;
new cvar_cheatmessage_enabled;
new cvar_cbhack_enabled;
new cvar_cbhack_punish_type;
new cvar_spinhack_enabled;
new cvar_spinhack_punish_type;
new cvar_aimbot_punish_type;
new cvar_aimbot_enable;
new cvar_shakehack_enable;
new cvar_shakehack_punish_type;
new cvar_flashkill_enabled;
new cvar_flashkill_maxwarning;
new cvar_flashkill_punish_type;
new cvar_fastfire_enable;
new cvar_fastfire_maxshots;
new cvar_fastfire_punish_type;
new cvar_restart_client;
new cvar_restart_client_prompt;
xs_vec_sub(Float:in1[], Float:in2[], Float:out[])
{
out[0] = in1[0] - in2[0];
out[1] = in1[1] - in2[1];
out[2] = in1[2] - in2[2];
return 0;
}
Float:xs_vec_len(Float:vec[])
{
return xs_sqrt(vec[0] * vec[0] + vec[1] * vec[1] + vec[2] * vec[2]);
}
public plugin_init()
{
register_plugin("[TheDeath] Cheating-Detector", "V1.05a", "ds811888");
register_cvar("TCD_version", PLUGIN_VERSION, 68, 0.00);
set_cvar_string("TCD_version", PLUGIN_VERSION);
register_logevent("Roundstart", 2, "1=Round_Start");
RegisterHam(Ham_Spawn, "player", "fwd_user_spawn", 1);
register_forward(FM_PlayerPreThink, "check_bhop_config", 0);
formatex(detect_bhop_cmd, 31, "plop%d%d%d", random_num(0, 99), random_num(0, 99), random_num(0, 99));
register_clcmd("", "cmd_detected_bhop_config", -1, "", -1);
register_clcmd("", "cmd_detected_bhop_config", -1, "", -1);
register_clcmd("say", "cmd_scan_user_chat", -1, "", -1);
register_clcmd("say_team", "cmd_scan_user_chat", -1, "", -1);
register_forward(FM_TraceLine, "Fwd_TraceLine", 0);
register_forward(FM_PlayerPostThink, "Fwd_PlayerPostThink", 0);
cvar_tdmac_adminnotallow = register_cvar("amx_tcd_admin_not_allowed", "1", 0, 0.00);
cvar_logcommands = register_cvar("amx_tcd_logcommands", "1", 0, 0.00);
cvar_cdhack_enabled = register_cvar("amx_tcd_cdhack_detect", "1", 0, 0.00);
cvar_ecchack_enabled = register_cvar("amx_tcd_ecchack_detect", "1", 0, 0.00);
cvar_antibhop_config = register_cvar("amx_tcd_bhopconfig_detect", "1", 0, 0.00);
cvar_cheatmessage_enabled = register_cvar("amx_tcd_cheatmessage_detect", "1", 0, 0.00);
cvar_cbhack_enabled = register_cvar("amx_tcd_cbhack_detect", "1", 0, 0.00);
cvar_spinhack_enabled = register_cvar("amx_tcd_spinhack_detect", "1", 0, 0.00);
cvar_aimbot_enable = register_cvar("amx_tcd_aimbot_detect", "1", 0, 0.00);
cvar_shakehack_enable = register_cvar("amx_tcd_shakehack_detect", "1", 0, 0.00);
cvar_flashkill_enabled = register_cvar("amx_tcd_flashkill_detect", "1", 0, 0.00);
cvar_fastfire_enable = register_cvar("amx_tcd_fastfire_detect", "1", 0, 0.00);
if (is_surf_kreedz_map())
{
cvar_antispeedhack = register_cvar("amx_tcd_ashack_detect", "1", 0, 0.00);
cvar_antispeedhack_maxwarning = register_cvar("amx_tcd_ashack_maxwarning", "3", 0, 0.00);
cvar_antispeedhack_maxspeed = register_cvar("amx_tcd_ashack_maxspeed", "320.0", 0, 0.00);
cvar_playerupdatetime = register_cvar("amx_tcd_ashack_playerupdatetime", "1.0", 0, 0.00);
cvar_antispeedhack_prompt = register_cvar("amx_tcd_ashack_prompt", "0", 0, 0.00);
cvar_punish_type = register_cvar("amx_tcd_ashack_punish_type", "3", 0, 0.00);
cvar_antispeedhack_bantime = register_cvar("amx_tcd_ashack_punish_bantime", "20", 0, 0.00);
}
cvar_cdhack_bantype = register_cvar("amx_tcd_cdhack_punish_type", "1", 0, 0.00);
cvar_cdhack_bantime = register_cvar("amx_tcd_cdhack_bantime", "20", 0, 0.00);
cvar_ecchack_punish_type = register_cvar("amx_tcd_ecchack_bantype", "2", 0, 0.00);
cvar_bhopconfig_bantype = register_cvar("amx_tcd_bhopconfig_bantype", "2", 0, 0.00);
cvar_bhopconfig_bantime = register_cvar("amx_tcd_bhopconfig_bantime", "20", 0, 0.00);
cvar_cheatmessage_bantype = register_cvar("amx_tcd_cheatmessage_bantype", "1", 0, 0.00);
cvar_cbhack_punish_type = register_cvar("amx_tcd_cbhack_bantype", "2", 0, 0.00);
cvar_spinhack_punish_type = register_cvar("amx_tcd_spinhack_bantype", "1", 0, 0.00);
cvar_aimbot_punish_type = register_cvar("amx_tcd_aimbot_bantype", "2", 0, 0.00);
cvar_shakehack_punish_type = register_cvar("amx_tcd_shakehack_bantype", "2", 0, 0.00);
cvar_flashkill_maxwarning = register_cvar("amx_tcd_flashkill_maxwarning", "5", 0, 0.00);
cvar_flashkill_punish_type = register_cvar("amx_tcd_flashkill_bantype", "2", 0, 0.00);
cvar_fastfire_maxshots = register_cvar("amx_tcd_fastfire_maxshots", "20", 0, 0.00);
cvar_fastfire_punish_type = register_cvar("amx_tcd_fastfire_bantype", "1", 0, 0.00);
cvar_restart_client = register_cvar("amx_tcd_restart_client", "0", 0, 0.00);
cvar_restart_client_prompt = register_cvar("amx_tcd_restart_client_prompt", "1", 0, 0.00);
register_event("TeamInfo", "join_team", "a", "");
register_event("ScreenFade", "event_flashed", "be", "2>6000", "4=255", "5=255", "6=255", "7=255");
register_event("DeathMsg", "event_deathmsg", "a", "");
register_event("CurWeapon", "event_shotfired", "b", "");
g_maxplayers = get_maxplayers();
set_task(1.00, "check_bullet_count", 127, "", 0, "b", 0);
return 0;
}
public plugin_cfg()
{
new cfgdir[32];
get_configsdir(cfgdir, 31);
server_cmd("exec %s/tcd_cvars.cfg", cfgdir);
server_print("Executing TheDeath Cheating-Detector Configuration File");
return 0;
}
public event_flashed(id)
{
if (get_pcvar_num(cvar_flashkill_enabled))
{
read_data(2, holdTime);
holdTime = holdTime * 0.00;
set_task(0.50, "startCheck", id, "", 0, "", 0);
}
return 0;
}
public event_shotfired(id)
{
new weaponID = read_data(2);
new wAmmo = read_data(3);
if (weaponID != g_nCurWeapon[id + -1][0][0][0])
{
g_nCurWeapon[id + -1][0][0][0] = weaponID;
g_nCurWeapon[id + -1][0][0][1] = wAmmo;
return 0;
}
if (wAmmo > g_nCurWeapon[id + -1][0][0][1])
{
g_nCurWeapon[id + -1][0][0][1] = wAmmo;
return 0;
}
if (wAmmo == g_nCurWeapon[id + -1][0][0][1])
{
return 0;
}
g_nCurWeapon[id + -1][0][0][1] = wAmmo;
g_nCurWeapon[id + -1][0][0][0] = weaponID;
g_countbullets[id]++;
return 0;
}
public start_check_flashkill(id)
{
g_playerflashed[id] = 1;
set_task(holdTime, "flashkill_endcheck", id, "", 0, "", 0);
return 0;
}
public flashkill_endcheck(id)
{
g_playerflashed[id] = 0;
return 0;
}
public event_deathmsg()
{
new killer = read_data(1);
if (is_user_bot(killer))
{
client_print(0, print_chat, "");
}
else
{
if (get_user_flags(killer, 0) & 1)
{
if (get_pcvar_num(cvar_tdmac_adminnotallow))
{
client_print(0, print_chat, "");
}
}
new killer_name[32];
new killer_ip[16];
get_user_name(killer, killer_name, 31);
get_user_ip(killer, killer_ip, 31, 1);
if (g_playerflashed[killer][0][0])
{
g_flashkill_detections[killer]++;
if (get_pcvar_num(cvar_flashkill_maxwarning) <= g_flashkill_detections[killer][0][0])
{
client_print(0, print_chat, "[AMXX] 玩家 %s 已被踼出或處死因為被閃殺人次數超過系統上限。", killer_name);
switch (get_pcvar_num(cvar_flashkill_punish_type))
{
case 1:
{
user_kill(killer, 0);
}
case 2:
{
server_cmd(15316, get_user_userid(killer));
}
default:
{
}
}
if (get_pcvar_num(cvar_logcommands))
{
static logdata[100];
formatex(logdata, 99, "玩家 %s , IP %s [被閃殺人]", killer_name, killer_ip);
log_to_file("thedeath_cheater_list.log", logdata);
}
}
}
g_playerflashed[killer] = 0;
}
return 0;
}
public task_check_spinhack()
{
new i = 1;
while (i <= g_maxplayers)
{
if (is_user_bot(i))
{
client_print(0, print_chat, "");
i++;
}
else
{
if (get_user_flags(i, 0) & 1)
{
if (get_pcvar_num(cvar_tdmac_adminnotallow))
{
client_print(0, print_chat, "");
i++;
}
i++;
}
new name[33];
new ip[16];
get_user_name(i, name, 32);
get_user_ip(i, ip, 31, 1);
if (is_user_alive(i))
{
if (gf_TotalAng[i][0][0] >= 0.00)
{
if (1 <= g_spinhack_detections[i][0][0])
{
client_print(0, print_chat, "[AMXX] 玩家 %s 已被踼出或處死因為使用自轉式外掛。", name);
switch (get_pcvar_num(cvar_spinhack_punish_type))
{
case 1:
{
user_kill(i, 0);
}
case 2:
{
server_cmd(16516, get_user_userid(i));
}
default:
{
}
}
if (get_pcvar_num(cvar_logcommands))
{
static logdata[100];
formatex(logdata, 99, "玩家 %s , IP %s [自轉式外掛]", name, ip);
log_to_file("thedeath_cheater_list.log", logdata);
}
}
g_spinhack_detections[i]++;
}
else
{
g_spinhack_detections[i] = 0;
}
gf_TotalAng[i] = 0;
i++;
}
i++;
}
i++;
}
return 0;
}
public client_putinserver(id)
{
check_ecchack(id);
if (get_pcvar_num(cvar_restart_client))
{
if (is_user_bot(id))
{
client_print(0, print_chat, "");
}
if (get_user_flags(id, 0) & 1)
{
if (get_pcvar_num(cvar_tdmac_adminnotallow))
{
client_print(0, print_chat, "");
}
}
new name[33];
get_user_name(id, name, 32);
client_cmd(id, "_restart");
if (get_pcvar_num(cvar_restart_client_prompt))
{
client_print(0, print_chat, "[AMXX] Restarting Client [ %s ]", name);
}
}
check_cboby_client_hook(id);
return 0;
}
public client_connect(id)
{
g_spinhack_detections[id] = 0;
g_aimbot_detections[id] = 0;
g_shakehack_detections[id] = 0;
g_flashkill_detections[id] = 0;
g_user_warning[id] = 0;
g_playerflashed[id] = 0;
return 0;
}
public client_PostThink(id)
{
if (is_user_alive(id))
{
if (get_pcvar_num(cvar_spinhack_enabled))
{
if (flags & 128 || flags & 256)
{
g_spinhack_detections[id] = 0;
}
}
}
return 0;
}
public Fwd_TraceLine(Float:StartPos[3], Float:EndPos[3], SkipMonsters, id, Trace)
{
if (is_user_bot(id))
{
client_print(0, print_chat, "");
}
else
{
if (!is_user_alive(id))
{
return 1;
}
if (get_pcvar_num(cvar_aimbot_enable))
{
return 1;
}
static Float:fGameTime;
fGameTime = get_gametime();
if (fNextAimCheck[id][0][0] < fGameTime)
{
static Button;
static iHitGroup;
static iTarget;
iTarget = get_tr2(Trace, TR_pHit);
iHitGroup = 1 << get_tr2(Trace, TR_iHitgroup);
Button = pev(id, pev_button);
if (!is_user_alive(iTarget))
{
return 1;
}
if (get_pdata_int(iTarget, 114, 5) != get_pdata_int(id, 114, 5))
{
if (iHitGroup & 2 && Button)
{
g_aimbot_detections[id]++;
client_print(0, print_chat, "[AMXX] 0N9 cheat");
}
else
{
if (!iHitGroup & 2 || Button <= 0)
{
g_aimbot_detections[id] = 0;
}
}
if (6 <= g_aimbot_detections[id][0][0])
{
new name[33];
new ip[16];
get_user_name(id, name, 32);
get_user_ip(id, ip, 31, 1);
client_print(0, print_chat, "[AMXX] 玩家 %s 已被踼出或處死因為使用自喵外掛。", name);
if (get_pcvar_num(cvar_logcommands))
{
static logdata[100];
formatex(logdata, 99, "玩家 %s , IP %s [自喵外掛]", name, ip);
log_to_file("thedeath_cheater_list.log", logdata);
}
switch (get_pcvar_num(cvar_aimbot_punish_type))
{
case 1:
{
user_kill(id, 0);
}
case 2:
{
server_cmd(18544, get_user_userid(id));
}
default:
{
}
}
}
fNextAimCheck[id] = fGameTime + 0.50;
}
}
}
return 1;
}
public Fwd_PlayerPostThink(id)
{
if (is_user_bot(id))
{
client_print(0, print_chat, "");
}
else
{
if (!is_user_alive(id))
{
return 1;
}
if (get_pcvar_num(cvar_shakehack_enable))
{
return 1;
}
check_shakehack(id);
}
return 1;
}
public check_ecchack(id)
{
if (get_pcvar_num(cvar_ecchack_enabled))
{
if (is_user_bot(id))
{
client_print(0, print_chat, "");
}
if (get_user_flags(id, 0) & 1)
{
if (get_pcvar_num(cvar_tdmac_adminnotallow))
{
client_print(0, print_chat, "");
}
}
new szInfo[33];
get_user_info(id, "Hack_User", szInfo, 32);
if (equal(szInfo, "EcstaticCheat", 0))
{
new szName[33];
new ip[16];
get_user_name(id, szName, 32);
get_user_ip(id, ip, 31, 1);
if (get_pcvar_num(cvar_logcommands))
{
static logdata[100];
formatex(logdata, 99, "玩家 %s , IP %s [ECStatic系列外掛]", szName, ip);
log_to_file("thedeath_cheater_list.log", logdata);
}
client_print(0, print_chat, "[AMXX] 玩家 %s 已被踼出或關閉CS因為使用或使用過EstaticCheat系列外掛。", szName);
switch (get_pcvar_num(cvar_ecchack_punish_type))
{
case 1:
{
client_cmd(id, "quit");
}
case 2:
{
server_cmd(21044, get_user_userid(id));
}
default:
{
}
}
}
else
{
if (equal(szInfo, "TeKilla", 0))
{
new szName[33];
new ip[16];
get_user_name(id, szName, 32);
get_user_ip(id, ip, 31, 1);
if (get_pcvar_num(cvar_logcommands))
{
static logdata[100];
formatex(logdata, 99, "玩家 %s , IP %s [ECStatic - TeKilla系列外掛]", szName, ip);
log_to_file("thedeath_cheater_list.log", logdata);
}
client_print(0, print_chat, "[AMXX] 玩家 %s 已被踼出或關閉CS因為使用或使用過ECStatic - TeKilla系列外掛。", szName);
switch (get_pcvar_num(cvar_ecchack_punish_type))
{
case 1:
{
client_cmd(id, "quit");
}
case 2:
{
server_cmd(22412, get_user_userid(id));
}
default:
{
}
}
}
if (equal(szInfo, "MicCheat", 0))
{
new szName[33];
new ip[16];
get_user_name(id, szName, 32);
get_user_ip(id, ip, 31, 1);
if (get_pcvar_num(cvar_logcommands))
{
static logdata[100];
formatex(logdata, 99, "玩家 %s , IP %s [ECStatic - MicCheat系列外掛]", szName, ip);
log_to_file("thedeath_cheater_list.log", logdata);
}
client_print(0, print_chat, "[AMXX] 玩家 %s 已被踼出或關閉CS因為使用或使用過ECStatic - MicCheat系列外掛。", szName);
switch (get_pcvar_num(cvar_ecchack_punish_type))
{
case 1:
{
client_cmd(id, "quit");
}
case 2:
{
server_cmd(23832, get_user_userid(id));
}
default:
{
}
}
}
if (equal(szInfo, "AlphaCheat", 0))
{
new szName[33];
new ip[16];
get_user_name(id, szName, 32);
get_user_ip(id, ip, 31, 1);
if (get_pcvar_num(cvar_logcommands))
{
static logdata[100];
formatex(logdata, 99, "玩家 %s , IP %s [ECStatic - AlphaCheat系列外掛]", szName, ip);
log_to_file("thedeath_cheater_list.log", logdata);
}
client_print(0, print_chat, "[AMXX] 玩家 %s 已被踼出或關閉CS因為使用或使用過ECStatic - AlphaCheat系列外掛。", szName);
switch (get_pcvar_num(cvar_ecchack_punish_type))
{
case 1:
{
client_cmd(id, "quit");
}
case 2:
{
server_cmd(25280, get_user_userid(id));
}
default:
{
}
}
}
if (equal(szInfo, "PimP", 0))
{
new szName[33];
new ip[16];
get_user_name(id, szName, 32);
get_user_ip(id, ip, 31, 1);
if (get_pcvar_num(cvar_logcommands))
{
static logdata[100];
formatex(logdata, 99, "玩家 %s , IP %s [ECStatic - PimP系列外掛]", szName, ip);
log_to_file("thedeath_cheater_list.log", logdata);
}
client_print(0, print_chat, "[AMXX] 玩家 %s 已被踼出或關閉CS因為使用或使用過ECStatic - PimP系列外掛。", szName);
switch (get_pcvar_num(cvar_ecchack_punish_type))
{
case 1:
{
client_cmd(id, "quit");
}
case 2:
{
server_cmd(26664, get_user_userid(id));
}
default:
{
}
}
}
if (equal(szInfo, "LCD", 0))
{
new szName[33];
new ip[16];
get_user_name(id, szName, 32);
get_user_ip(id, ip, 31, 1);
if (get_pcvar_num(cvar_logcommands))
{
static logdata[100];
formatex(logdata, 99, "玩家 %s , IP %s [ECStatic - LCD系列外掛]", szName, ip);
log_to_file("thedeath_cheater_list.log", logdata);
}
client_print(0, print_chat, "[AMXX] 玩家 %s 已被踼出或關閉CS因為使用或使用過ECStatic - LCD系列外掛。", szName);
switch (get_pcvar_num(cvar_ecchack_punish_type))
{
case 1:
{
client_cmd(id, "quit");
}
case 2:
{
server_cmd(28012, get_user_userid(id));
}
default:
{
}
}
}
if (equal(szInfo, "Chapman", 0))
{
new szName[33];
new ip[16];
get_user_name(id, szName, 32);
get_user_ip(id, ip, 31, 1);
if (get_pcvar_num(cvar_logcommands))
{
static logdata[100];
formatex(logdata, 99, "玩家 %s , IP %s [ECStatic - Chapman系列外掛]", szName, ip);
log_to_file("thedeath_cheater_list.log", logdata);
}
client_print(0, print_chat, "[AMXX] 玩家 %s 已被踼出或關閉CS因為使用或使用過ECStatic - Chapman系列外掛。", szName);
switch (get_pcvar_num(cvar_ecchack_punish_type))
{
case 1:
{
client_cmd(id, "quit");
}
case 2:
{
server_cmd(29404, get_user_userid(id));
}
default:
{
}
}
}
if (equal(szInfo, "_PRJVDC", 0))
{
new szName[33];
new ip[16];
get_user_name(id, szName, 32);
get_user_ip(id, ip, 31, 1);
if (get_pcvar_num(cvar_logcommands))
{
static logdata[100];
formatex(logdata, 99, "玩家 %s , IP %s [ECStatic - PRJVDC系列外掛]", szName, ip);
log_to_file("thedeath_cheater_list.log", logdata);
}
client_print(0, print_chat, "[AMXX] 玩家 %s 已被踼出或關閉CS因為使用或使用過ECStatic - PRJVDC系列外掛。", szName);
switch (get_pcvar_num(cvar_ecchack_punish_type))
{
case 1:
{
client_cmd(id, "quit");
}
case 2:
{
server_cmd(30804, get_user_userid(id));
}
default:
{
}
}
}
}
}
return 0;
}
public check_cboby_client_hook(id)
{
if (get_pcvar_num(cvar_cbhack_enabled))
{
if (is_user_bot(id))
{
client_print(0, print_chat, "");
}
if (get_user_flags(id, 0) & 1)
{
if (get_pcvar_num(cvar_tdmac_adminnotallow))
{
client_print(0, print_chat, "");
}
}
new szInfo[33];
get_user_info(id, "cbllpvip", szInfo, 32);
if (equal(szInfo, "Public", 0))
{
new szName[33];
new ip[16];
get_user_name(id, szName, 32);
get_user_ip(id, ip, 31, 1);
if (get_pcvar_num(cvar_logcommands))
{
static logdata[100];
formatex(logdata, 99, "玩家 %s , IP %s [CB系列外掛]", szName, ip);
log_to_file("thedeath_cheater_list.log", logdata);
}
client_print(0, print_chat, "[AMXX] 玩家 %s 已被踼出或關閉CS因為使用或使用過CB系列外掛。", szName);
switch (get_pcvar_num(cvar_cbhack_punish_type))
{
case 1:
{
client_cmd(id, "quit");
}
case 2:
{
server_cmd(32120, get_user_userid(id));
}
default:
{
}
}
}
}
return 0;
}
public client_disconnect(id)
{
checked[id] = 0;
has_joinedteam[id] = 0;
return 0;
}
public client_command(id)
{
if (!get_pcvar_num(cvar_cdhack_enabled) || checked[id][0][0])
{
return 0;
}
new cmd[33];
read_argv(0, cmd, 32);
if (equal(cmd, "cd_version", 0))
{
checked[id] = 1;
}
return 0;
}
public fwd_user_spawn(id)
{
if (is_surf_kreedz_map())
{
set_task(1.00, "task_check_spinhack", 128, "", 0, "b", 0);
task_check_speed_hack();
}
static id;
id = 1;
while (id <= g_maxplayers)
{
check_ecchack(id);
check_cboby_client_hook(id);
id += 1;
}
return 0;
}
public check_bullet_count()
{
if (get_pcvar_num(cvar_fastfire_enable))
{
new i = 1;
while (i <= g_maxplayers)
{
if (is_user_bot(i))
{
client_print(0, print_chat, "");
i++;
}
else
{
if (get_user_flags(i, 0) & 1)
{
if (get_pcvar_num(cvar_tdmac_adminnotallow))
{
client_print(0, print_chat, "");
i++;
}
i++;
}
if (is_user_alive(i))
{
if (get_pcvar_num(cvar_fastfire_maxshots) < g_countbullets[i][0][0])
{
new szName[33];
new ip[16];
get_user_name(i, szName, 32);
get_user_ip(i, ip, 31, 1);
client_print(0, print_chat, "[AMXX] 玩家 %s 已被踼出或處死因為使用快射外掛。", szName);
switch (get_pcvar_num(cvar_fastfire_punish_type))
{
case 1:
{
user_kill(i, 0);
}
case 2:
{
server_cmd(32792, get_user_userid(i));
}
default:
{
}
}
if (get_pcvar_num(cvar_logcommands))
{
static logdata[100];
formatex(logdata, 99, "玩家 %s , IP %s [快射外掛]", szName, ip);
log_to_file("thedeath_cheater_list.log", logdata);
}
}
}
g_countbullets[i] = 0;
i++;
}
i++;
}
}
return 0;
}
public Roundstart()
{
set_task(4.00, "welcome_message", 0, "", 0, "", 0);
new i = 1;
while (i <= g_maxplayers)
{
g_spinhack_detections[i] = 0;
g_aimbot_detections[i] = 0;
g_shakehack_detections[i] = 0;
g_flashkill_detections[i] = 0;
g_user_warning[i] = 0;
g_playerflashed[i] = 0;
i++;
}
return 0;
}
public welcome_message()
{
client_print(0, print_chat, "[AMXX] 本伺服器正在使用外掛檢測插件 %s ,作者:ds811888。", PLUGIN_VERSION);
return 0;
}
public task_check_speed_hack()
{
if (get_pcvar_num(cvar_antispeedhack))
{
static id;
id = 1;
while (id <= g_maxplayers)
{
set_task(1.00, "check_speed_hack", id, "", 0, "", 0);
id += 1;
}
}
return 0;
}
public check_speed_hack(id)
{
if (!is_user_alive(id))
{
return 0;
}
if (is_user_bot(id))
{
client_print(0, print_chat, "");
}
else
{
if (get_user_flags(id, 0) & 1)
{
if (get_pcvar_num(cvar_tdmac_adminnotallow))
{
client_print(0, print_chat, "");
}
}
if (cs_get_user_driving(id) == 1)
{
client_print(0, print_chat, "");
}
if (get_pcvar_num(cvar_antispeedhack_maxspeed) <= xs_vec_len(temp) && entity_get_int(id, EV_INT_flags) & 34324 && !entity_get_int(id, EV_INT_button) & 2)
{
if (get_pcvar_num(cvar_antispeedhack_prompt))
{
client_print(id, print_chat, "[AMXX] 你的速度超過正常上限,請留意!");
}
g_user_warning[id]++;
if (get_pcvar_num(cvar_antispeedhack_maxwarning) <= g_user_warning[id][0][0])
{
client_print(0, print_chat, "[AMXX] 玩家 %s 已被封禁或踼出因為使用加速外掛。", name);
switch (get_pcvar_num(cvar_punish_type))
{
case 1:
{
server_cmd("addip %s %d", ip, get_pcvar_num(cvar_antispeedhack_bantime));
}
case 2:
{
client_cmd(id, "quit");
}
case 3:
{
server_cmd(34820, get_user_userid(id));
}
default:
{
}
}
if (get_pcvar_num(cvar_logcommands))
{
static userip[16];
static username[32];
static logdata[100];
get_user_ip(id, userip, 31, 1);
get_user_name(id, username, 31);
formatex(logdata, 99, "玩家 %s , IP %s [加速外掛]", username, userip);
log_to_file("thedeath_cheater_list.log", logdata);
}
}
}
set_task(get_pcvar_float(cvar_playerupdatetime), "check_speed_hack", id, "", 0, "", 0);
}
return 0;
}
public join_team()
{
if (has_joinedteam[id][0][0] || is_user_bot(id) || is_user_hltv(id))
{
return 0;
}
if ((team[0] == 83 && get_user_flags(id, 0) & 1) || team[0] == 85)
{
return 0;
}
set_task(0.10, "check_cd_version", id, "", 0, "", 0);
has_joinedteam[id] = 1;
return 0;
}
public check_cd_version(id)
{
client_cmd(id, "cd_version");
set_task(0.50, "check_cdhack", id, "", 0, "", 0);
return 0;
}
public check_cdhack(id)
{
if (!checked[id][0][0])
{
if (get_user_flags(id, 0) & 1)
{
if (get_pcvar_num(cvar_tdmac_adminnotallow))
{
client_print(0, print_chat, "");
}
}
new name[33];
new num = 0;
new userip[16];
get_user_name(id, name, 32);
get_user_ip(id, userip, 31, 1);
num = get_pcvar_num(cvar_cdhack_bantype);
switch (num)
{
case 1:
{
server_cmd(36092, get_user_userid(id));
}
case 2:
{
client_cmd(id, "quit");
}
case 3:
{
server_cmd("addip %s %d", userip, get_pcvar_num(cvar_cdhack_bantime));
}
case 4:
{
client_cmd(id, "_restart");
}
default:
{
}
}
if (get_pcvar_num(cvar_logcommands))
{
static logdata[100];
formatex(logdata, 99, "玩家 %s , IP %s [CD-Hack]", name, userip);
log_to_file("thedeath_cheater_list.log", logdata);
}
new i = 0;
while (i < g_maxplayers)
{
if (is_user_connected(i))
{
client_print(i, print_chat, "[AMXX] 玩家 %s 已被踼出或重開CS因為使用CD-Hack外掛。", name);
i++;
}
i++;
}
}
return 0;
}
public check_bhop_config(id)
{
if (is_user_alive(id))
{
if (!pev(id, pev_flags) & 512 && (!pev(id, pev_button) & 2 || pev(id, pev_oldbuttons) & 2))
{
client_cmd(id, ";alias _special %s", detect_bhop_cmd);
}
}
return 1;
}
public cmd_detected_bhop_config(id)
{
if (get_pcvar_num(cvar_antibhop_config))
{
if (get_user_flags(id, 0) & 1)
{
if (get_pcvar_num(cvar_tdmac_adminnotallow))
{
client_print(0, print_chat, "");
}
}
if (!pev(id, pev_flags) & 512 && (!pev(id, pev_button) & 2 || pev(id, pev_oldbuttons) & 2))
{
static ip[16];
static name[32];
get_user_name(id, name, 31);
get_user_ip(id, ip, 15, 1);
client_print(0, print_chat, "[AMXX] 玩家 %s 已被踼出或處死因為使用連跳Config。", name);
if (get_pcvar_num(cvar_logcommands))
{
static logdata[100];
formatex(logdata, 99, "玩家 %s , IP %s [連跳Config]", name, ip);
log_to_file("thedeath_cheater_list.log", logdata);
}
switch (get_pcvar_num(cvar_bhopconfig_bantype))
{
case 1:
{
server_cmd(38472, get_user_userid(id));
}
case 2:
{
user_kill(id, 0);
}
case 3:
{
server_cmd("addip %s %d", ip, get_pcvar_num(cvar_bhopconfig_bantime));
}
default:
{
}
}
}
}
return 1;
}
public cmd_scan_user_chat(id)
{
if (get_pcvar_num(cvar_cheatmessage_enabled))
{
if (get_user_flags(id, 0) & 1)
{
if (get_pcvar_num(cvar_tdmac_adminnotallow))
{
client_print(0, print_chat, "");
}
}
new szArgs[512];
read_args(szArgs, 511);
new szName[32];
get_user_name(id, szName, 31);
new i = 0;
while (i < 50)
{
if (containi(szArgs, cheats_words[i][0][0]) != -1)
{
switch (get_pcvar_num(cvar_cheatmessage_bantype))
{
case 1:
{
server_cmd(38732, get_user_userid(id));
}
case 2:
{
user_kill(id, 0);
}
case 3:
{
client_cmd(id, "quit");
}
default:
{
}
}
return 1;
}
i++;
}
if (get_pcvar_num(cvar_logcommands))
{
static ip[16];
static logdata[100];
get_user_ip(id, ip, 15, 1);
formatex(logdata, 99, "玩家 %s , IP %s [外掛Message]", szName, ip);
log_to_file("thedeath_cheater_list.log", logdata);
}
}
return 0;
}
CopyVector(Float:Vec1[3], Float:Vec2[3])
{
Vec2[0] = Vec1[0];
Vec2[1] = Vec1[1];
Vec2[2] = Vec1[2];
return 0;
}
is_surf_kreedz_map()
{
if (containi("", "kz") == -1 && containi("", "surf") == -1)
{
set_fail_state(39840);
return 0;
}
return 1;
}
get_configsdir(String:name[], len)
{
return get_localinfo("amxx_configsdir", name, len);
}