20.04.2012, 14:07
I use the following functions to ensure this never happens:
Then check if the number of ~'s in the gametext is odd with ******' isodd().
If it's something like /announce you could show an error, but if it's a gametext in part of your mode, it'll be a bit more tricky. I would suggest making a GameTextForPlayerEx() function or something, and in that function if there are an odd number of ~'s, don't show the gametext and log it to a file, then you can keep an eye on that file to find out which gametext string is causing it.
Good luck.
pawn Code:
stock CountChars(txt[],ch='~')
{
new d,cnt;
while(txt[d] != EOS)
{
if(txt[d] == ch) cnt++;
d++;
}
return cnt;
}
If it's something like /announce you could show an error, but if it's a gametext in part of your mode, it'll be a bit more tricky. I would suggest making a GameTextForPlayerEx() function or something, and in that function if there are an odd number of ~'s, don't show the gametext and log it to a file, then you can keep an eye on that file to find out which gametext string is causing it.
Good luck.