28.02.2011, 15:15
(
Последний раз редактировалось RyDeR`; 28.02.2011 в 17:54.
)
I edited my code a bit from this post (now, without checking if it's valid (-> code more faster)). Idea comes from JernejL. I just increased the performance of the code.
pawn Код:
stock filterColorTags(string[], bool: gxtTags, bool: sampColors)
{
if(gxtTags)
{
new
textPos = -1
;
while((textPos = strfind(string, "~", false, (textPos + 1))) != -1)
{
if(string[(textPos + 2)] == '~')
{
strdel(string, textPos, (textPos + 3));
}
}
}
if(sampColors)
{
new
textPos = -1
;
while((textPos = strfind(string, "{", false, (textPos + 1))) != -1)
{
if(string[(textPos + 7)] == '}')
{
strdel(string, textPos, (textPos + 8));
}
}
}
}