Multi Coloured "SendClientMessage"
#1

Okay, what I have is this..

pawn Код:
stock AdminStatusToName(playerid)
{
    new status[128];
    switch(astatus[playerid])
    {
        case 0:
        {
            status = "{0xCC333333}Roleplaying";
        }
        case 1:
        {
            status = "{0x33663333}Administrating";
        }
        case 2:
        {
            status = "{0xFFCC9999}Away from Keyboard";
        }
    }
    return status;
}
^^ That was used to TRY and change the colour of a part of a string, this is the string code

pawn Код:
command(admins, playerid, params[])
{
    new str[128], found = 0;
    if(loggedin[playerid] == 0) return SendClientMessage(playerid, 0x66666666, "You must be logged in perform commands");
    SendClientMessage(playerid, 0xFFFFFFFF, "-------- Admins Online -------");
    for(new i = 0; i != MAX_PLAYERS; i++)
    {
        if(PVar[i][alevel] > 0)
        {
           
            format(str, sizeof(str), "%s, %s (ID %d) - %s.", AdminLevelToName(i), RemoveUnderScore(i), i, AdminStatusToName(i));
            SendClientMessage(playerid, 0xFFFFFFFF, str);
            found = 1;
        }
    }
    if(found == 0)
    {
        SendClientMessage(playerid, 0xFFFFFFFF, "There are no admins online");
    }
    SendClientMessage(playerid, 0xFFFFFFFF, "-----------------------------------");
    return 1;
}
Reply
#2

You can't do it after you format it...

The colours are part of the string you format
Reply
#3

Quote:
Originally Posted by FUNExtreme
Посмотреть сообщение
You can't do it after you format it...

The colours are part of the string you format
Just edited main post, it's during the formatting.
Reply
#4

Quote:
Originally Posted by vIBIENNYx
Посмотреть сообщение
Just edited main post, it's during the formatting.
Well, what you tried should work.. It doesn't?

EDIT: Embed colours look like this {FFFFFF}, there is no alpha channel
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)