View Single Post
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 - 1069 views - 11.3 KB)

Last edited by HiddenConn1; 06-30-2017 at 21:28.
HiddenConn1 is offline