- Plugin checks every minute if a player is banned
- Minor changes
- Removed bot_quota warning
- NET8
This commit is contained in:
Dawid Bepierszcz
2024-04-16 22:08:44 +02:00
parent 143f0b7e1b
commit 7a8fd066f7
9 changed files with 232 additions and 144 deletions

View File

@@ -409,7 +409,7 @@ namespace CS2_SimpleAdmin
player.Pawn.Value!.Freeze();
}
reason = reason ?? _localizer?["sa_unknown"] ?? "Unknown";
reason ??= _localizer?["sa_unknown"] ?? "Unknown";
if (command != null)
Helper.SendDiscordLogMessage(caller, command, _discordWebhookClientLog, _localizer);
@@ -423,12 +423,14 @@ namespace CS2_SimpleAdmin
player.PrintToCenter(_localizer!["sa_player_kick_message", reason, caller == null ? "Console" : caller.PlayerName]);
}
if (player.UserId.HasValue)
AddTimer(Config.KickTime, () => Helper.KickPlayer(player.UserId.Value, reason), CounterStrikeSharp.API.Modules.Timers.TimerFlags.STOP_ON_MAPCHANGE);
AddTimer(Config.KickTime, () => Helper.KickPlayer(player.UserId.Value, reason),
CounterStrikeSharp.API.Modules.Timers.TimerFlags.STOP_ON_MAPCHANGE);
}
else
{
if (player.UserId.HasValue)
AddTimer(Config.KickTime, () => Helper.KickPlayer(player.UserId.Value), CounterStrikeSharp.API.Modules.Timers.TimerFlags.STOP_ON_MAPCHANGE);
AddTimer(Config.KickTime, () => Helper.KickPlayer(player.UserId.Value),
CounterStrikeSharp.API.Modules.Timers.TimerFlags.STOP_ON_MAPCHANGE);
}
if (caller == null || caller != null && caller.UserId != null && !silentPlayers.Contains(caller.Slot))