Git Product home page Git Product logo

chatcolors's Introduction

ChatColors

Lets players choose a color for their name in chat. Only red, blue, green, and yellow are available.

The plugin is automatically disabled on maps that use teams, or if another script or admin changes the classification of players to one of the colored team values (16-19).

Installation

  1. Download the script and save it to scripts/plugins/ChatColors.as
  2. Add this to the top of default_plugins.txt
    "plugin"
    {
        "name" "ChatColors"
        "script" "ChatColors"
    }

It's important that this be the first plugin in the list. Otherwise, chat names will not be colored when another plugin handles a chat command. Note that reloading the plugin with as_reloadplugin chatcolors, it will be sent to the bottom of the list. So, always use as_reloadplugins when editing this plugin.

Integration with other plugins

Some plugins manipulate player chats by reprinting them with the g_PlayerFuncs.SayTextAll function. The problem with that is the player name color is lost, and so the name color matches the chat text. If you need to manipulate a player's chat messsage, then use this function instead.

void player_say(CBaseEntity@ plr, string msg)
{
    NetworkMessage m(MSG_ALL, NetworkMessages::NetworkMessageType(74), null);
        m.WriteByte(plr.entindex());
        m.WriteByte(2); // tell the client to color the player name according to team
        m.WriteString("" + plr.pev.netname + ": " + msg);
    m.End();
}

chatcolors's People

Contributors

wootguy avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

masoodmeer

chatcolors's Issues

Priority problems

Other plugins that has chat commands like ChatSounds doesn't take effect on colors.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.