From 87813a5169ef12b29f5c809185db44f58984e2cd Mon Sep 17 00:00:00 2001 From: MSWS Date: Sat, 13 Jul 2024 23:29:12 -0700 Subject: [PATCH] Include rank name in rank command --- Core/[LR] Core.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Core/[LR] Core.cs b/Core/[LR] Core.cs index 9cc888e..55d0482 100644 --- a/Core/[LR] Core.cs +++ b/Core/[LR] Core.cs @@ -1051,7 +1051,7 @@ public void HandleRankCommand(CCSPlayerController? player, CommandInfo commandIn return; } - var searchTerm = commandInfo.ArgCount < 2 ? player.PlayerName : commandInfo.GetArg(1); + var searchTerm = commandInfo.ArgCount < 2 ? player.SteamID.ToString() : commandInfo.GetArg(1); bool isSteamId = searchTerm.All(char.IsDigit); Task.Run(async () => @@ -1060,6 +1060,7 @@ public void HandleRankCommand(CCSPlayerController? player, CommandInfo commandIn var totalPlayers = 0; var playerRank = 0; double kdr = 0; + string rank = ""; try { @@ -1079,12 +1080,13 @@ public void HandleRankCommand(CCSPlayerController? player, CommandInfo commandIn totalPlayers = rankAndTotalPlayers.totalPlayers; playerRank = rankAndTotalPlayers.playerRank; kdr = user.Deaths > 0 ? (double)user.Kills / user.Deaths : user.Kills; + rank = Localizer[$"rank_{user.Rank}"]; } var message = user == null ? ReplaceColorPlaceholders(Localizer["player_not_found", searchTerm]) : ReplaceColorPlaceholders(Localizer["player_stats", user.Name!, playerRank, totalPlayers, - user.Value, user.Kills, user.Deaths, kdr]); + user.Value, user.Kills, user.Deaths, kdr, rank]); Server.NextFrame(() => {