[B]I HAVE FIXED MY ISSUE[/B]
The issue I was having was that my host requires the addon to be all lowercase to connect to the servers.
Thanks anyways! :)
So is it possible yet to add 2 collumns with this addon? Like one for staff rank and one for donor status?
:snip:
It's possible using the plain old TTT hooks but there's no easy way to do it within EZS right now.
I'll add it asap
Is it possible for the custom icons to be aligned neatly with each other automatically, and position them so they don't overlap other TTT features, like the identification magnifying glass or the player labelling system? As right now, with the current settings I'm using (I'll reply if you need them), they are shifting with different amounts depending on the length of the custom rank title being used on each player.
Also, is there any way to make custom titles for individual players (using their SteamIDs) simply inherit all the other features in their title (color, icon, etc.) from their ULX usergroups, without having to copy the same code? This way, if their rank changes, they would keep their custom title, but the colors and icons change automatically to suit.
Legendary addon! Many thanks.
Thanks rejax!
I have done some coding with the scoreboard myself and had to use the old self.Cols[5] and so on. But i would like to use this since I feel the code would work much better then my crap code.
[QUOTE=rejax;48369908]It's possible using the plain old TTT hooks but there's no easy way to do it within EZS right now.
I'll add it asap[/QUOTE]
This would be a huge plus, hope to see it implemented soon :)
Update soon?
Hi everyone!
Sorry about being inactive - been dealing with a lot of personal stress recently and just neglected this thread.
However, I have pushed a development branch onto github that you can try!
[URL="https://github.com/rejax/TTT-EasyScoreboard/tree/development"]https://github.com/rejax/TTT-EasyScoreboard/tree/development[/URL]
The way the config is set up has completely changed, I have rewritten the whole thing from scratch with respect for future changes.
So far it is on feature parity with the old version, plus some extras (like adding extra columns is now very straightforward, soon there will be steamid-rank inheritance)
If anyone wants to give it a try - I haven't written any explanations for the new config, but hopefully the structure will be enough to follow. Otherwise just post any questions here.
Cheers :)
Finally! Will look into it.
I have a few questions:
Colors don't seem to work for the columns?
How do i use custom ranks? (ie. Trial Moderator)
Oops! [URL=]Fixed[/URL] the color bug. Sorry about that.
You would add the rank to the "entries" table in whatever column you're adding it to.
So for trial moderator you'd have an entry like
[CODE]
entries = {
..., -- etc
["trial moderator"] = {
...
}
}
[/CODE]
Does colored text not work for the 2nd column/donator status? I get an error when i try to implement the text with a color.
Also, i am getting random errors, i don't know what triggers it
[ERROR] addons/ttt-easyscoreboard-development/lua/autorun/client/ezs.lua:225: Tried to use a NULL entity!
1. SteamID - [C]:-1
2. getEntry - addons/ttt-easyscoreboard-development/lua/autorun/client/ezs.lua:225
3. getColumnTextColor - addons/ttt-easyscoreboard-development/lua/autorun/client/ezs.lua:262
4. unknown - addons/ttt-easyscoreboard-development/lua/autorun/client/ezs.lua:281
Hello!
My server is not displaying the ranks on the scoreboard, it will only show "S. Admin" on the scoreboard
I went in and changed the code so that "superadmin" says "Owner" and that changed it to owner on the Scoreboard
But I would like it to display custom Ranks and although I can make them and assign them on the gui, there is nothing on the Scoreboard, just blank
Please help!
[QUOTE=seabeds;48849931]Does colored text not work for the 2nd column/donator status? I get an error when i try to implement the text with a color.
Also, i am getting random errors, i don't know what triggers it
[ERROR] addons/ttt-easyscoreboard-development/lua/autorun/client/ezs.lua:225: Tried to use a NULL entity!
1. SteamID - [C]:-1
2. getEntry - addons/ttt-easyscoreboard-development/lua/autorun/client/ezs.lua:225
3. getColumnTextColor - addons/ttt-easyscoreboard-development/lua/autorun/client/ezs.lua:262
4. unknown - addons/ttt-easyscoreboard-development/lua/autorun/client/ezs.lua:281[/QUOTE]
I've added validity checks to stop those errors - couldn't replicate them on my game.
Colored text works for any column, what error are you getting?
[QUOTE=KanJam;48856208]Hello!
My server is not displaying the ranks on the scoreboard, it will only show "S. Admin" on the scoreboard
I went in and changed the code so that "superadmin" says "Owner" and that changed it to owner on the Scoreboard
But I would like it to display custom Ranks and although I can make them and assign them on the gui, there is nothing on the Scoreboard, just blank
Please help![/QUOTE]
Are you using the development version?
Post your config please
[editline]8th October 2015[/editline]
Added [b]steamid to rank inheritance (on by default)[/b] and a variable "show_ranks". Set it to true and the rank column will show players actual ranks - ie what you should set in the config.
Actually My co-owner and I were able to figure the Rank on the scoreboard issue by going through this forum, so thank you for the great add-on!
However, we're not able to see the ranks in chat, is that a separate thing? How do I go about getting that in?
[QUOTE=KanJam;48861340]Actually My co-owner and I were able to figure the Rank on the scoreboard issue by going through this forum, so thank you for the great add-on!
However, we're not able to see the ranks in chat, is that a separate thing? How do I go about getting that in?[/QUOTE]
That's a separate addon, this only affects the TTT scoreboard.
It is a very simple job if you want to try your hand at some basic scripting, though! You can always ask for help in the developer discussion section :)
I'm trying to ranks to scoreboard with colors but I got some errors, this is the code for the 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("superadmin") then
self.cols[5]:SetText("Owner")
self.cols[5]:SetTextColor(Color(0,0,102,204))
end
if ply:IsUserGroup("admin") then
self.cols[5]:SetText("Admin")
self.cols[5]:SetTextColor(Color(0,239,255,255))
end
if ply:IsUserGroup("Terbis") then
self.cols[5]:SetText("Terbis")
self.cols[5]:SetTextColor(Color(0,125,92,60))
end
if ply:IsUserGroup("Eclipe") then
self.cols[5]:SetText("Eclipe")
self.cols[5]:SetTextColor(Color(0,55,50,45))
end
if ply:IsUserGroup("Jinx") then
self.cols[5]:SetText("Jinx")
self.cols[5]:SetTextColor(Color(0,219,62,225))
end
if ply:IsUserGroup("Malignus") then
self.cols[5]:SetText("Malignus
self.cols[5]:SetTextColor(Color(0,137,52,247))
end
if ply:IsUserGroup("Zephyr") then
self.cols[5]:SetText("Zephyr")
self.cols[5]:SetTextColor(Color(0,131,226,102))
end
if ply:IsUserGroup("Soleis") then
self.cols[5]:SetText("Soleis")
self.cols[5]:SetTextColor(Color(0,229,223,62))
end
if ply:IsUserGroup("Velios") then
self.cols[5]:SetText("Velios")
self.cols[5]:SetTextColor(Color(0,255,149,27))
end
if ply:IsUserGroup("Novex") then
self.cols[5]:SetText("Novex")
self.cols[5]:SetTextColor(Color(0,255,34,0))
end
if ply:IsUserGroup("Aeon") then
self.cols[5]:SetText("Aeon")
self.cols[5]:SetTextColor(Color(0,102,178,255))
end
if ply:IsUserGroup("Infinis") then
self.cols[5]:SetText("Infinis")
self.cols[5]:SetTextColor(Color(0,230,230,230))
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.png")
self.sresult:SetImageColor(Color(170, 170, 170, 150))
end
function PANEL:LayoutColumns()
for k,v in ipairs(self.cols) do
if k == 5 then
v:SizeToContents()
v:SetPos(self:GetWide() - (55*k) - v:GetWide()/2, (SB_ROW_HEIGHT - v:GetTall()) / 2)
else
v:SizeToContents()
v:SetPos(self:GetWide() - (50*k) - v:GetWide()/2, (SB_ROW_HEIGHT - v:GetTall()) / 2)
end
end
self.tag:SizeToContents()
self.tag:SetPos(self:GetWide() - (50 * 6) - self.tag:GetWide()/2, (SB_ROW_HEIGHT - self.tag:GetTall()) / 2)
self.sresult:SetPos(self:GetWide() - (50*6) - 8, (SB_ROW_HEIGHT - 16) / 2)
end
function PANEL:PerformLayout()
self.avatar:
You should not be directly modifying the scoreboard - use this addon and fill out the config to your liking.
[QUOTE=rejax;48884452]You should not be directly modifying the scoreboard - use this addon and fill out the config to your liking.[/QUOTE]
Oh okay, thanks haha, I don't know why I thought that would work. Anyways, is there a way to make it that there's more than 1 color on a word? Like alternate colors for letters in the word?
[QUOTE=Aerosoft;48889100]Oh okay, thanks haha, I don't know why I thought that would work. Anyways, is there a way to make it that there's more than 1 color on a word? Like alternate colors for letters in the word?[/QUOTE]
Not currently possible, but you can have the color cycle through the rainbow with the "rainbow" color setting.
The custom Tag over Scoreboard option seems to not be persistent. They are reset on map switch.
How would i have usernames on the scoreboard colored, other than "rainbow"?
[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=https://github.com/rejax/TTT-EasyScoreboard/archive/v1.1.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]
Hello, I am having an issue where the rank column shows up, but the name of the ranks and colors doesn't show up. Have any idea what could cause this ? I tried to remove some addons to see if it could be the cause, but it doesn't seem like it. Thanks.
[QUOTE=seabeds;49458698]How would i have usernames on the scoreboard colored, other than "rainbow"?[/QUOTE]
Add a "namecolor = Color(red, green, blue)" entry to the EZS.Ranks["rank"]
for example, making a superadmin's name red but rank blue would be
[CODE]EZS.Ranks["superadmin"] = {color = Color(0, 0, 255), namecolor = Color(255, 0, 0), name = "SuperAdmin", admin = true}[/CODE]
[QUOTE=meckado;49639735]Hello, I am having an issue where the rank column shows up, but the name of the ranks and colors doesn't show up. Have any idea what could cause this ? I tried to remove some addons to see if it could be the cause, but it doesn't seem like it. Thanks.[/QUOTE]
What do your EZS.Ranks look like? What are the actual ranks on your server?
[QUOTE=rejax;49641297]Add a "namecolor = Color(red, green, blue)" entry to the EZS.Ranks["rank"]
for example, making a superadmin's name red but rank blue would be
[CODE]EZS.Ranks["superadmin"] = {color = Color(0, 0, 255), namecolor = Color(255, 0, 0), name = "SuperAdmin", admin = true}[/CODE]
What do your EZS.Ranks look like? What are the actual ranks on your server?[/QUOTE]
EZS.Ranks["superadmin"] = { name = "Superadmin", color = Color( 255, 255, 0 ), namecolor = Color( 0, 255, 0 ), admin = true }
EZS.Ranks["owner"] = { name = "Owner", color = Color( 255, 0, 0 ), namecolor = Color( 255, 0, 0 ), admin = true }
EZS.Ranks["admin"] = { name = "Admin", color = Color( 150, 100, 100 ), admin = true }
EZS.Ranks["veteran"] = { name = "Veteran", color = Color( 0, 0, 100 ), admin = false }
EZS.Ranks["addicted"] = { name = "Addicted", color = Color( 0, 0, 100 ), admin = false }
This is what it looks like, I have tried other kinds of scoreboard ranks addon, that works with ulx for example, and I always get the same issue.
[QUOTE=SaintSin6;45538941]I had it working fairly recently.
[url]http://facepunch.com/showthread.php?t=1356376&p=44834050&viewfull=1#post44834050[/url]
[img]http://puu.sh/ax3Pp/ba94a1f1fa.jpg[/img]
[/QUOTE]
Hi
How would I change the background color for the server name?
Also Im not sure if this is possible but can i change that detective player image in the top left corner with some other image?
Thanks
Edit: Also if possible could I remove the deaths coloumn?
? Anyone?
navigate to gamemodes/terrortown/gamemode/vgui/
1) Change the RGB color on line 178 of sb_main.lua
2) Change the material used on line 25 of sb_main.lua
3) Put a comment (-- at the start) of line 138 of sb_main.lua and line 22 of sb_row.lua
you'll have to see if that results in the desired outcome in-game, but it should be good from what I can see
[QUOTE=rejax;50305589]navigate to gamemodes/terrortown/gamemode/vgui/
1) Change the RGB color on line 178 of sb_main.lua
2) Change the material used on line 25 of sb_main.lua
3) Put a comment (-- at the start) of line 138 of sb_main.lua and line 22 of sb_row.lua
you'll have to see if that results in the desired outcome in-game, but it should be good from what I can see[/QUOTE]
I understand everything except what you meant to say on 3) could you elaborate more? Thanks
[QUOTE=baebaeron;50305889]I understand everything except what you meant to say on 3) could you elaborate more? Thanks[/QUOTE]
change the lines from
[code]blah blah blah etc[/code]
to
[code]-- blah blah blah etc[/code]
Sorry, you need to Log In to post a reply to this thread.