collectvood
Allows players to change their name & message colour in chat

Supported Games
GameServerKingsGameServerKings

Coloured Chat gives you the possibilty of changing players ingame names & messages to whatever colour you/they desire.

Player name colours will now only show up if the player has the following permission: colouredchat.name.show.

Same goes for messages in which case you will need to grant: colouredchat.message.show.

If you want everyone to have these permissions use the commands below.

  • oxide.grant group default colouredchat.name.show
  • oxide.grant group default colouredchat.message.show

Permissions

Name

  • colouredchat.name.show - Allows players to have a different name colours in chat (not modify it)
  • colouredchat.name.use - Allows players to change their name colour
  • colouredchat.name.bypass - Allows players to bypass name hex code restrictions
  • colouredchat.name.setothers - Allows players to set other players name colours
  • colouredchat.name.random - Allows players to set randomized name colours to themselfs
  • colouredchat.name.rainbow - Allows players to give themselfs the rainbow name colour
  • colouredchat.name.gradient - Allows players to use name colour gradients

Message

  • colouredchat.message.show - Allows players to have a different message colour in chat (not modify it)
  • colouredchat.message.use - Allows players to change their message colour
  • colouredchat.message.bypass - Allows players to bypass message hex code restrictions
  • colouredchat.message.setothers - Allows players to set other players message colours
  • colouredchat.message.random - Allows players to set randomized message colours to themselfs
  • colouredchat.message.rainbow - Allows players to give themselfs the rainbow message colour
  • colouredchat.message.gradient - Allows players to use message colour gradients

All permissions besides both the rainbow ones are optional for admins, means they already have said permissions and don't need to be granted!

Chat Commands

Changing own player

For message colours just use the message colour command instead! (by default: /mcolour)

  • /colours - Prints out help
  • /colour <hexcode> - Changes your colour to given hex code
  • /colour clear/reset/remove - Resets your colour
  • /colour gradient <hexCode1 hexCode2 hexCode3 ...> - Changes your colour to the given gradient colours
  • /colour random - Changes your colour to random hex code
  • /colour rainbow - Changes your colour to the rainbow colours

Changing other players

For message colours just use the message colour command instead! (by default: /mcolour)

  • /colour set <playerIdOrName> <hexcode> - Changes targets colour to given hex code
  • /colour set <playerIdOrName> clear/reset/remove - Resets targets colour
  • /colour set <playerIdOrName> gradient <hexCode1 hexCode2 ...> - Changes targets colour to given gradient
  • /colour set <playerIdOrName> random - Changes targets colour to a random hex code
  • /colour set <playerIdOrName> rainbow - Changes targets colour to the rainbow colours

Changing groups

For message colours just use the message colour command instead! (by default: /mcolour) Also remember that group colours will only show up on the player if he has not set a custom colour/ does not have the rainbow permission.

The following commands can only be run by an administrator or server console.

  • /colour group <groupName> <hexcode> - Changes group colour to given hex code
  • /colour group <groupName> clear/reset/remove - Resets group colour
  • /colour group <groupName> gradient <hexCode1 hexCode2 ...> - Changes group colour to given gradient
  • /colour group <groupName> random - Changes group colour to a random hex code
  • /colour group <groupName> rainbow - Changes group colour to the rainbow colours

Configuration

Default Configuration

Setting Player Inactivity Data Removal (days) to 0 disables this feature.

{
  "Player Inactivity Data Removal (days)": 7,
  "Block messages of muted players (requires BetterChatMute)": true,
  "Rainbow Colours": [
    "#ff0000",
    "#ffa500",
    "#ffff94",
    "#008000",
    "#0000ff",
    "#4b0082",
    "#ee82ee"
  ],
  "Blocked Characters": [
    "{",
    "}",
    "size"
  ],
  "Name colour command": "colour",
  "Name colours command (Help)": "colours",
  "Name show colour permission": "colouredchat.name.show",
  "Name use permission": "colouredchat.name.use",
  "Name use gradient permission": "colouredchat.name.gradient",
  "Name default rainbow name permission": "colouredchat.name.rainbow",
  "Name bypass restrictions permission": "colouredchat.name.bypass",
  "Name set others colour permission": "colouredchat.name.setothers",
  "Name get random colour permission": "colouredchat.name.random",
  "Name use blacklist": true,
  "Name blocked colour hex": [
    "#000000"
  ],
  "Name blocked colours range hex": [
    {
      "From": "#000000",
      "To": "#000000"
    }
  ],
  "Name use whitelist": false,
  "Name whitelisted colours hex": [
    "#000000"
  ],
  "Name whitelisted colour range hex": [
    {
      "From": "#000000",
      "To": "#FFFFFF"
    }
  ],
  "Message colour command": "mcolour",
  "Message colours command (Help)": "mcolours",
  "Message show colour permission": "colouredchat.message.show",
  "Message use permission": "colouredchat.message.use",
  "Message use gradient permission": "colouredchat.message.gradient",
  "Message default rainbow name permission": "colouredchat.message.rainbow",
  "Message bypass restrictions permission": "colouredchat.message.bypass",
  "Message set others colour permission": "colouredchat.message.setothers",
  "Message get random colour permission": "colouredchat.message.random",
  "Message use blacklist": true,
  "Message blocked colours hex": [
    "#000000"
  ],
  "Message blocked colour range hex": [
    {
      "From": "#000000",
      "To": "#000000"
    }
  ],
  "Message use whitelist": false,
  "Message whitelisted colours hex": [
    "#000000"
  ],
  "Message whitelisted colour range hex": [
    {
      "From": "#000000",
      "To": "#FFFFFF"
    }
  ]
}

Black/- Whitelist Colour Ranges

Example

  "Name blocked colours range hex": [
    {
      "From": "#000000",
      "To": "#BBBBBB"
    }

Above blocks the usage of any hexcode (simple colour but also gradient colour parts) all colours starting from #000000 and ending with #BBBBBB. You can bypass this restriction by granting colouredchat.name.bypass for names or by default as an admin. You can simple add more range blocks

Localization

For Developers

Hooks

OnColouredChat(Dictionary<string, object> dict)

The dictionary is completly mutable. You can change and return the dictionary to override chat messages.

  • Player (IPlayer) - player sending the message
  • ChatChannel (Chat.ChatChannel) - chat channel of the message
  • Colour (string) - colour that the name will have if no gradient is used
  • Name (string) - username that will be displayed in chat with gradient modification if used
  • Message (string) - message that will be displayed in chat
    Returning non null overrides the default behaviour (cancels the message being sent).
private string API_GetColouredChatMessage(IPlayer iPlayer, Chat.ChatChannel channel, string message)
private string API_GetColouredName(IPlayer player)
private string API_GetColouredMessage(IPlayer player, string message)

Credits

  • PsychoTea, the original author of this plugin
  • LaserHydra for the Better Chat API

MIT License


Copyright (c) 2019 collectvood


Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:


The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.


THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.