zio fork 1.8.2b-zio7: guardian rank tag, ranks on private messages
#rank/guardian shows as G, after the staff ranks so a staff rank wins. css_psay from a player
reads "(PM) [RANK] name: message" ("(PM) name: message" without a rank group); console's is
unchanged. New lang keys sa_psay_template and sa_psay_template_norank.
This commit is contained in:
parent
e2b6670c5a
commit
703893a908
5 changed files with 19 additions and 5 deletions
|
|
@ -128,9 +128,16 @@ public partial class CS2_SimpleAdmin
|
|||
var utf8BytesString = Encoding.UTF8.GetBytes(message);
|
||||
var utf8String = Encoding.UTF8.GetString(utf8BytesString);
|
||||
|
||||
// zio: from a player, "(PM) [RANK] name: message".
|
||||
var rank = caller == null ? null : Helper.GetStaffRankTag(caller);
|
||||
var line = caller == null || _localizer == null
|
||||
? $"({callerName}) {utf8String}".ReplaceColorTags()
|
||||
: rank == null
|
||||
? _localizer["sa_psay_template_norank", callerName, utf8String.Trim()]
|
||||
: _localizer["sa_psay_template", rank, callerName, utf8String.Trim()];
|
||||
playersToTarget.ForEach(player =>
|
||||
{
|
||||
player.PrintToChat($"({callerName}) {utf8String}".ReplaceColorTags());
|
||||
player.PrintToChat(line);
|
||||
});
|
||||
|
||||
command.ReplyToCommand($" Private message sent!");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue