#1

Hello. I have one little problem and I don't know what to do. What do I have to do so the script allows me to use {FFFFFF} (hex colors) In-Game chat. It just doesn't work. Thanks!
Reply
#2

Can you show us what you've attempted up to now so we can correct it?
Reply
#3

I just tried to write {FFFFFF} in admin chat and the color isn't changing and only the text I see.
Reply
#4

I'll repeat what I said...

Quote:
Originally Posted by DanishHaq
Посмотреть сообщение
Can you show us what you've attempted up to now so we can correct it?
This would be an example anyway on how to do it:

pawn Код:
format(string, sizeof(string), "The word after the colon will be white: {FFFFFF}White");
SendClientMessage(playerid, COLOR_RED, string);
Reply
#5

You can't live add color embeed, only with scripts.

https://sampwiki.blast.hk/wiki/Colour_Em...olor_embedding
Reply
#6

Quote:
Originally Posted by iJumbo
Посмотреть сообщение
You can't live add color embeed, only with scripts.

https://sampwiki.blast.hk/wiki/Colour_Em...olor_embedding
I saw on different servers that was possible.
Reply
#7

It is possible, there you go made by Y less

put this above OnPlayerText
pawn Код:
ReColor(text[])
{
    new
        pos = -1;
    while ((pos = strfind(text, "(", false, pos + 1)) != -1)
    {
        new
            c = pos + 1,
            n = 0,
            ch;
        // Note that the order of these is important!
        while ((ch = text[c]) && n != 6)
        {
            if (!('a' <= ch <= 'f' || 'A' <= ch <= 'F' || '0' <= ch <= '9'))
            {
                break;
            }
            ++c;
            ++n;
        }
        if (n == 6 && ch == ')')
        {
            text[pos] = '{';
            text[c] = '}';
        }
    }
}
and this at the begenning of OnPlayerText:
pawn Код:
ReColor(text);
although now, you use (FF0000) instead of {FF0000}[/QUOTE]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)