diff --git a/CS2-Tags.cs b/CS2-Tags.cs index 09c5a4b..520de61 100644 --- a/CS2-Tags.cs +++ b/CS2-Tags.cs @@ -107,13 +107,15 @@ public class CS2_Tags : BasePlugin if (JsonTags != null && JsonTags.TryGetValue("tags", out var tags) && tags is JObject tagsObject) { + string deadIcon = !player.PawnIsAlive ? $"{ChatColors.White}☠ {ChatColors.Default}" : ""; + if (tagsObject.TryGetValue(steamid, out var playerTag) && playerTag is JObject) { string prefix = playerTag["prefix"]?.ToString() ?? ""; string? nickColor = !string.IsNullOrEmpty(playerTag?["nick_color"]?.ToString()) ? playerTag?["nick_color"]?.ToString() : $"{ChatColors.Default}"; string messageColor = playerTag?["message_color"]?.ToString() ?? $"{ChatColors.Default}"; - Server.PrintToChatAll(ReplaceTags($" {prefix}{nickColor}{player.PlayerName}{ChatColors.Default}: {messageColor}{info.GetArg(1)}", player.TeamNum)); + Server.PrintToChatAll(ReplaceTags($" {deadIcon}{prefix}{nickColor}{player.PlayerName}{ChatColors.Default}: {messageColor}{info.GetArg(1)}", player.TeamNum)); /* Temp fix for commands OLD if (info.GetArg(1).StartsWith("!") || info.GetArg(1).StartsWith("/")) @@ -143,7 +145,7 @@ public class CS2_Tags : BasePlugin string? nickColor = !string.IsNullOrEmpty(permissionTag?["nick_color"]?.ToString()) ? permissionTag?["nick_color"]?.ToString() : $"{ChatColors.Default}"; string messageColor = permissionTag?["message_color"]?.ToString() ?? $"{ChatColors.Default}"; - Server.PrintToChatAll(ReplaceTags($" {prefix}{nickColor}{player.PlayerName}{ChatColors.Default}: {messageColor}{info.GetArg(1)}", player.TeamNum)); + Server.PrintToChatAll(ReplaceTags($" {deadIcon}{prefix}{nickColor}{player.PlayerName}{ChatColors.Default}: {messageColor}{info.GetArg(1)}", player.TeamNum)); return HookResult.Handled; } @@ -157,7 +159,7 @@ public class CS2_Tags : BasePlugin string? nickColor = !string.IsNullOrEmpty(everyoneTag?["nick_color"]?.ToString()) ? everyoneTag?["nick_color"]?.ToString() : $"{ChatColors.Default}"; string messageColor = everyoneTag?["message_color"]?.ToString() ?? $"{ChatColors.Default}"; - Server.PrintToChatAll(ReplaceTags($" {prefix}{nickColor}{player.PlayerName}{ChatColors.Default}: {messageColor}{info.GetArg(1)}", player.TeamNum)); + Server.PrintToChatAll(ReplaceTags($" {deadIcon}{prefix}{nickColor}{player.PlayerName}{ChatColors.Default}: {messageColor}{info.GetArg(1)}", player.TeamNum)); return HookResult.Handled; } diff --git a/README.md b/README.md index 00ade1e..146dc6c 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,10 @@ ### Description Adds tags to the server that can be easily edited, tags can be assigned via permission or steamid64 -### Confiugration +### Commands +- css_tags_reload - Reload tags config + +### Configuration ``` { "tags": { @@ -58,6 +61,8 @@ In addons/counterstrikesharp/plugins/CS2-Tags/tags.json public static char Magenta = '\x0E'; public static char LightRed = '\x0F'; ``` + +```{TEAMCOLOR} - Team color``` Use color name for e.g. {LightRed} ### TODO