From cf5c1d8440b9d805311733d2b3bc745d48dab092 Mon Sep 17 00:00:00 2001 From: Dawid Bepierszcz <41084667+daffyyyy@users.noreply.github.com> Date: Sun, 29 Sep 2024 18:42:04 +0200 Subject: [PATCH] Fixed? prename --- CS2-SimpleAdmin/Commands/playercommands.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/CS2-SimpleAdmin/Commands/playercommands.cs b/CS2-SimpleAdmin/Commands/playercommands.cs index 8e83e48..0ec46f3 100644 --- a/CS2-SimpleAdmin/Commands/playercommands.cs +++ b/CS2-SimpleAdmin/Commands/playercommands.cs @@ -637,7 +637,16 @@ public partial class CS2_SimpleAdmin // Check if the player is connected and can be targeted if (player.Connected != PlayerConnectedState.PlayerConnected || !caller!.CanTarget(player)) return; + + // Determine message key and arguments for the rename notification + var activityMessageKey = "sa_admin_rename_message"; + var adminActivityArgs = new object[] { "CALLER", player.PlayerName, newName }; + // Display admin activity message to other players + if (caller != null && SilentPlayers.Contains(caller.Slot)) return; + + Helper.ShowAdminActivity(activityMessageKey, callerName, adminActivityArgs); + // Determine if the new name is valid and update the renamed players list if (!string.IsNullOrEmpty(newName)) { @@ -648,15 +657,6 @@ public partial class CS2_SimpleAdmin { RenamedPlayers.Remove(player.SteamID); } - - // Determine message key and arguments for the rename notification - var activityMessageKey = "sa_admin_rename_message"; - var adminActivityArgs = new object[] { "CALLER", player.PlayerName, newName }; - - // Display admin activity message to other players - if (caller != null && SilentPlayers.Contains(caller.Slot)) return; - - Helper.ShowAdminActivity(activityMessageKey, callerName, adminActivityArgs); }); }