23.01.2015, 16:10
I would only save the main color (0xABCDEF) and ignore the alpha part if it is always FF (personal opinion can be ignored)
In the command the end should look now like that
You could also use a function to convert them (if needed)
In the command the end should look now like that
pawn Код:
//
new
rgba = (color << 8) | 0xFF, // normal functions - 0xABCDEFFF
argb = color | (0xFF << 24) // for objects - 0xFFABCDEF
;
FactionInfo[FACTION_ID][FactionColor] = rgba;
FactionInfo[FACTION_ID][FactionColor2] = argb;
return SendClientMessage(playerid, rgba, "This is the new color of your faction.");
pawn Код:
RGBAlpha(& color, rgba) {
if(rgba) { // rgba - argb
color = (color << 24) | (color >>> 8);
} else { // argb - rgba
color = (color >>> 24) | (color << 8);
}
}