Quote:
Originally Posted by admantis
A simple method:
PHP код:
isSafeForTextdraw(string[])
{
new tildeCount;
for(new idx, len = strlen(string); idx < len; idx++)
{
if(string[idx] == '~') tildeCount ++;
}
if((tildeCount) & 1) return 0;
return 1;
}
Count the amount of tildes and if it's odd, there's a missing tilde.
|
What if players type "~~rHello World"?
You have 2 tildes, but it doesn't close the "r", resulting in a crash.