30.09.2010, 15:37
Quote:
Such a macro isnt needed (in my opinion) since the compiler converts the hex by itself
And at 8F000000 the number turns negative (in the 32 bit version) And here the best version pawn Код:
|
Picture a /color command that supports 3 integers as parameters (Red, Green, and Blue) with values from 0-255. With this define it converts it into a single integer which can be used with SetPlayerColor. Thats what this function is for (there are more uses, thats just an example). This is a LOT easier than working with HEX values (IMO).
Here's an online tool which does the same (Its RGBA to Hex, but if you convert hex to an decimal format (base 10) it would be the same as what my define gives you).
RGBA CONVERTER
Edit:
Here's an article i wrote about hex (its rather short, and was just a template for my binary post, but its still useful).
https://sampwiki.blast.hk/wiki/Hex
Hex is just a different numeral system, colors are just one use of hex.