roflmuffin / CounterStrikeSharp

CounterStrikeSharp allows you to write server plugins in C# for Counter-Strike 2/Source2/CS2
https://docs.cssharp.dev
Other
756 stars 113 forks source link

Chat colors not working for me #361

Closed jmgraeffe closed 6 months ago

jmgraeffe commented 6 months ago

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!

KillStr3aK commented 6 months ago

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

jmgraeffe commented 6 months ago

That's it. Thank you!