25.09.2011, 11:04
I edited my post above.
Something like this ( untested ) might work.
Obviously you would have to add all the symbols yo wanted to allow.
Something like this ( untested ) might work.
pawn Код:
stock FormatColors( string[] )
{
new
pos,
sub[164]
;
format( sub , sizeof(sub) , "%s" , string );
pos = strfind( sub , "[g]" , true );
while( pos != -1 )
{
strdel( sub , pos , pos + 3 , sizeof(sub) );
strins( sub , "~g~" , pos );
pos = strfind( sub , "[g]" , true );
}
pos = strfind( sub , "[r]" , true );
while( pos != -1 )
{
strdel( sub , pos , pos + 3 , sizeof(sub) );
strins( sub , "~r~" , pos );
pos = strfind( sub , "[r]" , true );
}
return sub;
}