/**************************************************************************
* CS:GO COLORS *
* Автор: Феникс(komashchenko) *
* Version: 1.1 *
* http://zizt.ru/ http://hlmod.ru/ *
* 03.07.2014 - V1.0: Релиз *
* 13.10.2014 - V1.1: Обнова *
**************************************************************************/
#define ZCOLOR 13
new String:color_t[ZCOLOR][] = {"{DEFAULT}", "{RED}", "{LIGHTPURPLE}", "{GREEN}", "{LIME}", "{LIGHTGREEN}", "{LIGHTRED}", "{GRAY}", "{LIGHTOLIVE}", "{OLIVE}", "{LIGHTBLUE}", "{BLUE}", "{PURPLE}"};
new String:color_c[ZCOLOR][] = {"\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07", "\x08", "\x09", "\x10", "\x0B", "\x0C", "\x0E"};
stock CGOPrintToChat(client, const String:message[], any:...)
{
if(0 < client <= MaxClients && IsClientInGame(client))
{
decl String:text[512];
VFormat(text, 512, message, 3);
CGOReplaceColorSay(text, 512);
GOPrintToChat(true, client, text);
}
}
stock CGOPrintToChatAll(const String:message[], any:...)
{
decl String:text[512];
VFormat(text, sizeof(text), message, 2);
CGOReplaceColorSay(text, sizeof(text));
GOPrintToChatAll(true, text);
}
stock CGOReplaceColorSay(String:text[], maxlength) for(new i=0; i < ZCOLOR; i++) ReplaceString(text, maxlength, color_t[i], color_c[i]);
stock GOPrintToChat(bool:color, client, const String:message[], any:...)
{
if(0 < client <= MaxClients && IsClientInGame(client))
{
decl String:buf[10][512], String:tex[2048];
VFormat(tex, sizeof(tex), message, 4);
ReplaceString(tex, sizeof(tex), "\n", "{}");
new nuM = ExplodeString(tex, "{}", buf, 10, 512);
if(!color) for (new t = 0; t < nuM; t++) PrintToChat(client, buf[t]);
else for (new t = 0; t < nuM; t++) PrintToChat(client, " %s" ,buf[t]);
}
}
stock GOPrintToChatAll(bool:color, const String:message[], any:...)
{
decl String:buf[10][512], String:tex[2048];
VFormat(tex, sizeof(tex), message, 3);
ReplaceString(tex, sizeof(tex), "\n", "{}");
new nuM = ExplodeString(tex, "{}", buf, 10, 512);
if(!color) for (new t = 0; t < nuM; t++) PrintToChatAll(buf[t]);
else for (new t = 0; t < nuM; t++) PrintToChatAll(" %s" ,buf[t]);
}
stock CGOPrintHintText(client, const String:message[], any:...)
{
if(0 < client <= MaxClients && IsClientInGame(client))
{
decl String:text[1024];
VFormat(text, sizeof(text), message, 3);
CGOReplaceColorHsay(text, sizeof(text));
PrintHintText(client, text);
}
}
stock CGOPrintHintTextToAll(const String:message[], any:...)
{
decl String:text[1024];
VFormat(text, sizeof(text), message, 2);
CGOReplaceColorHsay(text, sizeof(text));
PrintHintTextToAll(text);
}
stock CGOReplaceColorHsay(String:sText[], maxlength)
{
ReplaceString(sText, maxlength, "{{", "<font color='");
ReplaceString(sText, maxlength, "}}", "</font>");
ReplaceString(sText, maxlength, "==", "'>");
}