Scoreboard Mod - Need vtf images infront of names in scoreboard - Will Pay!

What i’m trying to say is. I would love if someone could be generous enough to edit my scoreboard code, and make it so there is a collumn that shows the persons rank (First collumn) and in that collumn is a .vtf file. Etc:

(Insert Owner Vtf File here) Helix Alioth Citizen

Something like that. I’m willing to pay a couple of bucks
Add me on steam to negotiate. “Shadowblade90222”

I already have the .vtf’s, and if this helps, I am running ASSmod

Player_row.lua

[lua]
include(“player_infocard.lua”)

surface.CreateFont(“coolvetica”, 20, 500, true, false, “ScoreboardPlayerName”)

local texGradient = surface.GetTextureID(“gui/center_gradient”)
local texRatings = {}

texRatings[ ‘none’ ] = surface.GetTextureID(“gui/silkicons/user”)
texRatings[ ‘smile’ ] = surface.GetTextureID(“gui/silkicons/emoticon_smile”)
texRatings[ ‘friendly’ ] = surface.GetTextureID(“gui/silkicons/group”)
texRatings[ ‘love’ ] = surface.GetTextureID(“gui/silkicons/heart”)
texRatings[ ‘artistic’ ] = surface.GetTextureID(“gui/silkicons/palette”)
texRatings[ ‘star’ ] = surface.GetTextureID(“gui/silkicons/star”)
texRatings[ ‘builder’ ] = surface.GetTextureID(“gui/silkicons/wrench”)

surface.GetTextureID(“gui/silkicons/emoticon_smile”)
local PANEL = {}

/---------------------------------------------------------
Name: Paint
---------------------------------------------------------
/
function PANEL:Paint()
if not ValidEntity(self.Player) then return end

local color = team.GetColor(self.Player:Team())

if self.Armed then
	color = team.GetColor(self.Player:Team())
end

if self.Selected then
	color = team.GetColor(self.Player:Team())
end

if self.Player:Team() == TEAM_CONNECTING then
	color = Color(200, 120, 50, 255)
elseif self.Player:IsAdmin() then
	color = team.GetColor(self.Player:Team())
end

if self.Open or self.Size != self.TargetSize then
	draw.RoundedBox(4, 0, 16, self:GetWide(), self:GetTall() - 16, color)
	draw.RoundedBox(4, 2, 16, self:GetWide()-4, self:GetTall() - 16 - 2, Color(250, 250, 245, 255))

	surface.SetTexture(texGradient)
	surface.SetDrawColor(255, 255, 255, 255)
	surface.DrawTexturedRect(2, 16, self:GetWide()-4, self:GetTall() - 16 - 2)
end

draw.RoundedBox(4, 0, 0, self:GetWide(), 24, color)

surface.SetTexture(texGradient)
surface.SetDrawColor(255, 255, 255, 50)
surface.DrawTexturedRect(0, 0, self:GetWide(), 24)

surface.SetTexture(self.texRating)
surface.SetDrawColor(255, 255, 255, 255)
surface.DrawTexturedRect(4, 4, 16, 16)

return true

end

/---------------------------------------------------------
Name: UpdatePlayerData
---------------------------------------------------------
/
function PANEL:SetPlayer(ply)
if not ValidEntity(ply) then return end
self.Player = ply
self.infoCard:SetPlayer(ply)
self:UpdatePlayerData()
end

function PANEL:CheckRating(name, count)
if not ValidEntity(self.Player) then return end

if self.Player:GetNWInt("Rating."..name, 0) > count then
	count = self.Player:GetNWInt("Rating."..name, 0)
	self.texRating = texRatings[ name ]
end

return count

end

