// 0 = reject
// -1 = fake accept
{
- string msgstr, colorstr, cmsgstr, namestr, fullmsgstr, sourcemsgstr, fullcmsgstr, sourcecmsgstr;
+ string msgstr, colorstr, cmsgstr, namestr, fullmsgstr, sourcemsgstr, fullcmsgstr, sourcecmsgstr, colorprefix;
float flood;
var .float flood_field;
entity head;
else
namestr = source.netname;
+ if(strdecolorize(namestr) == namestr)
+ colorprefix = "^3";
+ else
+ colorprefix = "^7";
+
if(msgin != "")
{
if(privatesay)
{
- msgstr = strcat("\{1}\{13}* ^3", namestr, "^3 tells you: ^7");
+ msgstr = strcat("\{1}\{13}* ", colorprefix, namestr, "^3 tells you: ^7");
privatemsgprefixlen = strlen(msgstr);
msgstr = strcat(msgstr, msgin);
- cmsgstr = strcat(colorstr, "^3", namestr, "^3 tells you:\n^7", msgin);
+ cmsgstr = strcat(colorstr, colorprefix, namestr, "^3 tells you:\n^7", msgin);
if(autocvar_g_chat_teamcolors)
privatemsgprefix = strcat("\{1}\{13}* ^3You tell ", playername(privatesay), ": ^7");
else
}
else if(teamsay)
{
- msgstr = strcat("\{1}\{13}", colorstr, "(^3", namestr, colorstr, ") ^7", msgin);
- cmsgstr = strcat(colorstr, "(^3", namestr, colorstr, ")\n^7", msgin);
+ msgstr = strcat("\{1}\{13}", colorstr, "(", colorprefix, namestr, colorstr, ") ^7", msgin);
+ cmsgstr = strcat(colorstr, "(", colorprefix, namestr, colorstr, ")\n^7", msgin);
}
else
{
- msgstr = strcat("\{1}", namestr, "^7: ", msgin);
+ msgstr = strcat("\{1}", colorprefix, namestr, "^7: ", msgin);
cmsgstr = "";
}
msgstr = strcat(strreplace("\n", " ", msgstr), "\n"); // newlines only are good for centerprint