added option to disable aimbot detection for anti-cheat

This commit is contained in:
nullifiedcat 2017-07-05 17:26:18 +03:00
parent fe0a7dd879
commit ef04124606
2 changed files with 4 additions and 0 deletions

View File

@ -10,6 +10,7 @@
namespace ac { namespace aimbot { namespace ac { namespace aimbot {
static CatVar enabled(CV_SWITCH, "ac_aimbot", "0", "Detect Aimbot", "Is not recommended");
static CatVar detect_angle(CV_FLOAT, "ac_aimbot_angle", "30", "Aimbot Angle"); static CatVar detect_angle(CV_FLOAT, "ac_aimbot_angle", "30", "Aimbot Angle");
static CatVar detections_warning(CV_INT, "ac_aimbot_detections", "3", "Min detections to warn"); static CatVar detections_warning(CV_INT, "ac_aimbot_detections", "3", "Min detections to warn");
@ -28,6 +29,7 @@ void Init() {
} }
void Update(CachedEntity* player) { void Update(CachedEntity* player) {
if (not enabled) return;
auto& data = data_table[player->m_IDX - 1]; auto& data = data_table[player->m_IDX - 1];
if (data.check_timer) { if (data.check_timer) {
data.check_timer--; data.check_timer--;
@ -58,6 +60,7 @@ void Update(CachedEntity* player) {
} }
void Event(KeyValues* event) { void Event(KeyValues* event) {
if (not enabled) return;
if (!strcmp(event->GetName(), "player_death") || !strcmp(event->GetName(), "player_hurt")) { if (!strcmp(event->GetName(), "player_death") || !strcmp(event->GetName(), "player_hurt")) {
int attacker = event->GetInt("attacker"); int attacker = event->GetInt("attacker");
int victim = event->GetInt("userid"); int victim = event->GetInt("userid");

View File

@ -383,6 +383,7 @@
"ac_enabled", "ac_enabled",
"ac_ignore_local", "ac_ignore_local",
"ac_chat", "ac_chat",
"ac_aimbot",
"ac_aimbot_detections", "ac_aimbot_detections",
"ac_aimbot_angle", "ac_aimbot_angle",
"ac_removecond", "ac_removecond",