You could cache the stripped player name with this callback and on connect:
PHP Code:
CodeCallback_UserInfoChanged(clientNum)
{
oldname = self.name;
name = self get_userinfo("name");
self clientuserinfochanged();
}
This is how I remove the color tags and spaces:
PHP Code:
stripColorsAndSpaces(t)
{
if(!IsSubStr(t, "^") && !IsSubStr(t, " "))
return t; // colorless spaceless text
n = "";
for(i=0;i<t.size;i++)
{
if(t.size > i+3 && t[i] == "^" && t[i+1] == "^" && isInt(t[i+2]) && isInt(t[i+3]))
i += 3; // skip ^^xx
else if(t.size > i+1 && t[i] == "^" && isInt(t[i+1]))
i += 1; // skip ^x
else if(t[i] != " ")
n += t[i]; // append text
}
return n;
}
isInt(char)
{
asc = getAscii(char);
return asc >= 48 && asc <= 57;
}