zio fork 1.8.2b-zio5: staff chat shows rank
Some checks are pending
Build and Publish / build (push) Waiting to run
Build and Publish / publish (push) Blocked by required conditions

@ in team chat and css_asay read ">[STAFF][RANK] name: message", and @ in all chat and a
player's css_say read ">[RANK] name: message", with the rank from the sender's highest #rank/...
group (O, SA, A, TA, M, TM, H). Staff in no rank group get ">[STAFF] name" and "> name". A
non-staff player's @ team chat reads ">[PLAYER] name: message". Console's messages are unchanged.
The lines are new en.json keys: sa_staffchat_template, sa_staffsay_template, their _norank
variants and sa_staffchat_template_player.
This commit is contained in:
Astra 2026-09-28 18:01:44 +01:00
parent bc6e32892d
commit 3c9f65e121
6 changed files with 69 additions and 7 deletions

View file

@ -376,7 +376,8 @@ public partial class CS2_SimpleAdmin
StringBuilder sb = new();
if (AdminManager.PlayerHasPermissions(new SteamID(player.SteamID), "@css/chat"))
{
sb.Append(_localizer!["sa_adminchat_template_admin", player.PlayerName, info.GetArg(1).Remove(0, 1)]);
// zio: ">[STAFF][RANK] name: message".
sb.Append(StaffChatMessage(player, info.GetArg(1).Remove(0, 1)));
foreach (var p in Utilities.GetPlayers().Where(p => p.IsValid && p is { IsBot: false, IsHLTV: false } && AdminManager.PlayerHasPermissions(new SteamID(p.SteamID), "@css/chat")))
{
p.PrintToChat(sb.ToString());
@ -384,7 +385,8 @@ public partial class CS2_SimpleAdmin
}
else
{
sb.Append(_localizer!["sa_adminchat_template_player", player.PlayerName, info.GetArg(1).Remove(0, 1)]);
// zio: ">[PLAYER] name: message".
sb.Append(_localizer!["sa_staffchat_template_player", player.PlayerName, info.GetArg(1).Remove(0, 1)]);
player.PrintToChat(sb.ToString());
foreach (var p in Utilities.GetPlayers().Where(p => p is { IsValid: true, IsBot: false, IsHLTV: false } && AdminManager.PlayerHasPermissions(new SteamID(p.SteamID), "@css/chat")))
{