roflmuffin / CounterStrikeSharp

CounterStrikeSharp allows you to write server plugins in C# for Counter-Strike 2/Source2/CS2

Home Page:https://docs.cssharp.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Chat colors not working for me

jmgraeffe opened this issue · comments

Hey, thanks for the awesome work!

I can't figure out why chat colors are not working for my plugins but for others they just work with the same code.

I tested the following methods, using 1.0.179 of CSSharp and JetBrains Rider 2023 as IDE:

[...]
        AddCommand("css_test", "", (player, info) =>
        {
            player!.PrintToChat($"{ChatColors.DarkRed}test");
            Server.PrintToChatAll($"{ChatColors.Red}test");
            info.ReplyToCommand($"{ChatColors.Green}test");
            player!.PrintToChat(ChatColors.DarkRed + "test");
            Server.PrintToChatAll(ChatColors.Red + "test");
            info.ReplyToCommand(ChatColors.Green + "test");
        }
[...]

Everything is just white. Any idea? I'm sure it's something simple that I do different than you all.

Thanks in advance!

commented

first character cannot be a color code, add a space in the beginning (if it hasn't been patched already)

That's it. Thank you!