Color help
#7

Quote:
Originally Posted by Calisthenics
Посмотреть сообщение
A player is asked to set a color for the clan. They type: FF0000
You retrieve it and store it as integer:
pawn Код:
// example:
new new_color;

if (strlen(inputtext) == 6 && !sscanf(inputtext, "x", new_color))
{
    // Assign to `clanColor`
    .. = (new_color << 8) | 0xFF;
}
else error..
Now you have an integer color with a full alpha and you can use it directly to the client message:
pawn Код:
SendClientMessage(playerid, clanInfo[clanid][clanColor], "This is the clan color");
Or you want to embed the color only for some part of the text:
pawn Код:
// example:
format(string, sizeof string, "A new gang {%06x}%s {FFFFFF}has been created.", new_clan_color >>> 8, new_clan_name);
SendClientMessage(playerid, -1, string);
The text will be all in white color except the clan name which will be in the clan color.
it doesn't work.
Reply


Messages In This Thread
Color help - by None1337 - 30.09.2018, 09:11
Re: Color help - by d3Pedro - 30.09.2018, 09:23
Re: Color help - by ReD_HunTeR - 30.09.2018, 09:33
Re: Color help - by Calisthenics - 30.09.2018, 09:39
Re: Color help - by None1337 - 30.09.2018, 10:30
Re: Color help - by Calisthenics - 30.09.2018, 10:43
Re: Color help - by None1337 - 30.09.2018, 14:37

Forum Jump:


Users browsing this thread: 1 Guest(s)