How to change color in text?
#10

Well yours *untested* function gave me cryptic crashdetect errors,
anyways here alanhutch, try this:
pawn Code:
stock FilterAsterisk(msg[], msglen = sizeof(msg))
{
    new i = 0, asteriskPair = 0;
    while (msg[i] != '\0')
    {
        if (msg[i] == '*')
        {
            if (asteriskPair == 0)
            {
                asteriskPair++;
                strdel(msg, i, i+1);
                strins(msg, "{800080}", i, msglen);
            }
            else
            {
                asteriskPair = 0;
                strdel(msg, i, i+1);
                strins(msg, "{FFFFFF}", i, msglen);
            }
        }
        i++;
    }
}
Use it like "FilterAsterisk(text)" though I suggest create a new array under OnPlayerText 144 cells long to hold this new formatted text.
Reply


Messages In This Thread
How to change color in text? - by alanhutch - 27.07.2014, 21:26
Re: How to change color in text? - by Jefff - 27.07.2014, 21:27
Re: How to change color in text? - by alanhutch - 27.07.2014, 21:30
Re: How to change color in text? - by alanhutch - 27.07.2014, 21:41
Re: How to change color in text? - by Cannary2048 - 27.07.2014, 22:04
Re: How to change color in text? - by alanhutch - 27.07.2014, 22:07
Re: How to change color in text? - by Dubya - 27.07.2014, 22:09
Re: How to change color in text? - by alanhutch - 27.07.2014, 22:10
Re: How to change color in text? - by Dubya - 27.07.2014, 22:21
Re: How to change color in text? - by Virtual1ty - 27.07.2014, 22:31

Forum Jump:


Users browsing this thread: 1 Guest(s)