Color help
#5

Colors are integers so treat them as integers. "i" specifier in sscanf and decimalColor as an integer, then just:
pawn Код:
SetPlayerColor(playerid, (decimalColor << 8) | 0xFF);
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:
pawn Код:
#define RGB_COLOR(%0,%1,%2,%3) (((%0) << 24) | ((%1) << 16) | ((%2) << 8) | ((%3) << 0))
and set it as (assuming R, G and B are symbols defined and used in sscanf with "iii" specifiers):
pawn Код:
SetPlayerColor(playerid, RGB_COLOR(R, G, B, 255));
As for color embedding, use in arguments: color >>> 8 as shown
pawn Код:
format(..." ... {%06x} ...", GetPlayerColor(playerid) >>> 8, ...);
Reply


Messages In This Thread
Color help - by TwinkiDaBoss - 26.05.2016, 16:10
Re: Color help - by justjamie - 26.05.2016, 16:13
Re: Color help - by TwinkiDaBoss - 26.05.2016, 16:15
Re: Color help - by Dayrion - 26.05.2016, 16:34
Re: Color help - by Konstantinos - 26.05.2016, 16:37
Re: Color help - by Stinged - 26.05.2016, 16:43
Re: Color help - by TwinkiDaBoss - 26.05.2016, 21:58

Forum Jump:


Users browsing this thread: 1 Guest(s)