#include <chat-processor>
stock void AddGradiant(char[] buffer, int maxlen)
{
int pos = strlen(buffer), offset, gradiant;
bool reverse;
while (pos)
{
const int COLORS = 5;
gradiant = (offset * 255) / (COLORS + 1);
Format(buffer[pos], maxlen, "\x07%02X%02X%02X%s", gradiant, gradiant, gradiant, buffer[--pos]);
if(offset >= COLORS) {
reverse = true;
} else if(offset == 0) {
reverse = false;
}
offset += reverse ? -1 : 1;
}
}
public Action CP_OnChatMessage(int& author, ArrayList recipients, char[] flagstring, char[] name, char[] message, bool & processcolors, bool & removecolors)
{
AddGradiant(name, MAXLENGTH_NAME);
return Plugin_Changed;
}