SA-MP Forums Archive
format bug ( hexadecimal numbers ) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP (https://sampforum.blast.hk/forumdisplay.php?fid=3)
+--- Forum: Bug Reports (https://sampforum.blast.hk/forumdisplay.php?fid=20)
+--- Thread: format bug ( hexadecimal numbers ) (/showthread.php?tid=268001)



format bug ( hexadecimal numbers ) - kurta999 - 10.07.2011

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


Re: format bug ( hexadecimal numbers ) - Virtual1ty - 10.07.2011

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 !


Re: format bug ( hexadecimal numbers ) - Macluawn - 10.07.2011

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


Re: format bug ( hexadecimal numbers ) - Virtual1ty - 10.07.2011

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.