mtamaster97 Posted September 13, 2014 Share Posted September 13, 2014 I've problem with teamColors in Scoreboard, this is the code actualy its not mine i downloaded it on MTA Community and every team have Black title and Black tag, I want to have real team colors on it, ok code: if row.isTeamTitle then local playerTeam = getPlayerTeam(source) thisRowHeight = heightBlueBar nextRowTeamPlayerBgColor = row.teamPlayerBgColor -- use this as bg color for team players rows dxDrawRectangle(x, rowY, boardWidth, thisRowHeight, row.rowBgColor, drawOverGUI) local cx = x+5 local r, g, b = getTeamColor (playerTeam) dxDrawText(row.teamName, cx+1, rowY+1, cx+200, rowY+heightBlueBar, tocolor(0,0,0,255), 1, fontTitle12, "left", "center", false, false, drawOverGUI) dxDrawText(row.teamName, cx, rowY, cx+200, rowY+heightBlueBar, tocolor(r,g,b,255), 1, fontTitle12, "left", "center", false, false, drawOverGUI) else thisRowHeight = rowHeight local fullRowBgColor = rowBgColor if row.isLocalPlayer then fullRowBgColor = localPlayerBackgroundColor elseif row.isFriend then fullRowBgColor = friendBackgroundColor end dxDrawRectangle(x, rowY, boardWidth, thisRowHeight, fullRowBgColor, drawOverGUI) if nextRowTeamPlayerBgColor then dxDrawRectangle(x, rowY, boardWidth, thisRowHeight, nextRowTeamPlayerBgColor, drawOverGUI) end for o, mainColumn in ipairs(mainColumns) do for i, c in ipairs(mainColumn.columns) do if row[c.id] then local cx = x + mainColumn.x + c.x if c.bgcolor then dxDrawRectangle(cx, rowY, c.width, thisRowHeight, c.bgcolor, drawOverGUI, false) end local xOffset = c.xOffset or 0 local yOffset = c.yOffset or 0 if c.type == "dot" then dxDrawDot(cx+c.radius, rowY+1+c.radius, row[c.id], drawOverGUI) elseif c.type == "image" then dxDrawImage(cx+xOffset, rowY + yOffset, c.width, c.height, row[c.id], 0,0,0, tocolor(80,178,0,150), drawOverGUI) else local alignX = c.alignX or "left" local font = c.font or fontRow10 local r, g, b = getTeamColor (playerTeam) local color = row.color or c.color or tocolor(r,g,b,255) local isColorCoded = c.isColorCoded or false if isShadowRendered then local shadowText = row[c.id] if isColorCoded then shadowText = removeColorCodes(shadowText) end dxDrawText(shadowText, cx+xOffset-3, rowY+yOffset, cx+c.width+1.2, rowY+yOffset+thisRowHeight, tocolor(80,178,0), 1.02, fontRowBold10, alignX, "center", false, false, drawOverGUI, false, true) end dxDrawText(row[c.id], cx+xOffset, rowY+yOffset, cx+c.width, rowY+yOffset+thisRowHeight, color, 1, font, alignX, "center", fals, false, drawOverGUI, isColorCoded) end end end end end How to fix it? Link to comment
King12 Posted September 13, 2014 Share Posted September 13, 2014 if row.isTeamTitle then local playerTeam = getPlayerTeam(source) thisRowHeight = heightBlueBar nextRowTeamPlayerBgColor = row.teamPlayerBgColor -- use this as bg color for team players rows dxDrawRectangle(x, rowY, boardWidth, thisRowHeight, row.rowBgColor, drawOverGUI) local cx = x+5 local r, g, b = getTeamColor (playerTeam) dxDrawText(row.teamName, cx+1, rowY+1, cx+200, rowY+heightBlueBar, tocolor(0,0,0,255), 1, fontTitle12, "left", "center", false, false, drawOverGUI) dxDrawText(row.teamName, cx, rowY, cx+200, rowY+heightBlueBar, tocolor(r, g, b,255), 1, fontTitle12, "left", "center", false, false, drawOverGUI) else thisRowHeight = rowHeight local fullRowBgColor = rowBgColor if row.isLocalPlayer then fullRowBgColor = localPlayerBackgroundColor elseif row.isFriend then fullRowBgColor = friendBackgroundColor end dxDrawRectangle(x, rowY, boardWidth, thisRowHeight, fullRowBgColor, drawOverGUI) if nextRowTeamPlayerBgColor then dxDrawRectangle(x, rowY, boardWidth, thisRowHeight, nextRowTeamPlayerBgColor, drawOverGUI) end for o, mainColumn in ipairs(mainColumns) do for i, c in ipairs(mainColumn.columns) do if row[c.id] then local cx = x + mainColumn.x + c.x if c.bgcolor then dxDrawRectangle(cx, rowY, c.width, thisRowHeight, c.bgcolor, drawOverGUI, false) end local xOffset = c.xOffset or 0 local yOffset = c.yOffset or 0 if c.type == "dot" then dxDrawDot(cx+c.radius, rowY+1+c.radius, row[c.id], drawOverGUI) elseif c.type == "image" then dxDrawImage(cx+xOffset, rowY + yOffset, c.width, c.height, row[c.id], 0,0,0, tocolor(80,178,0,150), drawOverGUI) else local alignX = c.alignX or "left" local font = c.font or fontRow10 local r, g, b = getTeamColor (playerTeam) local color = row.color or c.color or tocolor(r, g, b,255) local isColorCoded = c.isColorCoded or false if isShadowRendered then local shadowText = row[c.id] if isColorCoded then shadowText = removeColorCodes(shadowText) end dxDrawText(shadowText, cx+xOffset-3, rowY+yOffset, cx+c.width+1.2, rowY+yOffset+thisRowHeight, tocolor(80,178,0), 1.02, fontRowBold10, alignX, "center", false, false, drawOverGUI, false, true) end dxDrawText(row[c.id], cx+xOffset, rowY+yOffset, cx+c.width, rowY+yOffset+thisRowHeight, color, 1, font, alignX, "center", fals, false, drawOverGUI, isColorCoded) end end end end end 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