Checking for GameText text errors
#4

Quote:
Originally Posted by Vince
Посмотреть сообщение
I think that already happens automatically. The server sends an automated message about "unmatched tilde".
No, that only happens with textdraws.

And yes, Luis- heres a function by JernejL AFAIK:

Код:
stock issafefortextdraw(str[])
{
    new 
        safetil = -5;

    for (new i = 0; i < strlen(str); i++)
    {
        if ((str[i] == 126) && (i > safetil))
        {
            if (i >= strlen(str) - 1) 
                return false;

            if (str[i + 1] == 126) 
                return false;

            if (str[i + 2] != 126) 
                return false;

            safetil = i + 2;
        }
    }
    
    return true;
}

//USAGE:
    if (!issafefortextdraw("~rHELLO WORLD!")) {
    	print("Error: check for ~ errors.");
    }
	if (!issafefortextdraw("~r~HELLO WORLD!")) {
    	print("Its good!");
    }
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)