Checking for GameText text errors
#6

Quote:
Originally Posted by admantis
Посмотреть сообщение
A simple method:
PHP код:
isSafeForTextdraw(string[])
{
    new 
tildeCount;
    for(new 
idxlen strlen(string); idx lenidx++)
    {
        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.
Reply


Messages In This Thread
Checking for GameText text errors - by Luis- - 18.05.2015, 21:08
Re: Checking for GameText text errors - by Vince - 18.05.2015, 21:15
Re: Checking for GameText text errors - by Abagail - 18.05.2015, 21:19
Re: Checking for GameText text errors - by Evocator - 18.05.2015, 22:41
Respuesta: Checking for GameText text errors - by admantis - 18.05.2015, 22:59
Re: Respuesta: Checking for GameText text errors - by PowerPC603 - 18.05.2015, 23:25
Respuesta: Checking for GameText text errors - by admantis - 18.05.2015, 23:47
Re: Checking for GameText text errors - by Gammix - 19.05.2015, 04:49
Re: Checking for GameText text errors - by M0HAMMAD - 19.05.2015, 06:30

Forum Jump:


Users browsing this thread: 1 Guest(s)