Skip to content

Commit

Permalink
Fixed? prename
Browse files Browse the repository at this point in the history
  • Loading branch information
daffyyyy committed Sep 29, 2024
1 parent efa2a39 commit cf5c1d8
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions CS2-SimpleAdmin/Commands/playercommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,16 @@ public void OnPrenameCommand(CCSPlayerController? caller, CommandInfo command)
// 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))
{
Expand All @@ -648,15 +657,6 @@ public void OnPrenameCommand(CCSPlayerController? caller, CommandInfo command)
{
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);
});
}

Expand Down

0 comments on commit cf5c1d8

Please sign in to comment.