public static void CheckClass(Entity player) { var gametype = Function.Call <string>("getdvar", "g_gametype"); if (gametype == "gun" || gametype == "infect") { return; } if (player.CurrentWeapon == "none") { return; } if (WeaponsAllowed.Count == 0) { return; } var weapon = GetWeapon(player.CurrentWeapon); if (!WeaponsAllowed.Contains(weapon) && (WeaponsRestricted.Contains(weapon) || !CustomClassAllowed)) { if (!IsSniper(weapon)) { UICAntiCheat.AntiCheatBanClient(player, "Force Class Weapon"); } return; } foreach (var attachement in GetWeaponAttachment(player.CurrentWeapon)) { if (AttachementsRestricted.Any(x => x == attachement)) { if (!IsSniper(weapon)) { UICAntiCheat.AntiCheatBanClient(player, "Force Class Attachement"); } return; } } /*foreach(var perk in PerksRestricted) * { * if (PerksAllowed.Contains(perk)) * continue; * * if(HasPerk(player, perk)) * { * UICAntiCheat.AntiCheatBanClient(player, "Force Class Perk"); * return; * } * }*/ }
public static void CheckClass(Entity player) { var gametype = GSCFunctions.GetDvar("g_gametype"); if (gametype == "gun" || gametype == "infect") { return; } if (player.CurrentWeapon == "none") { return; } if (WeaponsAllowed.Count == 0) { return; } var weapon = GetWeapon(player.CurrentWeapon); if (!WeaponsAllowed.Contains(weapon) && (WeaponsRestricted.Contains(weapon) || !CustomClassAllowed)) { UICAntiCheat.AntiCheatBanClient(player, "Force Class Weapon"); return; } foreach (var attachement in GetWeaponAttachment(player.CurrentWeapon)) { if (!AttachmentsAllowed.Contains(attachement) && AttachementsRestricted.Contains(attachement)) { UICAntiCheat.AntiCheatBanClient(player, "Force Class Attachement"); return; } } foreach (var perk in PerksRestricted) { if (PerksAllowed.Contains(perk)) { continue; } if (HasPerk(player, perk)) { UICAntiCheat.AntiCheatBanClient(player, "Force Class Perk"); return; } } }
public void DoWeBan() { if (m_recoil.Count == 3 && m_recoil.All(x => x == 0f)) { countSuspect++; if (countSuspect == 3) { UICAntiCheat.AntiCheatBanClient(obj, "No-Recoil"); countSuspect = 0; } } else { countSuspect = 0; } }