Raised This Month: $32 Target: $400
 8% 

Plugins can now use custom colors in chat messages in TF2


Post New Thread Reply   
 
Thread Tools Display Modes
xomp
BANNED
Join Date: Jul 2008
Old 05-11-2012 , 15:09   Re: Plugins can now use custom colors in chat messages in TF2
Reply With Quote #31

Quote:
Originally Posted by Mariano View Post
Looking for improved version of this plugin with new custom colors:

https://forums.alliedmods.net/showthread.php?p=592536

Can any of you make few changes in original code?
That's where a thing like this could shine but sadly the guy that wrote it hasn't been active here in forever and even so, I would highly doubt he would have any interest at all in doing anything to that plugin. That's just how a lot of folks here roll.

I'm waiting with baited breath though for someone to improve on adverts with this new color code stuff. I think players these days have all but tuned themselves out to the standard colors in advert messages so this should make them pop!
xomp is offline
Send a message via Skype™ to xomp
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 05-11-2012 , 15:10   Re: Plugins can now use custom colors in chat messages in TF2
Reply With Quote #32

if the new color feature worked in CS:S, I would enhance that plugin
__________________
View my Plugins | Donate

Last edited by TnTSCS; 05-11-2012 at 15:10.
TnTSCS is offline
11530
Veteran Member
Join Date: Sep 2011
Location: Underworld
Old 05-15-2012 , 00:11   Re: Plugins can now use custom colors in chat messages in TF2
Reply With Quote #33

Hmm whilst the colors seem to be working in general, there is still one bug floating around.

If I use message "\x07FF0000Test",
Then I get "Test" in chat, and "Test" in the console. All good.

However if I use "\x07FF0000", just by itself - no message,
Then I get "FF0000" in chat, and "" in console. Console works, chat doesn't.

Edit: Console actually displays codes as well now regardless. Still needs a fix.
__________________

Last edited by 11530; 05-16-2012 at 14:32.
11530 is offline
Tylerst
Veteran Member
Join Date: Oct 2010
Old 05-15-2012 , 02:43   Re: Plugins can now use custom colors in chat messages in TF2
Reply With Quote #34

Quote:
Originally Posted by 11530 View Post
Hmm whilst the colors seem to be working in general, there is still one bug floating around.

If I use message "\x07FF0000Test",
Then I get "Test" in chat, and "Test" in the console. All good.

However if I use "\x07FF0000", just by itself - no message,
Then I get "FF0000" in chat, and "" in console. Console works, chat doesn't.
Doesn't seem like a big deal to me.
Why would you need to use custom color code for a blank message?
Tylerst is offline
11530
Veteran Member
Join Date: Sep 2011
Location: Underworld
Old 05-15-2012 , 13:59   Re: Plugins can now use custom colors in chat messages in TF2
Reply With Quote #35

Quote:
Originally Posted by Tylerst View Post
Doesn't seem like a big deal to me.
Why would you need to use custom color code for a blank message?
As a programmer, you should know that if a piece of code isn't working the way it should, it should be fixed regardless of its use. One should program for all eventualities, not some half-baked solution that only works *most* of the time.

Edit: Actually, the bug described happens for any RGB(A) value at the end of a message, not just a blank one.

Anyway, in case some people want to use it in their plugin, this code will suffice as a template:

PHP Code:
new iStartiEndiTotal;
decl String:sHex[9], String:sCodeBefore[12], String:sCodeAfter[10];
while ((
iStart StrContains(sText[(iTotal)], "{#")) != -1) {
    if ((
iEnd StrContains(sText[iTotal+iStart+2], "}")) != -1) {
        if (
iEnd == || iEnd == 8) {
            
strcopy(sHexiEnd+1sText[iTotal+iStart+2]);
            
Format(sCodeBeforesizeof(sCodeBefore), "{#%s}"sHex);
            
Format(sCodeAftersizeof(sCodeAfter), (iEnd == "\x07%s" "\x08%s"), sHex);
            
ReplaceString(sTextsizeof(sText), sCodeBeforesCodeAfter);
            
iTotal += iStart iEnd 1;
        }
        else {
            
iTotal += iStart iEnd 3;
        }
    }
    else {
        break;
    }

__________________

Last edited by 11530; 05-16-2012 at 15:50.
11530 is offline
moxie2020
Veteran Member
Join Date: Aug 2011
Old 08-01-2012 , 20:21   Re: Plugins can now use custom colors in chat messages in TF2
Reply With Quote #36

Quote:
Originally Posted by Powerlord View Post
This may also apply to other OB games (HL2: Deathmatch and Day of Defeat: Source), but they aren't mentioned.
Just to clarify, this only works with chat messages correct? Does it do any thing with top or center messages?
moxie2020 is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 08-02-2012 , 01:31   Re: Plugins can now use custom colors in chat messages in TF2
Reply With Quote #37

Quote:
Originally Posted by moxie2020 View Post
Just to clarify, this only works with chat messages correct? Does it do any thing with top or center messages?
This update = chat messages only \x07 \x08. No where else !

Colored top message works differently.

Center message = never
__________________
Do not Private Message @me

Last edited by Bacardi; 08-02-2012 at 01:32.
Bacardi is offline
moxie2020
Veteran Member
Join Date: Aug 2011
Old 08-04-2012 , 21:47   Re: Plugins can now use custom colors in chat messages in TF2
Reply With Quote #38

Quote:
Originally Posted by Bacardi View Post
This update = chat messages only \x07 \x08. No where else !

Colored top message works differently.

Center message = never
Thank you Senor Mojito! Gracias.
moxie2020 is offline
MLGsuperGame
Member
Join Date: Mar 2012
Location: Jamaica
Old 08-12-2012 , 11:46   Re: Plugins can now use custom colors in chat messages in TF2
Reply With Quote #39

Quote:
Originally Posted by ReFlexPoison View Post
Anybody else have my problem when for example, PrintToChatAll is called with \x07###### it shows up in the console as ######Your Message ?
I have noticed this too, but sure there is an easy way to block it with another bit of code. Sorry but I don't know how to block it or else I would show you.
__________________
MLGsuperGame is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 08-12-2012 , 12:18   Re: Plugins can now use custom colors in chat messages in TF2
Reply With Quote #40

Quote:
Originally Posted by MLGsuperGame View Post
I have noticed this too, but sure there is an easy way to block it with another bit of code. Sorry but I don't know how to block it or else I would show you.
this is a bit old, but the solution e found is broadcasting it as a SayText2, immitating a player chat.
Mitchell is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:23.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode