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.