MitnickP56 Posted February 6, 2016 Posted February 6, 2016 Hi, I have problem about rgbtohex code: (If someone has logged in administrator then outputchatbox ( info) ). function pokazloginy(thePlayer) local team = getPlayerTeam(thePlayer) local r, g, b = getTeamColor(team) local hex = RGBToHex (r, g, b) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) then outputChatBox ( hex..getPlayerName(thePlayer).." #CFECECADMINIST#ff3301", root, 255, 255, 255, true) end end addEventHandler("onPlayerLogin",root, pokazloginy) 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 Debugscript:
Tomas Posted February 6, 2016 Posted February 6, 2016 function pokazloginy() local team = getPlayerTeam(source) local r, g, b = getTeamColor(team) local hex = RGBToHex (r, g, b) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) then outputChatBox ( hex..getPlayerName(source).." #CFECECADMINIST#ff3301", root, 255, 255, 255, true) end end addEventHandler("onPlayerLogin",root, pokazloginy)
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