Jump to content

Color tip (in the command)


Recommended Posts

Posted

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?

nsTcKlH.png

Posted

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}!");
}

 

Posted
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).

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...