Loading playercolor for factions
#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
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.");
You could also use a function to convert them (if needed)
pawn Код:
RGBAlpha(& color, rgba) {
    if(rgba) { // rgba - argb
        color = (color << 24) | (color >>> 8);
    } else { // argb - rgba
        color = (color >>> 24) | (color << 8);
    }
}
Reply


Messages In This Thread
Loading playercolor for factions - by xAzKingx - 22.01.2015, 09:16
Re: Loading playercolor for factions - by Threshold - 22.01.2015, 10:34
Re: Loading playercolor for factions - by xAzKingx - 22.01.2015, 10:44
Re: Loading playercolor for factions - by Threshold - 22.01.2015, 11:25
AW: Loading playercolor for factions - by Nero_3D - 22.01.2015, 12:40
Re: Loading playercolor for factions - by xAzKingx - 22.01.2015, 13:14
Re: Loading playercolor for factions - by xAzKingx - 22.01.2015, 21:16
AW: Re: Loading playercolor for factions - by Nero_3D - 23.01.2015, 12:42
Re: AW: Re: Loading playercolor for factions - by xAzKingx - 23.01.2015, 15:34
AW: Loading playercolor for factions - by Nero_3D - 23.01.2015, 16:10

Forum Jump:


Users browsing this thread: 2 Guest(s)