SA-MP Forums Archive
Float to hex - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Float to hex (/showthread.php?tid=350348)



Float to hex - zgintasz - 12.06.2012

Hi guys,

Is there function posted in this forum, that converts float to hex? There is web, but I need that in pawn . I searched, but I didn't find.

Thanks!

EDIT: I mean not hex, but alpha in color codes(0x000000FF, bolded is alpha)


Re: Float to hex - iggy1 - 12.06.2012

I have never seen one, but i can't think of a reason it would be useful. May i ask why you need this function?


Re: Float to hex - zgintasz - 12.06.2012

Thanks for post.
Hm, I have a variable, the I divide 255 by it. Then I'm getting float value(e.x 255 / 300 = 0.85). That's opacity. I need to convert it to alpha(0x000000FF, bolded is alpha)