public static void AddViolation(BasePlayer ply, AntiHackType type, float amount) { if (Interface.CallHook("OnPlayerViolation", ply, type, amount) != null) { return; } ply.lastViolationType = type; ply.lastViolationTime = UnityEngine.Time.realtimeSinceStartup; ply.violationLevel += amount; if (ConVar.AntiHack.debuglevel >= 2 && amount > 0f || ConVar.AntiHack.debuglevel >= 3) { AntiHack.LogToConsole(ply, type, string.Concat(new object[] { "Added violation of ", amount, " in frame ", UnityEngine.Time.frameCount, " (now has ", ply.violationLevel, ")" })); } AntiHack.EnforceViolations(ply); }
public static void AddViolation(BasePlayer ply, AntiHackType type, float amount) { if (Interface.CallHook("OnPlayerViolation", (object)ply, (object)type, (object)amount) != null) { return; } ply.lastViolationType = type; ply.lastViolationTime = Time.get_realtimeSinceStartup(); ply.violationLevel += amount; if (ConVar.AntiHack.debuglevel >= 2 && (double)amount > 0.0 || ConVar.AntiHack.debuglevel >= 3) { AntiHack.LogToConsole(ply, type, "Added violation of " + (object)amount + " in frame " + (object)Time.get_frameCount() + " (now has " + (object)ply.violationLevel + ")"); } AntiHack.EnforceViolations(ply); }