27.07.2014, 22:31
Well yours *untested* function gave me cryptic crashdetect errors,
anyways here alanhutch, try this:
Use it like "FilterAsterisk(text)" though I suggest create a new array under OnPlayerText 144 cells long to hold this new formatted text.
anyways here alanhutch, try this:
pawn Code:
stock FilterAsterisk(msg[], msglen = sizeof(msg))
{
new i = 0, asteriskPair = 0;
while (msg[i] != '\0')
{
if (msg[i] == '*')
{
if (asteriskPair == 0)
{
asteriskPair++;
strdel(msg, i, i+1);
strins(msg, "{800080}", i, msglen);
}
else
{
asteriskPair = 0;
strdel(msg, i, i+1);
strins(msg, "{FFFFFF}", i, msglen);
}
}
i++;
}
}