undefined Posted February 1, 2016 Share Posted February 1, 2016 tocolor(255, 255, 46, 220) -- Return -587202770 How can I get RGBA from this number? (-587202770) Link to comment
KariiiM Posted February 1, 2016 Share Posted February 1, 2016 From where you got this number? Link to comment
Bonsai Posted February 1, 2016 Share Posted February 1, 2016 Goooooooooogle! https://forum.multitheftauto.com/viewto ... 3&p=648320 Link to comment
undefined Posted February 1, 2016 Author Share Posted February 1, 2016 It's not work. Give warning and wrong numbers. function tocolorToRGBA(color) return bitExtract(color, 0, 8 ), bitExtract(color, 8, 8 ), bitExtract(color, 16, 8 ), bitExtract(color, 24, 8 ) -- Line 61 end local r,g,b,a = tocolorToRGBA(tocolor(255,255,255,255)) outputChatBox(r) -- Return 3 outputChatBox(g) -- Return 241 outputChatBox(b) -- Return 119 outputChatBox(a) -- Return 1 Link to comment
Bonus Posted February 2, 2016 Share Posted February 2, 2016 I searched and didnt find anything. Dont understand what tocolor is doing. tocolor ( 255, 255, 255, 255 ) is equal -1 tocolor ( 0, 0, 0, 0 ) is equal 0 tocolor ( 45, 213, 31, 31 ) is equal 523097375 tocolor ( 0, 0, 0, 255 ) is equal -16777216 tocolor ( 255, 255, 255, 0 ) is equal 16777216 (the opposite) Link to comment
Bonsai Posted February 2, 2016 Share Posted February 2, 2016 It's not work. Give warning and wrong numbers. function tocolorToRGBA(color) return bitExtract(color, 0, 8 ), bitExtract(color, 8, 8 ), bitExtract(color, 16, 8 ), bitExtract(color, 24, 8 ) -- Line 61 end local r,g,b,a = tocolorToRGBA(tocolor(255,255,255,255)) outputChatBox(r) -- Return 3 outputChatBox(g) -- Return 241 outputChatBox(b) -- Return 119 outputChatBox(a) -- Return 1 Hmm, it works for me. Link to comment
undefined Posted February 3, 2016 Author Share Posted February 3, 2016 Amazing... Which version are you using? Link to comment
Bonsai Posted February 3, 2016 Share Posted February 3, 2016 1.5.2 I just copied your code and put it into a clientside script. It didn't show that warning. Link to comment
undefined Posted February 3, 2016 Author Share Posted February 3, 2016 I restarted my server and mine is working well. Thank you for the link Bonsai. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now