Color help.
#1

Hello. I'm making a gang zones system and I have a little problem with colors.

Код:
mysql_get_field("gang_color", sql);
        format(sql,sizeof(sql),"%sFF",sql);
		sscanf(sql, "x", GangColor);
        gang[ID][Color] = GangColor;
What could be wrong, because it doesn't work. When I type for example white all good.
Reply
#2

Hex colors are integers, so your making it MUCH harder on yourself by storing them as strings. Even if you truely wanted to store them as such, why not just store the ending alpha value with it, instead of formatting the string with it?

Just store the color as an integer and save yourself the trouble of doing all this tedious work :P.

Btw, i wrote an article regarding hex that i think will be of use to you: https://sampwiki.blast.hk/wiki/Hex.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)