Color help
#5

Quote:
Originally Posted by ConnorW
Посмотреть сообщение
Код:
new string[64];
format(string, sizeof(string), "This is a {%06x}clan color", clanInfo[clanid][clanColor] >>> 8);
SendClientMessage(playerid, -1, string);
I didn't ask that. I want to put the color instead of -1, like SendClientMessage(playerid, getClanColor(clanid), string);

Quote:
Originally Posted by ReD_HunTeR
Посмотреть сообщение
pawn Код:
stock GetClanColor(clanid)
{
    new color;
    color = clanInfo[clanid][clanColor];
    color <<= 8;
    color |= 0xFF;
    return color;
}
try this, not sure if it works.
it doesn't work, the color is black always....

Quote:
Originally Posted by Calisthenics
Посмотреть сообщение
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.
I've tried something like this, and it doesn't work.

pawn Код:
stock getClanColor(clanid) {
    new color_show = 0xFFFFFFFF;
    sscanf(clanInfo[clanid][clanColor], "x", color_show);
    return color_show;
}
Reply


Messages In This Thread
Color help - by None1337 - 30.09.2018, 09:11
Re: Color help - by d3Pedro - 30.09.2018, 09:23
Re: Color help - by ReD_HunTeR - 30.09.2018, 09:33
Re: Color help - by Calisthenics - 30.09.2018, 09:39
Re: Color help - by None1337 - 30.09.2018, 10:30
Re: Color help - by Calisthenics - 30.09.2018, 10:43
Re: Color help - by None1337 - 30.09.2018, 14:37

Forum Jump:


Users browsing this thread: 1 Guest(s)