/---------------------------------------------------------
Name: UpdatePlayerData
---------------------------------------------------------
/
function PANEL:UpdatePlayerData()
if not ValidEntity(self.Player) then return end
local Team = LocalPlayer():Team()
self.lblName:SetText(self.Player:Name())
self.lblName:SizeToContents()
self.lblJob:SetText(self.Player:GetNWString(“job”))
self.lblJob:SizeToContents()
self.lblPing:SetText(self.Player:Ping())
self.lblWarranted:SetImage(“gui/silkicons/exclamation”)
if self.Player:GetNetworkedBool(“wanted”) then
self.lblWarranted:SetVisible(true)
elseif not self.Player:GetNetworkedBool(“wanted”) then
self.lblWarranted:SetVisible(false)
end

-- Work out what icon to draw
self.texRating = surface.GetTextureID("gui/silkicons/emoticon_smile")

self.texRating = texRatings[ 'none' ]
local count = 0

count = self:CheckRating('smile', count)
count = self:CheckRating('love', count)
count = self:CheckRating('artistic', count)
count = self:CheckRating('star', count)
count = self:CheckRating('builder', count)
count = self:CheckRating('friendly', count)

end

/---------------------------------------------------------
Name: PerformLayout
---------------------------------------------------------
/
function PANEL:Init()
self.Size = 24
self:OpenInfo(false)
self.infoCard = vgui.Create(“ScorePlayerInfoCard”, self)
self.lblName = vgui.Create(“Label”, self)
self.lblJob = vgui.Create(“Label”, self)
self.lblPing = vgui.Create(“Label”, self)
self.lblWarranted = vgui.Create(“DImage”, self)
self.lblWarranted:SetSize(16,16)

-- If you don't do this it'll block your clicks
self.lblName:SetMouseInputEnabled(false)
self.lblJob:SetMouseInputEnabled(false)
self.lblPing:SetMouseInputEnabled(false)
self.lblWarranted:SetMouseInputEnabled(false)

end

/---------------------------------------------------------
Name: PerformLayout
---------------------------------------------------------
/
function PANEL:ApplySchemeSettings()
self.lblName:SetFont(“ScoreboardPlayerName”)
self.lblJob:SetFont(“ScoreboardPlayerName”)
self.lblPing:SetFont(“ScoreboardPlayerName”)

self.lblName:SetFGColor(color_white)
self.lblJob:SetFGColor(color_white)
self.lblPing:SetFGColor(color_white)

end

/---------------------------------------------------------
Name: PerformLayout
---------------------------------------------------------
/
function PANEL:DoClick()
if self.Open then
surface.PlaySound(“ui/buttonclickrelease.wav”)
else
surface.PlaySound(“ui/buttonclick.wav”)
end

self:OpenInfo(not self.Open)

end

/---------------------------------------------------------
Name: PerformLayout
---------------------------------------------------------
/
function PANEL:OpenInfo(bool)
if bool then
self.TargetSize = 150
else
self.TargetSize = 24
end

self.Open = bool

end

/---------------------------------------------------------
Name: PerformLayout
---------------------------------------------------------
/
function PANEL:Think()
if self.Size != self.TargetSize then
self.Size = math.Approach(self.Size, self.TargetSize, (math.abs(self.Size - self.TargetSize) + 1) * 10 * FrameTime())
self:PerformLayout()
SCOREBOARD:InvalidateLayout()
end

if not self.PlayerUpdate or self.PlayerUpdate < CurTime() then
	self.PlayerUpdate = CurTime() + 0.5
	self:UpdatePlayerData()
end

end

/---------------------------------------------------------
Name: PerformLayout
---------------------------------------------------------
/
function PANEL:PerformLayout()
self:SetSize(self:GetWide(), self.Size)
self.lblName:SizeToContents()
self.lblName:SetPos(24, 2)

local COLUMN_SIZE = 50

self.lblPing:SetPos(self:GetWide() - COLUMN_SIZE * 1, 0)
self.lblJob:SetPos(self:GetWide() - COLUMN_SIZE * 7, 1)
self.lblWarranted:SetPos(self:GetWide() - COLUMN_SIZE * 8.8, 5)

