Если для кого-то это актуально, то вот как получилось решить проблему
Код
#include <clientmod>
#include <clientmod/multicolors>
char cColor[9][] = {
"{indigo}",
"{darkmagenta}",
"{purple}",
"{valve}",
"{darkviolet}",
"{blueviolet}",
"{mediumorchid}",
"{magenta}",
"{legendary}"
};
public void OnPluginStart() {
RegConsoleCmd("say", cmd_say);
}
public Action cmd_say(int client, int args){
char Nick[64];
char GetText[512];
GetClientName(client, Nick, sizeof(Nick));
GetCmdArgString(GetText, sizeof(GetText));
StripQuotes(GetText);
if (client)
{
char CustomText[512];
FormatText(CustomText, sizeof(CustomText), Nick);
MC_PrintToChatAll("%s:{default} %s", CustomText, GetText);
}
return Plugin_Handled;
}
public void FormatText(char[] cResult, int iMaxSize, const char[] text) {
int iCount = 0;
int SizeText = strlen(text);
int iResIndex = 0;
for (int i = 0; i < SizeText;)
{
int sym = text[i] & 0xFF;
int bytes = 0;
if ((sym & 0x80) == 0)
bytes = 1;
else if ((sym & 0xE0) == 0xC0)
bytes = 2;
else if ((sym & 0xF0) == 0xE0)
bytes = 3;
else if ((sym & 0xF8) == 0xF0)
bytes = 4;
else
break;
if (text[i] != ' ')
{
for (int j = 0; j < strlen(cColor[iCount % 9]); ++j)
{
cResult[iResIndex] = cColor[iCount % 9][j];
iResIndex++;
}
}
for (int j = 0; j < bytes; ++j)
{
cResult[iResIndex] = text[i + j];
iResIndex++;
}
i += bytes;
iCount++;
}
cResult[iResIndex] = '\0';
for (int i = 0; i < iResIndex && i < iMaxSize - 1; ++i)
cResult[i] = cResult[i];
cResult[iMaxSize-1] = '\0';
}