TrevorRage Posted September 3, 2020 Posted September 3, 2020 Hi everyone! I'm creating a command using c #. I want to make the tooltip text color (if the command is not correct), using HEX. For example, I want to set the color for the selected text, using # 00FF7F, instead of ~ g ~. How can I do that?
Tonytza Posted September 7, 2020 Posted September 7, 2020 Hey! You can use !{#FFFFFF} format to color the chat. For example: player.SendChatMessage("Hello! !{#d68aff} this will be colored."); Alternatively, you can set it in a constant or something: public const string COLOR_CHAT_ME = "!{#d68aff}"; // and use it [Command("test", $"Usage: {COLOR_CHAT_ME} /test [something]")] public void CommandTest(Player player, string text) { player.SendChatMessage($"Hello again! {COLOR_CHAT_ME}{text}!"); }
TrevorRage Posted September 8, 2020 Author Posted September 8, 2020 10 часов назад, Tonytza сказал: Hey! You can use !{#FFFFFF} format to color the chat. For example: player.SendChatMessage("Hello! !{#d68aff} this will be colored."); Alternatively, you can set it in a constant or something: public const string COLOR_CHAT_ME = "!{#d68aff}"; // and use it [Command("test", $"Usage: {COLOR_CHAT_ME} /test [something]")] public void CommandTest(Player player, string text) { player.SendChatMessage($"Hello again! {COLOR_CHAT_ME}{text}!"); } I wanted to use the 2nd option, but when I try to do this - vs write that there should be a constant and an error occurs (that is why I ask).
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now