30.09.2018, 10:30
Quote:
Код:
new string[64]; format(string, sizeof(string), "This is a {%06x}clan color", clanInfo[clanid][clanColor] >>> 8); SendClientMessage(playerid, -1, string); |
Quote:
pawn Код:
|
Quote:
Do not use strings for storing colors. Colors ARE integers!
When a player types the desired clan color: FF0000 Use sscanf and "x" specifier to retrieve integer and store it in the integer clanColor (get rid of the array size). You can limit text to 6 characters if you want to. Then you can use partially what ConnorW posted but without `>>> 8` as the color will not have an alpha value. |
pawn Код:
stock getClanColor(clanid) {
new color_show = 0xFFFFFFFF;
sscanf(clanInfo[clanid][clanColor], "x", color_show);
return color_show;
}