public static void EnforceViolations(BasePlayer ply)
 {
     if (ConVar.AntiHack.enforcementlevel <= 0)
     {
         return;
     }
     if (ply.violationLevel > ConVar.AntiHack.maxviolation)
     {
         if (ConVar.AntiHack.debuglevel >= 1)
         {
             AntiHack.LogToConsole(ply, ply.lastViolationType, string.Concat("Enforcing (violation of ", ply.violationLevel, ")"));
         }
         string str = string.Concat(ply.lastViolationType, " Violation Level ", ply.violationLevel);
         if (ConVar.AntiHack.enforcementlevel > 1)
         {
             AntiHack.Kick(ply, str);
             return;
         }
         AntiHack.Kick(ply, str);
     }
 }
Example #2
0
    public static void EnforceViolations(BasePlayer ply)
    {
        if (ConVar.AntiHack.enforcementlevel <= 0 || (double)ply.violationLevel <= (double)ConVar.AntiHack.maxviolation)
        {
            return;
        }
        if (ConVar.AntiHack.debuglevel >= 1)
        {
            AntiHack.LogToConsole(ply, ply.lastViolationType, "Enforcing (violation of " + (object)ply.violationLevel + ")");
        }
        string reason = ((int)ply.lastViolationType).ToString() + " Violation Level " + (object)ply.violationLevel;

        if (ConVar.AntiHack.enforcementlevel > 1)
        {
            AntiHack.Kick(ply, reason);
        }
        else
        {
            AntiHack.Kick(ply, reason);
        }
    }