iiv03 Posted November 8, 2019 Share Posted November 8, 2019 (edited) i want to ask how i should extract colors from the server to client i used local r,g,b = unpack(enemy_color) for client and this worked with tocolor(....255) so how to use it like #FFFFFF? my trying Quote local colours = unpack(enemy_color) dxDrawText("Team Name:"..colours..enemy_team..", 450,40,64,20,tocolor(255,255,255,255),1.00,"default-bold","center","center",false) Edited November 8, 2019 by xFabel Link to comment
root. Posted November 8, 2019 Share Posted November 8, 2019 https://wiki.multitheftauto.com/wiki/DxDrawText Use colorCoded argument Link to comment
iiv03 Posted November 8, 2019 Author Share Posted November 8, 2019 (edited) 5 minutes ago, Rut said: https://wiki.multitheftauto.com/wiki/DxDrawText Use colorCoded argument i know but i wanna set team vs team that's what i want example: dxDrawText("Players: [#060660"..team_home.."/"..colorenemy..team_enemy.."], etc. . . . . Edited November 8, 2019 by xFabel Link to comment
alexaxel705 Posted November 8, 2019 Share Posted November 8, 2019 function RGBToHex(red, green, blue, alpha) if((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255) or (alpha and (alpha < 0 or alpha > 255))) then return nil end if(alpha) then return string.format("#%.2X%.2X%.2X%.2X", red,green,blue,alpha) else return string.format("#%.2X%.2X%.2X", red,green,blue) end end dxDrawText(RGBToHex(getTeamColor(getTeamFromName("Police"))).."Police", 450,40,64,20,tocolor(255,255,255,255),1.00,"default-bold","center","center", nil, nil, nil, true) 1 Link to comment
iiv03 Posted November 8, 2019 Author Share Posted November 8, 2019 2 minutes ago, alexaxel705 said: function RGBToHex(red, green, blue, alpha) if((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255) or (alpha and (alpha < 0 or alpha > 255))) then return nil end if(alpha) then return string.format("#%.2X%.2X%.2X%.2X", red,green,blue,alpha) else return string.format("#%.2X%.2X%.2X", red,green,blue) end end dxDrawText(RGBToHex(getTeamColor(getTeamFromName("Police"))).."Police", 450,40,64,20,tocolor(255,255,255,255),1.00,"default-bold","center","center", nil, nil, nil, true) thank youuu 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