- Fixed css_warn (unfreeze player after 5s)
- Fixed server loading from database (reduced delay)
- Added checking the player in an earlier phase of the connection
- Fixed admin name when using action from menu
This commit is contained in:
Dawid Bepierszcz
2024-12-16 01:55:38 +01:00
parent 8c94a867d3
commit 8af805632a
11 changed files with 111 additions and 25 deletions

View File

@@ -56,7 +56,9 @@ public partial class CS2_SimpleAdmin
if (!CheckValidBan(caller, time)) return;
// Set default caller name if not provided
callerName ??= _localizer?["sa_console"] ?? "Console";
callerName = !string.IsNullOrEmpty(caller?.PlayerName)
? caller.PlayerName
: (_localizer?["sa_console"] ?? "Console");
// Freeze player pawn if alive
if (player.PawnIsAlive)
@@ -321,12 +323,15 @@ public partial class CS2_SimpleAdmin
if (!CheckValidBan(caller, time)) return;
// Set default caller name if not provided
callerName ??= _localizer?["sa_console"] ?? "Console";
callerName = !string.IsNullOrEmpty(caller?.PlayerName)
? caller.PlayerName
: (_localizer?["sa_console"] ?? "Console");
// Freeze player pawn if alive
if (player.PawnIsAlive)
{
player.Pawn.Value?.Freeze();
AddTimer(5.0f, () => player.Pawn.Value?.Unfreeze(), CounterStrikeSharp.API.Modules.Timers.TimerFlags.STOP_ON_MAPCHANGE);
}
// Get player and admin information