[ScoreBoard] How to hide certain ULX Groups on Tab Menu?
5 replies, posted
Alright, so I'm trying to figure out how I could configure this Scoreboard or a.k.a Tab Menu to not show certain ULX Groups such as superadmin.
You see I have my ULX rank set to superadmin and I hate it when random people join and bug me for Staff because I'm the owner.
Please do not argue with me about my intentions. I'm just simply looking for help not a fight. Thank you.
Here's the code for the Score Board
[code]
/*--------------------------------------------------*\
| You can only change things before the warning text |
\*--------------------------------------------------*/
local mainbackground = Color(0,0,0,0) // Default color is 0,0,0,255
local clbackground = Color(235,235,235,255) // Default color is 235,235,235,255
local topbackground = Color(38,38,38,255) // Default color is 63,67,78,255
local tagsbackground = Color(54,54,54,255) // Default color is 54,54,54,255
local rowcolor = Color(79,83,95,255) // Default color is 79,83,95,255
local rowhovercolor = Color(255,255,255,0) // Default color is 255,255,255,0
local colorrowteam = true // Default false, if it is set to true the player row color will be changed based on the team color.
//Easy way of adding new ranks
ranksCol = {}
ranksCol['defualt'] = Color(38,127,0) //Green
ranksCol['defualt2'] = Color(200,0,0) //Red
ranksCol['defualt3'] = Color(255,216,0) //Yellow
ranksCol['defualt4'] = rowcolor //Default Row Color
ranksIcon = {}
--Staff
ranksIcon['owner'] = Material("materials/scoreboard/icons/aicon.png")
ranksIcon['co-owner'] = Material("materials/scoreboard/icons/aicon.png")
ranksIcon['superadmin'] = Material("materials/scoreboard/icons/aicon.png")
ranksIcon['head-admin'] = Material("materials/scoreboard/icons/aicon.png")
ranksIcon['admin'] = Material("materials/scoreboard/icons/aicon.png")
ranksIcon['trial-admin'] = Material("materials/scoreboard/icons/aicon.png")
ranksIcon['head-mod'] = Material("materials/scoreboard/icons/micon.png")
ranksIcon['mod'] = Material("materials/scoreboard/icons/micon.png")
ranksIcon['trial-mod'] = Material("materials/scoreboard/icons/micon.png")
--Devs
--ranksIcon['head-developer'] = Material("materials/icons/head_dev-tab-icon.png")
--ranksIcon['developer'] = Material("materials/icons/dev-tab-icon.png")
--ranksIcon['web-developer'] = Material("materials/icons/web-tab-icon.png")
--Donators
ranksIcon['uber donator'] = Material("materials/scoreboard/icons/dicon.png")
ranksIcon['super donator'] = Material("materials/scoreboard/icons/dicon.png")
ranksIcon['donator'] = Material("materials/scoreboard/icons/dicon.png")
ranksIcon['respected'] = Material("materials/scoreboard/icons/dicon.png")
-- The logo size has to be 263x75
-- If logo is set to 0 then there will the blank space if you set a directory it will use that image as logo
-- When adding a directory do it like this Material("directory/filename.png or jpg")
local logo = 0
/*-------*\
| Warning |
\*-------*/
local w,h = ScrW(),ScrH()
local y,y2 = 0,0
-- 16:9
if w == 1280 and h == 720 then y = 75 end
if w == 1360 and h == 768 then y = 35 end
if w == 1366 and h == 768 then y = 35 end
if w == 1600 and h == 900 then y = 0 y2 = 80 end
if w == 1920 and h == 1080 then y = 0 y2 = 235 end
-- 16:10
if w == 1680 and h == 1050 then y = 0 y2 = 120 end
if w == 1600 and h == 1024 then y = 0 y2 = 80 end
if w == 1440 and h == 900 then y = 0 y2 = 0 end
if w == 1280 and h == 800 then y = 80 y2 = 0 end
if w == 1280 and h == 768 then y = 80 y2 = 0 end
-- 4:3
if w == 1280 and h == 1024 then y = 80 y2 = 0 end
if w == 1280 and h == 900 then y = 80 y2 = 0 end
if w == 1152 and h == 864 then y = 140 y2 = 0 end
--[[ Doesn't support the next resolutions
1024x768
800x600
720x576
640x480
]]
surface.CreateFont( "Info", {
font = "Bebas",
size = 19,
weight = 500,
antialias = true
})
surface.CreateFont( "Title", {
font = "Bebas",
size = 30,
weight = 500,
antialias = true
})
surface.CreateFont( "OtherInfo", {
font = "Bebas",
size = 24,
weight = 500,
antialias = true
})
surface.CreateFont( "NameRank", {
font = "Bebas",
size = 17,
weight = 500,
antialias = true
})
RunConsoleCommand("FAdmin_IsScoreboard", "0")
local function formatNumber(n)
n = tonumber(n)
if (!n) then
return 0
end
if n >= 1e14 then return tostring(n) end
n = tostring(n)
sep = sep or ","
local dp = string.find(n, "%.") or #n+1
for i=dp-4, 1, -3 do
n = n:sub(1, i) .. sep .. n:sub(i+1)
end
return n
end
function playercom(parent,x,y,text,image,color,name,command)
local userbtn = vgui.Create("DButton",parent)
userbtn:SetPos(x,y)
userbtn:SetSize(120,35)
userbtn:SetTextColor(Color(255,255,255))
userbtn:SetText(text)
userbtn:SetImage(image)
userbtn.Paint = function(self)
draw.RoundedBox(0,0,0,self:GetWide(),self:GetTall(),Color(51,51,51,255))
surface.SetDrawColor(color)
surface.DrawOutlinedRect(0,0,self:GetWide(),self:GetTall())
end
userbtn.DoClick = function()
surface.PlaySound("buttons/button9.wav")
chat.AddText(Color(255,60,60),"["..name.."]",Color(255,255,255)," was copied, just use CTRL+V to paste it.")
SetClipboardText(command)
end
return userbtn
end
function command(parent,x,y,text,image,color,command,...)
local btn = vgui.Create("DButton",parent)
btn:SetPos(x,y)
btn:SetSize(120,35)
btn:SetTextColor(Color(255,255,255))
btn:SetText(text)
btn:SetImage(image)
btn.Paint = function(self)
draw.RoundedBox(0,0,0,self:GetWide(),self:GetTall(),Color(51,51,51,255))
surface.SetDrawColor(color)
surface.DrawOutlinedRect(0,0,self:GetWide(),self:GetTall())
end
local cmdArgs = {...}
btn.DoClick = function()
surface.PlaySound("buttons/button9.wav")
RunConsoleCommand(command,unpack(cmdArgs))
end
return btn
end
function kick(parent,x,y,text,reason,image,color,command,ply)
local cbtn = vgui.Create("DButton",parent)
cbtn:SetSize(120,35)
cbtn:SetPos(x,y)
cbtn:SetTextColor(Color(255,255,255))
cbtn:SetText(text)
cbtn:SetImage(image)
cbtn.Paint = function(self)
draw.RoundedBox(0,0,0,self:GetWide(),self:GetTall(),Color(51,51,51,255))
surface.SetDrawColor(color)
surface.DrawOutlinedRect(0,0,self:GetWide(),self:GetTall())
end
cbtn.DoClick = function()
surface.PlaySound("buttons/button9.wav")
local reportmsg = vgui.Create( "DFrame" )
reportmsg:SetPos(ScrW() / 2 - 200, ScrH() / 2 - 120)
reportmsg:SetSize(400,100)
reportmsg:SetTitle("")
reportmsg:SetVisible(true)
reportmsg:SetDraggable(false)
reportmsg:SetBackgroundBlur(true)
reportmsg:ShowCloseButton(true)
reportmsg:MakePopup()
local tellad = vgui.Create("DLabel",reportmsg)
tellad:SetPos(reportmsg:GetWide()/2-100,22)
tellad:SetText(reason)
tellad:SizeToContents()
story = vgui.Create("DTextEntry",reportmsg)
story:SetPos(10,42)
story:SetTall(20)
story:SetWide(reportmsg:GetWide()-20)
story:RequestFocus()
local accept = vgui.Create("DButton",reportmsg)
accept:SetPos(100,65)
accept:SetSize(80,30)
accept:SetImage('icon16/accept.png')
accept:SetText('Accept')
accept.DoClick = function()
if IsValid(reportmsg) then
reportmsg:Close()
end
AlertMessage = story:GetValue()
RunConsoleCommand("ulx",command,ply,AlertMessage)
end
local cancel = vgui.Create("DButton",reportmsg)
cancel:SetPos(230,65)
cancel:SetSize(80,30)
cancel:SetImage('icon16/cross.png')
cancel:SetText('Cancel')
cancel.DoClick = function()
if IsValid(reportmsg) then
reportmsg:Close()
end
end
end
return btn
end
function ban(parent,x,y,text,reason,image,color,command,ply)
local cbtn = vgui.Create("DButton",parent)
cbtn:SetSize(120,35)
cbtn:SetPos(x,y)
cbtn:SetTextColor(Color(255,255,255))
cbtn:SetText(text)
cbtn:SetImage(image)
cbtn.Paint = function(self)
draw.RoundedBox(0,0,0,self:GetWide(),self:GetTall(),Color(51,51,51,255))
surface.SetDrawColor(color)
surface.DrawOu
make in the for loop that sets the row-rank variables for each player something like
[code]
local hideline = {
"superadmin" = true,
"admin" = true,
}
if hideline[ply:GetUserGroup()] then return end
[/code]
and the table at the top, add the groups you want to be hidden in it.
or simply make the "translation" of superadmin to nil.
[QUOTE=whitestar;48761800]make in the for loop that sets the row-rank variables for each player something like
[code]
local hideline = {
"superadmin" = true,
"admin" = true,
}
if hideline[ply:GetUserGroup()] then return end
[/code]
and the table at the top, add the groups you want to be hidden in it.
or simply make the "translation" of superadmin to nil.[/QUOTE]
Thank you for the help, but I'm trying to make it so I don't even show up in the Tab Menu. Like so it looks like I'm not even on the Server.
then do it in the for loop, where it creates the row ;)
[QUOTE=whitestar;48763057]then do it in the for loop, where it creates the row ;)[/QUOTE]
I definitally sound stupid.. But wheres that? :P
[QUOTE=LOT;48763332]I definitally sound stupid.. But wheres that? :P[/QUOTE]
Thats the thing, I don't see any for loop either, are you sure thats the whole scoreboard file, and its not seperated into two files? maybe I'm just too stupid and its an advanced scoreboard.
[editline]26th September 2015[/editline]
nvm, try putting it after line 345 - where it sets the variable "plyRank".
Sorry, you need to Log In to post a reply to this thread.