format bug ( hexadecimal numbers )
#1

Hi.

I'm try to send message/show dialog with player color, and this is the result:
Click


pawn Code:
#define XCOLOR_RED              FF0000

format(i_str, sizeof(i_str), "My Color:{%06x} %x{" #XCOLOR_RED "} | {%06x}%d", GetPlayerColor(player1) >>> 8, GetPlayerColor(player1), GetPlayerColor(player1) >>> 8, GetPlayerColor(player1));
Edit: This bug was fixed in 0.3c R5. Too late, but thanks for fix it
Reply
#2

With the code you posted the message in the picture should be returned black.
Therefore I can assume you are using the color-fix for GetPlayerColor.
This rules out the bug, as I can only make it an incorrect usage error.
Since the message color is returned OK -> the part behind 'MyColor:' there's not a thing you should worry about, right?
Conclusion: It's not a bug !
Reply
#3

I experienced the same bug(?) yesterday. Unfortunately the hex placeholder doesn't accept alpha numbers (last two digits).
Reply
#4

Alright then, as Maclauwn already stated, the format hex placeholder doesn't accept alpha numbers so you just right shift the GetPlayerColor it returns same as you did for all others ! I tested it and it seems to work.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)