View Single Post
official NinJa
New Member
Join Date: Jan 2021
Location: Kathmandu,Nepal
Old 01-22-2021 , 06:07   Re: Admin Color chat using basechat.sp
Reply With Quote #3

Quote:
Originally Posted by Certified_GSD View Post
void SendChatToAll(int client, const char[] message)
{
char nameBuf[MAX_NAME_LENGTH];

for (int i = 1; i <= MaxClients; i++)
{
if (!IsClientInGame(i) || IsFakeClient(i))
{
continue;
}
FormatActivitySource(client, i, nameBuf, sizeof(nameBuf));

if (g_GameEngine == Engine_CSGO)
PrintToChat(i, " \x01\x0B\x04%t: \x01%s", "Say all", nameBuf, message);
else
PrintToChat(i, "\x04%t: \x01%s", "Say all", nameBuf, message);
}
}


This is the part you're looking for. You mentioned using {COLORHERE} which CS:GO will not parse. That is part of colorlib which is a dependency you'll need to have in your includes if you are going to compile.

Color guides (if you don't want to use colorlib):
\x01 = White
\x02 = Dark Red
\x03 = White
\x04 = Dark Green
\x05 = Moss Green
\x06 = Lime Green
\x07 = Light Red


For example, mine reads:

"CPrintToChat(i, "{darkred}ADMIN | \x07%t : \x01%s", "Say all", nameBuf, message);"


Experiment a bit with that. I haven't tested it yet. You need to make sure that if you are using colorlib, you MUST call the color function. This means changing "PrintToChat" to "CPrintToChat" like above. Let me know if you have any other questions, I'll try my best to help you figure it out.

is this work for cs source , if not then i am looking for cs source
official NinJa is offline