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

SourceMod "x" colors?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
HiddenConn1
AlliedModders Donor
Join Date: Aug 2009
Location: Cambridge, UK
Old 06-30-2017 , 21:08   SourceMod "x" colors?
Reply With Quote #1

Hey guys.

I am trying to customise the way SM admin chat is printed.
PHP Code:
void SendChatToAll(int client, const char[] message)
{
    
char nameBuf[MAX_NAME_LENGTH];
    
    for (
int i 1<= MaxClientsi++)
    {
        if (!
IsClientInGame(i) || IsFakeClient(i))
        {
            continue;
        }
        
FormatActivitySource(clientinameBufsizeof(nameBuf));
        
        
PrintToChat(i"\x04(ADMIN) %s: \x01%s"nameBufmessage);
    }
}

void DisplayCenterTextToAll(int client, const char[] message)
{
    
char nameBuf[MAX_NAME_LENGTH];
    
    for (
int i 1<= MaxClientsi++)
    {
        if (!
IsClientInGame(i) || IsFakeClient(i))
        {
            continue;
        }
        
FormatActivitySource(clientinameBufsizeof(nameBuf));
        
PrintCenterText(i"%s: %s"nameBufmessage);
    }
}

void SendChatToAdmins(int from, const char[] message)
{
    
int fromAdmin CheckCommandAccess(from"sm_chat"ADMFLAG_CHAT);
    for (
int i 1<= MaxClientsi++)
    {
        if (
IsClientInGame(i) && (from == || CheckCommandAccess(i"sm_chat"ADMFLAG_CHAT)))
        {
            
PrintToChat(i"\x04(%sADMIN CHAT) %N: \x01%s"fromAdmin "" "TO "frommessage);
        }    
    }

I am wanting to change the "(ALL)" to "(ADMINS)" but use the old Mani Admin Plugin admin chat color for both the "(ADMIN)" tag, admin name and the message but I don't know what the x0 code is for the lightgreen text color.

Could I get some help with this?

EDIT: I am unable to compile the script. Could someone who do this for me and enter in the correct light green x0 color code into this part of the script:
PHP Code:
void SendChatToAll(int client, const char[] message)
{
    
char nameBuf[MAX_NAME_LENGTH];
    
    for (
int i 1<= MaxClientsi++)
    {
        if (!
IsClientInGame(i) || IsFakeClient(i))
        {
            continue;
        }
        
FormatActivitySource(clientinameBufsizeof(nameBuf));
        
        
PrintToChat(i"\x*LIGHTGREENCOLORHERE*(ADMIN) %s: \x*SAME COLOR HERE*%s"nameBufmessage);
    }

Thank you.
Attached Files
File Type: sp Get Plugin or Get Source (basechat.sp - 1067 views - 11.3 KB)

Last edited by HiddenConn1; 06-30-2017 at 21:28.
HiddenConn1 is offline
hmmmmm
Great Tester of Whatever
Join Date: Mar 2017
Location: ...
Old 06-30-2017 , 22:12   Re: SourceMod "x" colors?
Reply With Quote #2

default (white): \x01
teamcolour (will be purple if message from server): \x03
red: \x07
lightred: \x0F
darkred: \x02
bluegrey: \x0A
blue: \x0B
darkblue: \x0C
purple: \x03
orchid: \x0E
yellow: \x09
gold: \x10
lightgreen: \x05
green: \x04
lime: \x06
grey: \x08
grey2: \x0D
hmmmmm is offline
HiddenConn1
AlliedModders Donor
Join Date: Aug 2009
Location: Cambridge, UK
Old 07-01-2017 , 09:48   Re: SourceMod "x" colors?
Reply With Quote #3

Are they the only colors I can use for the basechat.sp file?

Last edited by HiddenConn1; 07-01-2017 at 14:23.
HiddenConn1 is offline
hmmmmm
Great Tester of Whatever
Join Date: Mar 2017
Location: ...
Old 07-01-2017 , 18:26   Re: SourceMod "x" colors?
Reply With Quote #4

Sorry, assumed you were playing CSGO for some reason. If you are then yes, CSGO sucks and is limited to only those colours, otherwise you can pick any colour code you want
hmmmmm is offline
HiddenConn1
AlliedModders Donor
Join Date: Aug 2009
Location: Cambridge, UK
Old 07-02-2017 , 07:52   Re: SourceMod "x" colors?
Reply With Quote #5

We have 3 CS Source servers and a CSGO server. For this I am wanting the lightgreen color for CSS.
__________________
HiddenConn1 is offline
HiddenConn1
AlliedModders Donor
Join Date: Aug 2009
Location: Cambridge, UK
Old 11-11-2017 , 04:48   Re: SourceMod "x" colors?
Reply With Quote #6

BUMP

Still requesting additional support with this.
__________________
HiddenConn1 is offline
blaacky
Senior Member
Join Date: Oct 2012
Old 11-11-2017 , 05:02   Re: SourceMod "x" colors?
Reply With Quote #7

https://github.com/imyzcn/mani-admin...tput.cpp#L1538

There is the colors mani admin used in its chat functions. Looks like it creates a user message called "TextMsg", writes a byte of value "3", then it looks like it shows exactly what colors you want, in a switch statement, which is light green so "3". \x03 is probably what you want. If not, you can always try using \x07 followed by any 3 byte hexadecimal code to get whatever color you want.
__________________

Last edited by blaacky; 11-12-2017 at 21:50.
blaacky is offline
HiddenConn1
AlliedModders Donor
Join Date: Aug 2009
Location: Cambridge, UK
Old 11-11-2017 , 05:35   Re: SourceMod "x" colors?
Reply With Quote #8

Quote:
Originally Posted by blaacky View Post
https://github.com/imyzcn/mani-admin...tput.cpp#L1538

There is the colors mani admin used in its chat functions. Looks like it creates a user message called "TextMsg", writes a byte of value "3", then it looks like it shows exactly what colors you want, in a switch statement, which is light green so "3". \x03 is probably what you want. If not, you can always try using \x07 followed by any 6 byte hexadecimal code to get whatever color you want.
You are a legend! Thank you so much for this! I'll give it a go and report back the results.

Thanks, blaacky.

EDIT: Worked wonderfully! Thanks man!
__________________

Last edited by HiddenConn1; 11-11-2017 at 06:30. Reason: Posting back results, exactly what I wanted!
HiddenConn1 is offline
dmna000000000012
Junior Member
Join Date: Jul 2023
Old 08-06-2023 , 00:56   Re: SourceMod "x" colors?
Reply With Quote #9

anyone know how i can change admin menu text to a different colors for example when i type sm_admin the menu will show up with a yellow text player commands i want to change the color this is for l4d2
dmna000000000012 is offline
Reply



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 23:54.


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