Problem with font's

I am currently working on a script for the scoreboard but I have run into a problem with the font’s here are the 2 script’s that are getting the error. I can not seem to get a picture of the error but it is about the font’s saying it cannot create them

[lua]include(“player_infocard.lua”)

surface.CreateFont(“sansation”, 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.DarkRPVars["Rating."..name] or 0) > count then
	count = self.Player.DarkRPVars["Rating."..name] or 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.DarkRPVars.job or team.GetName(self.Player:Team()) or “”)
self.lblJob:SizeToContents()
self.lblPing:SetText(self.Player:Ping())
self.lblWarranted:SetImage(“gui/silkicons/exclamation”)
if self.Player.DarkRPVars.wanted then
self.lblWarranted:SetVisible(true)
elseif not self.Player.DarkRPVars.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(“RPScorePlayerInfoCard”, 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(“RPScorePlayerRow”, PANEL, “Button”)
[/lua]

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

SetGlobalString(“servertype”, “Listen”)
surface.CreateFont(“sansation”, 32, 500, true, false, “ScoreboardHeader”)
surface.CreateFont(“sansation”, 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, Eusion and Drakehawke")

self.PlayerFrame = vgui.Create("RPPlayerFrame", 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(“RPScorePlayerRow”, 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(“RPScoreBoard”, PANEL, “Panel”)
[/lua]

Hopefully someone can help



surface.CreateFont( "TheDefaultSettings", {
	font = "Arial",
	size = 13,
	weight = 500,
	blursize = 0,
	scanlines = 0,
	antialias = true,
	underline = false,
	italic = false,
	strikeout = false,
	symbol = false,
	rotary = false,
	shadow = false,
	additive = false,
	outline = false,
} )


Try something like this. Not sure if it will work. Also post what error your having please.

I got a picture of the error from console Here it is

Yup try what I sent you. You don’t have all the arguments. Arguments are the things in between the parentheses. They exist in functions, and many more!

Can you send me the correct code because you didn’t really explain where I should put those

Read the error, you didn’t send a table in. You must have changed his code

He sent you the correct code in code tags…

Just replace your surface.CreateFont with the one I sent you. Example :



surface.CreateFont( "CustomFontNameGoesHere", {
	font = "FONTFILENAMEGOESHERE",
	size = 13,
	weight = 500,
	blursize = 0,
	scanlines = 0,
	antialias = true,
	underline = false,
	italic = false,
	strikeout = false,
	symbol = false,
	rotary = false,
	shadow = false,
	additive = false,
	outline = false,
} )


What do I do with ScoreboardHeader

I don’t even know what you mean by that. Is that the name of the file or the customname?

surface.CreateFont(“sansation”, 32, 500, true, false, “ScoreboardHeader”) <That is the original code

I want to know what I do with ScoreboardHeader

Just assuming scoreboardheader is the custom name it would look like this



surface.CreateFont( "ScoreboardHeader", {
	font = "sansation",
	size = 13,
	weight = 500,
	blursize = 0,
	scanlines = 0,
	antialias = true,
	underline = false,
	italic = false,
	strikeout = false,
	symbol = false,
	rotary = false,
	shadow = false,
	additive = false,
	outline = false,
} )


I did that I do not get any error’s but I do not get the scoreboard could it be the file in the autorun here is the code for it
[lua]if SERVER then

AddCSLuaFile()
AddCSLuaFile( "scoreboard/admin_buttons.lua" )
AddCSLuaFile( "scoreboard/player_frame.lua" )
AddCSLuaFile( "scoreboard/player_infocard.lua" )
AddCSLuaFile( "scoreboard/player_row.lua" )
AddCSLuaFile( "scoreboard/scoreboard.lua" )
AddCSLuaFile( "scoreboard/vote_button.lua" )

return

end

include(“scoreboard/scoreboard.lua”)

local pScoreBoard = nil

–[[-------------------------------------------------------
Name: gamemode:CreateScoreboard()
Desc: Creates/Recreates the scoreboard
---------------------------------------------------------]]
local function CreateScoreboard()
if pScoreBoard then
pScoreBoard:Remove()
pScoreBoard = nil
end

pScoreBoard = vgui.Create("RPScoreBoard")

end

–[[-------------------------------------------------------
Name: gamemode:ScoreboardShow()
Desc: Sets the scoreboard to visible
---------------------------------------------------------]]
local function ScoreboardShow()

GAMEMODE.ShowScoreboard = true
gui.EnableScreenClicker(true)

if not pScoreBoard then
	CreateScoreboard()
end

pScoreBoard:SetVisible(true)
pScoreBoard:UpdateScoreboard(true)

return true

end

–[[-------------------------------------------------------
Name: gamemode:ScoreboardHide()
Desc: Hides the scoreboard
---------------------------------------------------------]]
hook.Add( “ScoreboardHide”, “DarkRP_Override_H”, function()
GAMEMODE.ShowScoreboard = false
gui.EnableScreenClicker(false)
if pScoreBoard then
pScoreBoard:SetVisible(false)
end
end )

hook.Add( “InitPostEntity”, “HackyScoreBoardFix”, function()

GAMEMODE.ScoreboardShow = ScoreboardShow

end )[/lua]

Well for one I don’t see any surface.CreateFont

That is the code in the Autorun folder

Why is it in autorun? Its client.

I did not make this I am editing it

Why not make your own?

I don’t know how to make Scoreboard’s they are harder to make. Is this code really that bad

I’d say so. The creator screwed up surface.CreateFont