Raised This Month: $18 Target: $400
 4% 

[CSGO] "sm_say" Change "(ALL)"


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
HiddenConn1
AlliedModders Donor
Join Date: Aug 2009
Location: Cambridge, UK
Old 01-07-2020 , 06:19   [CSGO] "sm_say" Change "(ALL)"
Reply With Quote #1

Hi people.

So on my CS Source server I had changed sm_say "(ALL)" to "(ADMIN)" with the same color as the old Mani Admin Plugin style of "ADMIN CHAT", but on my CS GO server in the code where I'm meant to change "(ALL)" it shows as something different.

So in my CS Source basechat.sp it is as follows:
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"\x06(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);
        }    
    }
}

void SendDialogToOne(int clientint color, const char[] textany ...)
{
    
char message[100];
    
VFormat(messagesizeof(message), text4);    
    
    
KeyValues kv = new KeyValues("Stuff""title"message);
    
kv.SetColor("color"g_Colors[color][0], g_Colors[color][1], g_Colors[color][2], 255);
    
kv.SetNum("level"1);
    
kv.SetNum("time"10);
    
    
CreateDialog(clientkvDialogType_Msg);

    
delete kv;
}

void SendPrivateChat(int clientint target, const char[] message)
{
    if (!
client)
    {
        
PrintToServer("(Private to %N) %N: %s"targetclientmessage);
    }
    else if (
target != client)
    {
        
PrintToChat(client"\x04(Private to %N) %N: \x01%s"targetclientmessage);
    }

    
PrintToChat(target"\x04(Private to %N) %N: \x01%s"targetclientmessage);
    
LogAction(client, -1"\"%L\" triggered sm_psay to \"%L\" (text %s)"clienttargetmessage);

For the one now it shows as follows:
PHP Code:
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)))
        {
            if (
g_GameEngine == Engine_CSGO)
                
PrintToChat(i" \x01\x0B\x04%t: \x01%s"fromAdmin "Chat admins" "Chat to admins"frommessage);
            else
                
PrintToChat(i"\x04%t: \x01%s"fromAdmin "Chat admins" "Chat to admins"frommessage);
        }    
    }
}

void SendDialogToOne(int clientint color, const char[] textany ...)
{
    
char message[100];
    
VFormat(messagesizeof(message), text4);    
    
    
KeyValues kv = new KeyValues("Stuff""title"message);
    
kv.SetColor("color"g_Colors[color][0], g_Colors[color][1], g_Colors[color][2], 255);
    
kv.SetNum("level"1);
    
kv.SetNum("time"10);
    
    
CreateDialog(clientkvDialogType_Msg);

    
delete kv;
}

void SendPrivateChat(int clientint target, const char[] message)
{
    if (!
client)
    {
        
PrintToServer("(Private to %N) %N: %s"targetclientmessage);
    }
    else if (
target != client)
    {
        if (
g_GameEngine == Engine_CSGO)
            
PrintToChat(client" \x01\x0B\x04%t: \x01%s""Private say to"targetclientmessage);
        else
            
PrintToChat(client"\x04%t: \x01%s""Private say to"targetclientmessage);
    }
  
    if (
g_GameEngine == Engine_CSGO)
        
PrintToChat(target" \x01\x0B\x04%t: \x01%s""Private say to"targetclientmessage);
    else
        
PrintToChat(target"\x04%t: \x01%s""Private say to"targetclientmessage);
    
LogAction(clienttarget"\"%L\" triggered sm_psay to \"%L\" (text %s)"clienttargetmessage);

For the CSGO engine it's different to what I am familiar to and because I'm unfamiliar with the newer version of SM I'm unsure which part I need to modify to change the name from (ALL) to (ADMIN) and (ADMIN CHAT) to (ADMINS). That and the fact that I've not done any C++ in a year and a half. Could you kindly point me in the right direction?

Thanks!
__________________
HiddenConn1 is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 01-07-2020 , 09:59   Re: [CSGO] "sm_say" Change "(ALL)"
Reply With Quote #2

Use SPACE character in the beginning of the format if you are using colors at the beginning:
Example:

PHP Code:
PrintToChat(i" \x06(ADMIN) %s: \x01%s"nameBufmessage); 
What I did? I put space before \x06. Now the color will be shown and the space will be removed by the game automatically.
__________________
Ilusion9 is offline
HiddenConn1
AlliedModders Donor
Join Date: Aug 2009
Location: Cambridge, UK
Old 01-08-2020 , 22:21   Re: [CSGO] "sm_say" Change "(ALL)"
Reply With Quote #3

That's not what I mean. Which line do I change to replace the default "(ALL)"?
__________________
HiddenConn1 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 13:42.


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