• TTT - Easy Scoreboard Ranks
    308 replies, posted
I've been meaning to make a thread for a while, essentially this is just a script I wrote to make adding ranks/colors to the scoreboard easy. The hope was that people would stop making threads about "Help me with scoreboard pls". [URL=https://github.com/rejax/TTT-EasyScoreboard/archive/master.zip]Download[/URL] [URL=https://github.com/rejax/TTT-EasyScoreboard]GitHub[/URL] The config options are self explanatory, but if you're confused read the github readme and make a post here.
[QUOTE=rejax;43722058]I've been meaning to make a thread for a while, essentially this is just a script I wrote to make adding ranks/colors to the scoreboard easy. The hope was that people would stop making threads about "Help me with scoreboard pls". [URL=http://uppercutservers.com/rejax/ttt_easyscoreboard.zip]Here's the download link[/URL] The things you can config are: EZS.Colors["superadmin"] = Color( 255, 0, 0 ) - Will make superadmins have a red name EZS.Ranks["superadmin"] = "S. Admin" - Will make superadmins be represented by "S. Admin EZS.RankPos = Number - Where the rank will be, 5 is right next to the karma, 7 is in the ~middle EZS.CreateRankLabel = { enabled = true, text = "Rank" } - Do you want a label on top? It will show whatever you set text to EZS.UseNameColors = true/false - Set true to use EZS.Colors to color ranks. if false all will be white Cheers![/QUOTE] Testing when I get Home!
Any reason you don't do it like [CODE] EZS.Ranks = { superadmin = { name = "S. Admin", color = Color(255, 0, 0) }, moderator = { name = "Moderator", color = Color(0, 0, 255) } } [/CODE] Just seems like a better table layout.
I was trying to make it as straightforward as possible to someone with no lua knowledge. Just figured it would be easier to understand
Hi I was wondering if I could set it so that it doesn't goes so wide apart? The difference in width is too big between 5 and 6. It would be great if I could get it as soon as possible :D
Going to test this out soon.
Do stop by my server relax! I am adding you to the Donator (for helping me) rank! IP: nightflaregaming.no-ip.org
[QUOTE=EverCandy;43944037]Hi I was wondering if I could set it so that it doesn't goes so wide apart? The difference in width is too big between 5 and 6. It would be great if I could get it as soon as possible :D[/QUOTE] show me a picture with what you have and what you want
[QUOTE=rejax;43945106]show me a picture with what you have and what you want[/QUOTE] It would be much easier if you just came to my server instead and see for yourself :D. However it is not up today :(. I already sent you a friend request to tell ya more details. It would also be great if you came so that I can add you to the "Donator" rank! :DDDDDDD
WHy not post here, that way anyone who wants the same can easily see and do the same.
[QUOTE=EverCandy;43957609]It would be much easier if you just came to my server instead and see for yourself :D. However it is not up today :(. I already sent you a friend request to tell ya more details. IP: nightflaregaming.no-ip.org It would also be great if you came so that I can add you to the "Donator" rank! :DDDDDDD[/QUOTE] [QUOTE=EverCandy;43945086]Do stop by my server rejax! I am adding you to the Donator (for helping me) rank! IP: nightflaregaming.no-ip.org[/QUOTE] Please, stop advertising your server, if you want the author to join your server for a rank, PM him, instead of including the ip to your served in each reply. I know you're trying to be nice, but advertising your server on someone else's thread, just to gain one more user to the two user server is quite disrespectful.
[QUOTE=ENG.jonny;43960568]Please, stop advertising your server, if you want the author to join your server for a rank, PM him, instead of including the ip to your served in each reply. I know you're trying to be nice, but advertising your server on someone else's thread, just to gain one more user to the two user server is quite disrespectful. [/QUOTE] Okay then understood. I wasn't really advertising however, I really wanted to add in him to the server as a donor that's all. No harm intended. Simply giving him the ip to the server so that he could join for more info about my problem. (PS: I tried adding him as friend to discuss with him but he wouldn't accept :c) Didn't notice I added my ip twice :P Imma remove one of it. [editline]19th February 2014[/editline] So I went to dig up for the initial "method" as to how I thought it was done and I changed the format a little and there :D. (Managed to do it after about an hour) Here is how I wanted it be (focus on the coordinates of the "Owner" Tag) [IMG]http://i.imgur.com/KJGkR9L.jpg[/IMG] Here is how it is currently (Notice how the "Rank" and "Owner" tag are so far apart) [IMG]http://i.imgur.com/MLXrpRj.jpg[/IMG] Here is the code I used for "sb_row.lua". [CODE] ---- Scoreboard player score row, based on sandbox version include("sb_info.lua") local GetTranslation = LANG.GetTranslation local GetPTranslation = LANG.GetParamTranslation SB_ROW_HEIGHT = 24 --16 local PANEL = {} function PANEL:Init() -- cannot create info card until player state is known self.info = nil self.open = false self.cols = {} self.cols[1] = vgui.Create("DLabel", self) self.cols[1]:SetText(GetTranslation("sb_ping")) self.cols[5] = vgui.Create("DLabel", self) self.cols[5]:SetText("") self.cols[2] = vgui.Create("DLabel", self) self.cols[2]:SetText(GetTranslation("sb_deaths")) self.cols[3] = vgui.Create("DLabel", self) self.cols[3]:SetText(GetTranslation("sb_score")) if KARMA.IsEnabled() then self.cols[4] = vgui.Create("DLabel", self) self.cols[4]:SetText(GetTranslation("sb_karma")) end for _, c in ipairs(self.cols) do c:SetMouseInputEnabled(false) end self.tag = vgui.Create("DLabel", self) self.tag:SetText("") self.tag:SetMouseInputEnabled(false) self.sresult = vgui.Create("DImage", self) self.sresult:SetSize(16,16) self.sresult:SetMouseInputEnabled(false) self.avatar = vgui.Create( "AvatarImage", self ) self.avatar:SetSize(SB_ROW_HEIGHT, SB_ROW_HEIGHT) self.avatar:SetMouseInputEnabled(false) self.nick = vgui.Create("DLabel", self) self.nick:SetMouseInputEnabled(false) self.voice = vgui.Create("DImageButton", self) self.voice:SetSize(16,16) self:SetCursor( "hand" ) end local namecolor = { default = COLOR_WHITE, admin = Color(220, 180, 0, 255), dev = Color(100, 240, 105, 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 end return namecolor.default end local function ColorForPlayer(ply) if IsValid(ply) then local c = hook.Call("TTTScoreboardColorForPlayer", GAMEMODE, ply) -- verify that we got a proper color if c and type(c) == "table" and c.r and c.b and c.g and c.a then return c else ErrorNoHalt("TTTScoreboardColorForPlayer hook returned something that isn't a color!\n") end end return namecolor.default end function PANEL:Paint() if not IsValid(self.Player) then return end -- if ( self.Player:GetFriendStatus() == "friend" ) then -- color = Color( 236, 181, 113, 255 ) -- end local ply = self.Player if ply:IsTraitor() then surface.SetDrawColor(255, 0, 0, 30) surface.DrawRect(0, 0, self:GetWide(), SB_ROW_HEIGHT) elseif ply:IsDetective() then surface.SetDrawColor(0, 0, 255, 30) surface.DrawRect(0, 0, self:GetWide(), SB_ROW_HEIGHT) end if ply == LocalPlayer() then surface.SetDrawColor( 200, 200, 200, math.Clamp(math.sin(RealTime() * 2) * 50, 0, 100)) surface.DrawRect(0, 0, self:GetWide(), SB_ROW_HEIGHT ) end return true end function PANEL:SetPlayer(ply) self.Player = ply self.avatar:SetPlayer(ply) if not self.info then local g = ScoreGroup(ply) if g == GROUP_TERROR and ply != LocalPlayer() then self.info = vgui.Create("TTTScorePlayerInfoTags", self) self.info:SetPlayer(ply) self:InvalidateLayout() elseif g == GROUP_FOUND or g == GROUP_NOTFOUND then self.info = vgui.Create("TTTScorePlayerInfoSearch", self) self.info:SetPlayer(ply) self:InvalidateLayout() end else self.info:SetPlayer(ply) self:InvalidateLayout() end self.voice.DoClick = function() if IsValid(ply) and ply != LocalPlayer() then ply:SetMuted(not ply:IsMuted()) end end self:UpdatePlayerData() end function PANEL:GetPlayer() return self.Player end function PANEL:UpdatePlayerData() if not IsValid(self.Player) then return end local ply = self.Player self.cols[1]:SetText(ply:Ping()) self.cols[2]:SetText(ply:Deaths()) self.cols[3]:SetText(ply:Frags()) if ply:IsUserGroup("Owner") then self.cols[5]:SetText("Owner") self.cols[5]:SetTextColor(Color(252,192,13,252)) end if ply:IsUserGroup("admin") then self.cols[5]:SetText("Admin") self.cols[5]:SetTextColor(Color(0,239,255,255)) end if ply:IsUserGroup("headadmin") then self.cols[5]:SetText("H.Admin") self.cols[5]:SetTextColor(Color(0,239,255,255)) end if ply:IsUserGroup("superadmin") then self.cols[5]:SetText("S.Admin") self.cols[5]:SetTextColor(Color(0,239,255,255)) end if ply:IsUserGroup("superadmind") then self.cols[5]:SetText("S.Admin") self.cols[5]:SetTextColor(Color(0,239,255,255)) end if ply:IsUserGroup("trialadmin") then self.cols[5]:SetText("T.Admin") self.cols[5]:SetTextColor(Color(0,239,255,255)) end if ply:IsUserGroup("trusted") then self.cols[5]:SetText("Trusted") self.cols[5]:SetTextColor(Color(0,255,0,255)) end if ply:IsUserGroup("donator") then self.cols[5]:SetText("Donator") self.cols[5]:SetTextColor(Color(172,41,229,172)) end if self.cols[4] then self.cols[4]:SetText(math.Round(ply:GetBaseKarma())) end self.nick:SetText(ply:Nick()) self.nick:SizeToContents() self.nick:SetTextColor(ColorForPlayer(ply)) local ptag = ply.sb_tag if ScoreGroup(ply) != GROUP_TERROR then ptag = nil end self.tag:SetText(ptag and GetTranslation(ptag.txt) or "") self.tag:SetTextColor(ptag and ptag.color or COLOR_WHITE) self.sresult:SetVisible(ply.search_result != nil) -- more blue if a detective searched them if ply.search_result and (LocalPlayer():IsDetective() or (not ply.search_result.show)) then self.sresult:SetImageColor(Color(200, 200, 255)) end -- cols are likely to need re-centering self:LayoutColumns() if self.info then self.info:UpdatePlayerData() end if self.Player != LocalPlayer() then local muted = self.Player:IsMuted() self.voice:SetImage(muted and "icon16/sound_mute.png" or "icon16/sound.png") else self.voice:Hide() end end function PANEL:ApplySchemeSettings() for k,v in pairs(self.cols) do v:SetFont("treb_small") v:SetTextColor(COLOR_WHITE) end self.nick:SetFont("treb_small") self.nick:SetTextColor(ColorForPlayer(self.Player)) local ptag = self.Player and self.Player.sb_tag self.tag:SetTextColor(ptag and ptag.color or COLOR_WHITE) self.tag:SetFont("treb_small") self.sresult:SetImage("icon16/magnifier.p
You shouldn't include the ip anyway... Just PM him it. I doubt the author would even play tbh.
[QUOTE=EverCandy;43969153]what[/QUOTE] did you even download the addon? you don't need to edit sb_row at all you just change EZS.RankPos to 5 to align it also - updated to add support for evolve
[QUOTE=rejax;43969597]did you even download the addon? you don't need to edit sb_row at all you just change EZS.RankPos to 5 to align it also - updated to add support for evolve[/QUOTE] I am one my phone at the moment so I cant access the files but anyways. Does this support ScrW and ScrH ? Because a lot of my clients are reporting the text of the ranks in people's names and I had to remove it.
Send me the file when you can and I'll take a look
Just out of curiosity, do you have any affiliation with efhunterzone, rejax?
Nope?
[QUOTE=ENG.jonny;43969472]You shouldn't include the ip anyway... Just PM him it. I doubt the author would even play tbh.[/QUOTE] I don't see why u have to be so rude about it. And besides, I can't be grateful that he helped me and I want to properly thank him? Are you saying that because you weren't taught proper manners? And didn't I tell you that I tried PMing him but he didn't accept my friend request? Did you even fucking read? If you not going to be helping me then please shut the fuck up and read only. [editline]20th February 2014[/editline] [QUOTE=rejax;43969597]did you even download the addon? you don't need to edit sb_row at all you just change EZS.RankPos to 5 to align it also - updated to add support for evolve[/QUOTE] Yes of course! I putted in in the lua/autorun/client/ I was just telling you that the past method I tried which was editing sv_row.lua allowed one to be able to adjust the coordinates of the "Rank" tab and the rank itself more accurately while however yours is not as accurate (no insulting your addon or what not). I was wondering if you could improve it.
Where have I been rude? Have I swarm to get the point out? No. Have I insulted you? No. Have you swarm to get the point out? Yes. Have you been insulting? Yes. It appears if anyone doesn't have manners or anyone who wasn't taught proper manners, it's you. You don't need to add someone as a friend to PM someone on Facepunch, so I don't even know what you've been trying to do, clearly something that has put you in a bad mood. The reply you have given indicates clearly that your temper is very short and bad, and has instantly given me the impression your server isn't good in any form, due to a bad tempered owner. If you're that "grateful" for this Addon release, you wouldn't ask for it to be improved.
[QUOTE=ENG.jonny;43982850]If you're that "grateful" for this Addon release, you wouldn't ask for it to be improved.[/QUOTE] I agree with all your points except this, and I'm going to see if I can implement that suggestion sometime
In a sense it is a suggestion, but people should be happy with what they get in a free release. Either way, suggestions are still good I suppose.
[QUOTE=rejax;43980381]Nope?[/QUOTE] Ah, alright. Just wondered.
From what I saw in the screenshots, the sort of suspect thing on Trouble In Terrorist Town which makes it so you can enemy people etc. could interfere with this, you may have to move it to the left a little.
[QUOTE] I doubt the author would even play tbh. [/QUOTE] ^ If that isn't rude then that is just being inconsiderate about others feeling. You are indirectly saying that my Gmod server sucks and that it is not worth being played by rejax. And if you look clearly, I only insulted you ONCE. So I don't see how I have been insulting when I only insulted you in particular once. I don't see how I am the problem here, when I am giving suggestions and maybe common problems that people might face and ask in the future. And plus, you saw that I wasn't very demanding on my questions, in fact I asked nicely at least until you came in and ruined my mood. My temper is generally very good, until people like you come in to this kind of thread and push me to my limit. You are lucky that I ain't even insulting you any further. And how is my server lousy? (The fact that you even typed "given me the impression your server isn't good in any form" implies to me that you think it is lousy) The fact that I spent so much time and effort into this thread trying to get this to work for my server shows that I care for my server and the people in it. I've read a lot of suggestions from the regulars in my server and they told me to get this "addon" so I decided to research and try out a little. I took many days trying to get it to work properly so what gives you the right to judge? Are you the one managing my server? And how is asking for an improvement bad? If rejax indeed still continues to update it, it shows that this "addon" still works and that he still cares about it and will constantly update it. Are you also saying that I can't be grateful for someone else's hardwork? I am not a lua coder or anything that good enough to be able to code it myself so why can't I be grateful to someone who knows how to code lua? If I don't have manners then who are you to speak? You are even worse than me and you dare to speak? And it really shows how immatured you are if even continued this, when it was clearly YOU who started all this. I was very friendly and nice at first and I even accepted your point even though I didn't do it on purpose. I already edited it but you still had to add it in and just be mean about it. If you weren't going to apologise, then at least don't even stress the issue about him not coming to the server. What are you? His father? His mother? If you look very closely after I posted screenshots and some information on my supposedly "problem", you still kept continuing that topic on my accidental advertising when I already got over it. YOU are the one who refused to let go and just forget. You just had to be very negative and continue that topic. And how do you expect me to PM him other than adding him as a friend on Steam? Call him in real life? Email him (he didn't even include his email to even begin with)? Create a youtube video for it? Cmon get real. This whole time I have only been feeling very negative points coming for you. As if you didn't want people to comment and ask questions pertaining to this thread. If you are truly matured and smart, then you wouldn't even be continuing this meaningless battle which you started in the first place. In fact, you should actually by right apologise at least for what you did. Or just keep quiet from now and try to help the author out. I don't think it will be easy for him because if this threads gets popular and people start to visit it, I am pretty sure he will get loads of questions. [editline]21st February 2014[/editline] [QUOTE=ENG.jonny;43983268] people should be happy with what they get in a free release. [/QUOTE] So you are saying that the author (rejax) should charge people for this "addon"? And plus he is just doing this to prevent people from asking this question pertaining on how to add the ranks tab and rank itself in tab. If he wanted people to use this instead of asking constantly, then it would totally defect the purpose of even creating this thread. However, if he wanted he could add a donate button for people to donate instead of making people pay for it. I won't be able sadly because I am currently in need of money to officially run a real server. Not only if he made it so that you have to pay for it, people will also buy it and upload it somewhere else for others to use. And plus, this is a simple "addon" which could have been done by these two threads: - [url]http://www.facepunch.com/showthread.php?t=1229063[/url] - [url]http://facepunch.com/showthread.php?t=1101202[/url] If you actually think about it, he could also add an ad redirect link to the download file. I'm sure he could get some money out of it if he indeed does continuously update it. People will have visit the ad redirect link again and he $$Profits$$.
Just pushed an update so you can do more precise placement. Set EZS.RankOffset to whatever you want, 0 to disable. Working for me, tell me if there are any bugs
[QUOTE=rejax;43994739]Just pushed an update so you can do more precise placement. Set EZS.RankOffset to whatever you want, 0 to disable. Working for me, tell me if there are any bugs[/QUOTE] Thanks a bunch! :DDDDDDDD [editline]21st February 2014[/editline] Oh ya quick question: is this lua error caused by this "addon" or just my server? It kept making my server crash every few hours. Note that everyone in the server receives this lua error. I tried resetting cl_targetid and also the cl_hud but nothing happened :( [CODE] [ERROR] gamemodes/terrortown/gamemode/cl_targetid.lua:286: 'TargetIDSmall' isn't a valid font 1. SetFont - [C]:-1 2. HUDDrawTargetID - gamemodes/terrortown/gamemode/cl_targetid.lua:286 3. unknown - gamemodes/terrortown/gamemode/cl_hud.lua:321 [/CODE] I'm not really sure so it would be great if you could tell me :DDDDDD
I don't touch on anything regarding that, check your addons.
[QUOTE=rejax;43996015]I don't touch on anything regarding that, check your addons.[/QUOTE] Oh okay ty. Imma go research it then :P
I don't know if this is asking too much, rejax, another nice thing about editing sb_row is being able to add the tinted background to the rank column as well (like in the image below). Is there any chance you could add that as well? [IMG]http://i.imgur.com/UPt69XI.jpg[/IMG]
Sorry, you need to Log In to post a reply to this thread.