• Rejax's TTT Scoreboard Not Working
    3 replies, posted
So I have been using Rejax's TTT scoreboard addon for the past few months with no issues. About 1-2 weeks ago the rank color stopped to work, and all the ranks are white. The name color, however, still works fine. I'll paste the code below. Thank you! [lua] EZS = {} -- what's one more global to the fray EZS.Ranks = {} --[[ CONFIG ]]-- EZS.Enabled = true -- you can set a silkicon to be used, by adding a "icon" field. for example: icon = "heart" will be drawn as "icon16/heart.png" -- for a full list of silkicons, go to [url]http://www.famfamfam.com/lab/icons/silk/previews/index_abc.png[/url] --EZS.Ranks["rank OR steamid"] = { name = "displayname", color = RankColor, namecolor = (optional), admin = are they admin? (true/false) } EZS.Ranks["kingdowny"] = { name = "King Downy", color = ("rainbow") , admin = false } EZS.Ranks["downy"] = { name = "Downy", color = Color( 24, 151, 14 ), namecolor = Color( 24, 151, 14 ), admin = false } EZS.Ranks["regular"] = { name = "Regular", color = Color( 128, 128, 128), namecolor = Color( 128, 128, 128), admin = false } EZS.Ranks["member"] = { name = "Member", color = Color( 51, 153, 255), namecolor = Color( 51, 153, 255), admin = false } EZS.Ranks["trusted"] = { name = "Trusted", color = Color( 54, 94, 255 ), namecolor = Color( 54, 94, 255 ), admin = false } EZS.Ranks["vip"] = { name = "VIP", color = ("rainbow") , admin = false } EZS.Ranks["operator"] = { name = "Operator", color = Color( 215, 183, 24 ), namecolor = Color( 215, 183, 24 ), admin = false } EZS.Ranks["admin"] = { name = "Admin", color = Color( 188, 28, 28), namecolor = Color( 188, 28, 28), admin = true } EZS.Ranks["highadmin"] = { name = "High Admin", color = Color( 0, 255, 64), namecolor = Color( 0, 255, 64), admin = true } EZS.Ranks["[highadmin]"] = { name = "Member", color = Color( 51, 153, 255), namecolor = Color( 51, 153, 255), admin = true } EZS.Ranks["headadmin"] = { name = "Head Admin", color = Color( 153, 51, 204), namecolor = Color( 153, 51, 204), admin = true } EZS.Ranks["servermanager"] = { name = "Server Manager", color = Color( 0, 255, 255), namecolor = Color( 0, 255, 255), admin = true } EZS.Ranks["generalmanager"] = { name = "General Manager", color = Color( 204, 0, 0), namecolor = Color( 204, 0, 0), admin = true } EZS.Ranks["owner"] = { name = "Owner", color = Color( 0, 0, 0), namecolor = Color( 0, 0, 0), admin = true } EZS.Ranks["superadmin"] = { name = "Member", color = Color( 51, 153, 255), namecolor = Color( 51, 153, 255), admin = true } -- label enable on the top? what should it say? EZS.CreateRankLabel = { enabled = true, text = "Rank" } -- what to show when the player doesnt have an entry EZS.DefaultLabel = "" -- sadly there is no way to shift the background bar over as TTT draws it manually :c EZS.HideBackground = false -- Width of the rank columns EZS.ColumnWidth = 50 -- the number of columns (not pixels!!!!!!!) to shift to the left EZS.ShiftLeft = 0 -- shift tags, search marker, etc how much? (IN PIXELS) EZS.ShiftOthers = 200 -- Show icon as well as rank text? (if possible) EZS.ShowIconsWithRanks = true -- Should the icon shift to the left to accomodate the label? EZS.ShiftIconsWithLabels = true -- if ^ is false, where should the icons go (like EZS.ShiftLeft)? EZS.ShiftIconsLeft = 0 -- How far left should we shift the icon RELATIVE to the rank text? EZS.ShiftRankIcon = 0 -- should we color the names? EZS.UseNameColors = true -- if there is no name color set, should we use the rank color? EZS.DefaultNameColorToRankColor = true -- should names get dynamic (changing) color? EZS.AllowNamesToHaveDynamicColor = true EZS.DynamicColors = {} EZS.DynamicColors.rainbow = function( ply ) local frequency, time = .5, RealTime() local red = math.sin( frequency * time ) * 127 + 128 local green = math.sin( frequency * time + 2 ) * 127 + 128 local blue = math.sin( frequency * time + 4 ) * 127 + 128 return Color( red, green, blue ) end EZS.RightClickFunction = { enabled = true, ask_admins = true, functions = { ["User Functions"] = { ["Show Profile"] = function( ply ) ply:ShowProfile() end, ["Copy SteamID"] = function( ply ) SetClipboardText( ply:SteamID() ) chat.AddText( color_white, ply:Nick() .. "'s SteamID (", Color( 200, 200, 200 ), ply:SteamID(), color_white, ") copied to clipboard!" ) end, _icon = "icon16/group.png", }, ["Admin Functions"] = { { ["Kick"] = { func = function( ply ) RunConsoleCommand( "ulx", "kick", ply:Nick():gsub( ";", "" ) ) end, icon = "icon16/user_delete.png" }, ["Slay"] = { func = function( ply ) RunConsoleCommand( "ulx", "slay", ply:Nick():gsub( ";", "" ) ) end, icon = "icon16/pill.png" }, }, { ["Mute"] = { func = function( ply ) RunConsoleCommand( "ulx", "mute", ply:Nick():gsub( ";", "" ) ) end, icon = "icon16/pill.png" }, ["Un-Mute"] = { func = function( ply ) RunConsoleCommand( "ulx", "unmute", ply:Nick():gsub( ";", "" ) ) end, icon = "icon16/pill.png" }, }, { ["Gag"] = { func = function( ply ) RunConsoleCommand( "ulx", "gag", ply:Nick():gsub( ";", "" ) ) end, icon = "icon16/sound_mute.png" }, ["Un-Gag"] = { func = function( ply ) RunConsoleCommand( "ulx", "ungag", ply:Nick():gsub( ";", "" ) ) end, icon = "icon16/sound.png" }, }, { ["Goto"] = { func = function( ply ) RunConsoleCommand( "ulx", "goto", ply:Nick():gsub( ";", "" ) ) end, icon = "icon16/sound_mute.png" }, ["Bring"] = { func = function( ply ) RunConsoleCommand( "ulx", "bring", ply:Nick():gsub( ";", "" ) ) end, icon = "icon16/sound.png" }, }, _icon = "icon16/shield.png", } } } hook.Run( "EZS_AddRightClickFunction", EZS.RightClickFunction.functions ) --[[ END CONFIG ]]-- for id, rank in pairs( EZS.Ranks ) do if rank.icon then rank.iconmat = Material( ("icon16/%s.png"):format( rank.icon ) ) end rank.dynamic_col = isstring( rank.color ) rank.dynamic_namecol = isstring( rank.namecolor ) end local function RealUserGroup( ply ) if ply.EV_GetRank then return ply:EV_GetRank() end return ply:GetUserGroup() end function EZS.GetRank( ply ) return EZS.Ranks[ply:SteamID()] or EZS.Ranks[RealUserGroup( ply )] end function EZS.Dynamic( rank, ply ) return (EZS.DynamicColors[rank.color] or EZS.DynamicColors.rainbow)( ply ) end function EZS.HandleShift( sb ) if EZS.ShiftLeft < 1 then return end local function ShiftLeft( parent ) local k = EZS.HideBackground and 6 or 5 local p = parent.cols[k] if not p then return end local shift = EZS.HideBackground and 1 or 0 local karma = KARMA.IsEnabled() and 0 or 1 local left = ( 5 - karma ) - EZS.ShiftLeft local posx, posy = p:GetPos() local mod = ( 50 * ( ( left + shift ) - #parent.cols ) ) p:SetPos( posx + mod, posy ) end if sb.ply_groups then -- sb_main local OldPerformLayout = sb.PerformLayout sb.PerformLayout = function( s ) OldPerformLayout( s ) ShiftLeft( s ) end else -- sb_row local OldLayoutColumns = sb.LayoutColumns sb.LayoutColumns = function( s ) OldLayoutColumns( s ) ShiftLeft( s ) EZS.HandleTags( s ) end end end function EZS.HandleTags( sb ) if EZS.ShiftOthers <= 0 then return end -- copy some from base local cx = sb:GetWide() - 90 for k,v in ipairs(sb.cols) do cx = cx - v.Width end sb.tag:SizeToContents() sb.tag:SetPos((cx - sb.tag:GetWide()/2) - EZS.ShiftOthers, (SB_ROW_HEIGHT - sb.tag:GetTall()) / 2) sb.sresult:SizeToContents() sb.sresult:SetPos((cx - 8)-EZS.ShiftOthers, (SB_ROW_HEIGHT - 16) / 2) end function EZS.AddSpacer( w ) EZS.Scoreboard:AddColumn( "", function() return "" end, w or 0 ) end function EZS.AddRankLabel( sb ) EZS.Scoreboard = sb local heading = EZS.CreateRankLabel.enabled and EZS.CreateRankLabel.text or "" local function AttachDynamicColor( label, ply ) label.HasRainbow = true label.Think = function( s ) if not IsValid( ply ) then return end local rank =
It's because this uses SetTextColor. That will be fixed in the next hotfix
When will the next hotfix be released?
Was this morning I believe
Sorry, you need to Log In to post a reply to this thread.