• Set STEAMID to custom title and color
    5 replies, posted
What would the method of setting a Steam ID to a certain color AND a custom title be for the TTT scoreboard? And when I say "title" I am referring to: [lua]self.cols[6] = vgui.Create("DLabel", self) self.cols[6]:SetText("Title")[/lua] and [lua]if ply:IsUserGroup("trusted") then self.cols[6]:SetText("") self.cols[6]:SetTextColor(Color(255,255,255,255))[/lua] for an example.
[CODE] if ply:SteamID("steamidhere") then [/CODE] if i remember it correctly
Replace line 62-77 of terrortown\gamemode\vgui\sbrow.lua with [lua] local SpecialPeople = { "SteamID1", "SteamID2", "SteamID3" } local namecolor = { default = COLOR_WHITE, admin = Color(220, 180, 0, 255), dev = Color(100, 240, 105, 255), special = Color(255, 255, 255, 255) }; function GM:TTTScoreboardColorForPlayer(ply) if not IsValid(ply) then return namecolor.default end if ply:SteamID() == "STEAM_0:0:1963640" then return namecolor.dev elseif ply:IsAdmin() and GetGlobalBool("ttt_highlight_admins", true) then return namecolor.admin elseif SpecialPeople[ply:SteamID()] != nil then return namecolor.special end return namecolor.default end [/lua] Place the special SteamID's in the SpecialPeople table like shown and they will receive the special color. Not sure what you mean about titles though, but if you mean putting something before the players name do a similar check against the special table near line 164.
Edit the actual included gamemode files? you serious? i'd strongly suggest copying the entire file and making it an (overwriting) addon, the reasons are; - depending on the settings on his server, nobody will be able to join anymore (file mismatch) - if he ever repairs his gmod (verify integrity of game cache) the file will be reverted and his changes lost - steam update may undo his work (well the first time something in ttt updates anyway) maybe im just seeing things, idk, couldnt stop myself from posting the above though.
[QUOTE=Suicidal_B;41686756]Edit the actual included gamemode files? you serious? i'd strongly suggest copying the entire file and making it an (overwriting) addon, the reasons are; - depending on the settings on his server, nobody will be able to join anymore (file mismatch) - if he ever repairs his gmod (verify integrity of game cache) the file will be reverted and his changes lost - steam update may undo his work (well the first time something in ttt updates anyway) maybe im just seeing things, idk, couldnt stop myself from posting the above though.[/QUOTE] It's always best to keep your code separate from shipped gamemodes, if anything to stay up to date, I was just showing him what to edit. I doubt those parts of the scoreboard will really change much anyway.
[QUOTE=Suicidal_B;41686756]Edit the actual included gamemode files? you serious? i'd strongly suggest copying the entire file and making it an (overwriting) addon, the reasons are; - depending on the settings on his server, nobody will be able to join anymore (file mismatch) - if he ever repairs his gmod (verify integrity of game cache) the file will be reverted and his changes lost - steam update may undo his work (well the first time something in ttt updates anyway) maybe im just seeing things, idk, couldnt stop myself from posting the above though.[/QUOTE] You're suggesting that I shouldn't do what Looter said?
Sorry, you need to Log In to post a reply to this thread.