if self.Open or self.Size != self.TargetSize then
	self.infoCard:SetVisible(true)
	self.infoCard:SetPos(4, self.lblName:GetTall() + 10)
	self.infoCard:SetSize(self:GetWide() - 8, self:GetTall() - self.lblName:GetTall() - 10)
else
	self.infoCard:SetVisible(false)
end

end

/---------------------------------------------------------
Name: PerformLayout
---------------------------------------------------------
/
function PANEL:HigherOrLower(row)
if not ValidEntity(row.Player) or not ValidEntity(self.Player) then return false end

if self.Player:Team() == TEAM_CONNECTING then return false end
if row.Player:Team() == TEAM_CONNECTING then return true end

if team.GetName(self.Player:Team()) == team.GetName(row.Player:Team()) then
	return team.GetName(self.Player:Team()) < team.GetName(row.Player:Team())
end

return team.GetName(self.Player:Team()) < team.GetName(row.Player:Team())

end

vgui.Register(“ScorePlayerRow”, PANEL, “Button”)
[/lua]

scoreboard.lua

[lua]
include(“player_row.lua”)
include(“player_frame.lua”)

SetGlobalString(“servertype”, “Listen”)
surface.CreateFont(“coolvetica”, 32, 500, true, false, “ScoreboardHeader”)
surface.CreateFont(“coolvetica”, 20, 500, true, false, “ScoreboardSubtitle”)

local texGradient = surface.GetTextureID(“gui/center_gradient”)

local PANEL = {}

/---------------------------------------------------------
Name: Paint
---------------------------------------------------------
/
function PANEL:Init()
SCOREBOARD = self

self.Hostname = vgui.Create("Label", self)
self.Hostname:SetText(GetGlobalString("ServerName"))

self.Description = vgui.Create("Label", self)
self.Description:SetText("DarkRP by Rickster, Updated: Pcwizdan, Sibre, philxyz, [GNC] Matt, Chrome Bolt, FPtje")

self.PlayerFrame = vgui.Create("PlayerFrame", self)

self.PlayerRows = {}

self:UpdateScoreboard()

-- Update the scoreboard every 1 second
timer.Create("ScoreboardUpdater", 1, 0, self.UpdateScoreboard, self)

self.lblJob = vgui.Create("Label", self)
self.lblJob:SetText("Job")

self.lblPing = vgui.Create("Label", self)
self.lblPing:SetText("Ping")

self.lblWarranted = vgui.Create("Label", self)
self.lblWarranted:SetText("Warranted")

end

/---------------------------------------------------------
Name: Paint
---------------------------------------------------------
/
function PANEL:AddPlayerRow(ply)
local button = vgui.Create(“ScorePlayerRow”, self.PlayerFrame:GetCanvas())
button:SetPlayer(ply)
self.PlayerRows[ ply ] = button
end

/---------------------------------------------------------
Name: Paint
---------------------------------------------------------
/
function PANEL:GetPlayerRow(ply)
return self.PlayerRows[ ply ]
end

/---------------------------------------------------------
Name: Paint
---------------------------------------------------------
/
function PANEL:Paint()
draw.RoundedBox(4, 0, 0, self:GetWide(), self:GetTall(), Color(255, 255, 255, 98))
surface.SetTexture(texGradient)
surface.SetDrawColor(50, 50, 50, 50)
surface.DrawTexturedRect(0, 0, self:GetWide(), self:GetTall())

-- White Inner Box
draw.RoundedBox(4, 4, self.Description.y - 4, self:GetWide() - 8, self:GetTall() - self.Description.y - 4, Color(0, 0, 0, 98))
surface.SetTexture(texGradient)
surface.SetDrawColor(255, 255, 255, 50)
surface.DrawTexturedRect(4, self.Description.y - 4, self:GetWide() - 8, self:GetTall() - self.Description.y - 4)

