Author Topic: Possible to change name color with clientCmdChatMessage?  (Read 1337 times)

Hey I was just wondering if it is possible to change the color of a players name with clientCmdChatMessage?
I tried something like this but it didn't work

Code: [Select]
package Bleh
{
function clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg)
{
%name = "<color:00FF00>" @ %name;
Parent::clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg);
}
};
activatepackage(Bleh);

If there is a way I could do this with clientCmdChatMessage please let me know however if you can't but there is an alternative method please inform me of it

Thanks.



clientCmdChatMessage simply adds %fmsg to the message HUD. It doesn't build it's own string based on the parameters. You'll have to change %fmsg instead.

clientCmdChatMessage simply adds %fmsg to the message HUD. It doesn't build it's own string based on the parameters. You'll have to change %fmsg instead.
I'll give it a shot.

Edit: No luck, it didn't change anything.
« Last Edit: July 24, 2012, 06:48:13 PM by Danny Boy »

I'll give it a shot.

Edit: No luck, it didn't change anything.

Just to test it, try this:

Code: [Select]
package my_package
{
    function clientCmdChatMessage( %cl, %voice, %pitch, %line, %pre, %name, %suf, %msg )
    {
        parent::clientCmdChatMessage( %cl, %voice, %pitch, "muffins", %pre, %name, %suf, %msg );
    }
};

activatePackage( "my_package" );

If this doesn't work, you aren't executing the code properly, you have a conflicting add-on or the server is running a terribly made custom chat system.

Yes, possible.
And, port, that will make every message say muffins

And, port, that will make every message say muffins
No freaking duh



I got it working thanks Port.

Edit: Small problem, I am doing something like this which seems to work

Code: [Select]
package Bleh
{
    function clientCmdChatMessage(%cl, %voice, %pitch, %line, %pre, %name, %suf, %msg)
    {
%line = "\c7"@%pre@"\c2"@%name@"\c7"@%suf@"\c6: "@%msg;
        parent::clientCmdChatMessage(%cl, %voice, %pitch, %line, %pre, %name, %suf, %msg);
    }
};

activatePackage(Bleh);

That works fine and all but for some reason the clan prefix is appearing in the clan suffix for example admin shields are appearing in the prefix instead of the suffix.
« Last Edit: July 25, 2012, 11:43:28 AM by Danny Boy »

Is it still doing this Danny? When I had tested your modification I was not having a problem with it.

Is it still doing this Danny? When I had tested your modification I was not having a problem with it.
Yea I think its been sorted. Now all I have to do is work out why team chat doesn't work and then add support for Time Message mod.