26.05.2016, 16:37
Colors are integers so treat them as integers. "i" specifier in sscanf and decimalColor as an integer, then just:
I prefer using R G B as parameters though like "/setcolor 255 255 255" which is white. If you are interested in that method, use:
and set it as (assuming R, G and B are symbols defined and used in sscanf with "iii" specifiers):
As for color embedding, use in arguments: color >>> 8 as shown
pawn Код:
SetPlayerColor(playerid, (decimalColor << 8) | 0xFF);
pawn Код:
#define RGB_COLOR(%0,%1,%2,%3) (((%0) << 24) | ((%1) << 16) | ((%2) << 8) | ((%3) << 0))
pawn Код:
SetPlayerColor(playerid, RGB_COLOR(R, G, B, 255));
pawn Код:
format(..." ... {%06x} ...", GetPlayerColor(playerid) >>> 8, ...);