-- Sub Header
draw.RoundedBox(4, 5, self.Description.y - 3, self:GetWide() - 10, self.Description:GetTall() + 5, Color(0, 0, 0, 200))
surface.SetTexture(texGradient)
surface.SetDrawColor(0, 0, 0, 50)
surface.DrawTexturedRect(4, self.Description.y - 4, self:GetWide() - 8, self.Description:GetTall() + 8)

end

/---------------------------------------------------------
Name: PerformLayout
---------------------------------------------------------
/
function PANEL:PerformLayout()
self:SetSize(800, ScrH() * 0.95)
self:SetPos((ScrW() - self:GetWide()) / 2, (ScrH() - self:GetTall()) / 2)

self.Hostname:SizeToContents()
self.Hostname:SetPos(16, 16)

self.Description:SizeToContents()
self.Description:SetPos(16, 64)

self.PlayerFrame:SetPos(5, self.Description.y + self.Description:GetTall() + 20)
self.PlayerFrame:SetSize(self:GetWide() - 10, self:GetTall() - self.PlayerFrame.y - 10)

local y = 0

local PlayerSorted = {}

for k, v in pairs(self.PlayerRows) do
	table.insert(PlayerSorted, v)
end

table.sort(PlayerSorted, function (a , b) return a:HigherOrLower(b) end)

for k, v in ipairs(PlayerSorted) do
	v:SetPos(0, y)
	v:SetSize(self.PlayerFrame:GetWide(), v:GetTall())

	self.PlayerFrame:GetCanvas():SetSize(self.PlayerFrame:GetCanvas():GetWide(), y + v:GetTall())
	y = y + v:GetTall() + 1
end

self.Hostname:SetText(GetGlobalString("ServerName"))

self.lblPing:SizeToContents()
self.lblJob:SizeToContents()
self.lblWarranted:SizeToContents()

self.lblPing:SetPos(self:GetWide() - 50 - self.lblPing:GetWide()/2, self.PlayerFrame.y - self.lblPing:GetTall() - 3)
self.lblJob:SetPos(self:GetWide() - 50*7 - self.lblJob:GetWide()/2, self.PlayerFrame.y - self.lblPing:GetTall() - 3)
self.lblWarranted:SetPos(self:GetWide() - 50*9 - self.lblJob:GetWide()/2, self.PlayerFrame.y - self.lblPing:GetTall() - 3)

end

/---------------------------------------------------------
Name: ApplySchemeSettings
---------------------------------------------------------
/
function PANEL:ApplySchemeSettings()
self.Hostname:SetFont(“ScoreboardHeader”)
self.Description:SetFont(“ScoreboardSubtitle”)

self.Hostname:SetFGColor(Color(0, 0, 0, 200))
self.Description:SetFGColor(color_white)

self.lblPing:SetFont("DefaultSmall")
self.lblJob:SetFont("DefaultSmall")
self.lblWarranted:SetFont("DefaultSmall")

self.lblPing:SetFGColor(Color(0, 0, 0, 255))
self.lblJob:SetFGColor(Color(0, 0, 0, 255))
self.lblWarranted:SetFGColor(Color(0, 0, 0, 255))

end

function PANEL:UpdateScoreboard(force)
if not force and not self:IsVisible() then return end

for k, v in pairs(self.PlayerRows) do
	if not ValidEntity(k) then
		v:Remove()
		self.PlayerRows[ k ] = nil
	end
end

local PlayerList = player.GetAll()
for id, pl in pairs(PlayerList) do
	if not self:GetPlayerRow(pl) then
		self:AddPlayerRow(pl)
	end
end

-- Always invalidate the layout so the order gets updated
self:InvalidateLayout()

end

vgui.Register(“ScoreBoard”, PANEL, “Panel”)
[/lua]

Thank you so much! :slight_smile:

A little more info:

If Ply:IsAdmin() = Adminvtf
If Ply:IsSuperAdmin() = Superadminvtf

Then I have some other classes such as respected and owner, I don’t know how you can make that work… but yeah.

I’ll do it when I get home. (which is about in 6 hours)