#Colored chat messages

1 messages · Page 1 of 1 (latest)

untold wraith
#

What is the override of UnturnedChat.Say to send message to a player with a message and a color, or color codes and how to use them

shell geyser
#

You are able to see availible overloads by hovering over it, etc.

untold wraith
#

ye ik but im not sure how to use colors

shell geyser
#

UnityEngine.Color

untold wraith
#

i figured the overloads out

#

okay

shell geyser
#

colors within Color are static.

#

so Color.red

untold wraith
#

could you make a sample

#

or could i do .Say($"{Color.Red}Hello!");

shell geyser
#

Assuming you are using VS 2022.

untold wraith
#

i am

#

i cant get the link tho

shell geyser
#

It should popup on the right hand side.

untold wraith
shell geyser
shell geyser
#

The font is different on that too.

#

When did you last update VS?

untold wraith
#

i changed my font

shell geyser
#

Ah.

untold wraith
#

thats why

#

let me check for updates

shell geyser
#
[EditorBrowsable(EditorBrowsableState.Never)]
internal static bool CheckPermissions(SteamPlayer caller, string permission)
{
    UnturnedPlayer player = caller.ToUnturnedPlayer();

    Regex r = new Regex("^\\/\\S*");
    string requestedCommand = r.Match(permission.ToLower()).Value.TrimStart('/').ToLower();

    IRocketCommand command = R.Commands.GetCommand(requestedCommand);
    double cooldown = R.Commands.GetCooldown(player, command);

    if (command != null)
    {
        if (R.Permissions.HasPermission(player, command))
        {
            if (cooldown > 0)
            {
                UnturnedChat.Say(player, R.Translate("command_cooldown", cooldown), Color.red);
                return false;
            }
            return true;
        }
        else
        {
            UnturnedChat.Say(player, R.Translate("command_no_permission"), Color.red);
            return false;
        }
    }
    else
    {
        UnturnedChat.Say(player, U.Translate("command_not_found"), Color.red);
        return false;
    }
}
untold wraith
#

ty

untold wraith
#

but yea i updated vs and nothing has changed

shell geyser
#

Just an easier window to view other stuff in it.

untold wraith
#

true