16.10.2013, 13:58
It is possible, there you go made by Y less
put this above OnPlayerText
and this at the begenning of OnPlayerText:
although now, you use (FF0000) instead of {FF0000}[/QUOTE]
put this above OnPlayerText
pawn Код:
ReColor(text[])
{
new
pos = -1;
while ((pos = strfind(text, "(", false, pos + 1)) != -1)
{
new
c = pos + 1,
n = 0,
ch;
// Note that the order of these is important!
while ((ch = text[c]) && n != 6)
{
if (!('a' <= ch <= 'f' || 'A' <= ch <= 'F' || '0' <= ch <= '9'))
{
break;
}
++c;
++n;
}
if (n == 6 && ch == ')')
{
text[pos] = '{';
text[c] = '}';
}
}
}
pawn Код:
ReColor(text);