Dark RP Hud Problems

So I followed this tutorial to make a basic hud:

I should have ended up with this:

But ended up with this and I am not too sure what I did wrong?

http://gyazo.com/cfb17309f4bbb82e2924488556c97c43.png?1353837474

Heres the full section of code that was edited:


local function DoActualHUD()
 
 --If the variables table has not be initialized, initialize it
LocalPlayer().DarkRPVars = LocalPlayer().DarkRPVars or {}
 
--If the money is not set, don't do anything
local v1 = LocalPlayer().DarkRPVars.money
if not v1 then v1 = "" end
 
--If the salary is not set, don't do anything
local v2 = LocalPlayer().DarkRPVars.salary
if not v2 then v2 = "" end
 
end
 
local function DrawHUD()

draw.RoundedBox(5, 25, ScrH() - 175, 200, 150, Color(25,25,25,200))
	
surface.SetDrawColor(255,255,255)

surface.SetTexture(surface.GetTextureID("gui/silkicons/user"))
surface.DrawTexturedRect(25 + 10,ScrH() - 160,16,16)
 
surface.SetTexture(surface.GetTextureID("gui/silkicons/money"))
surface.DrawTexturedRect(25 + 10,ScrH() - 140,16,16)
 
surface.SetTexture(surface.GetTextureID("gui/silkicons/money_add"))
surface.DrawTexturedRect(25 + 10,ScrH() - 120,16,16)
 
surface.SetTexture(surface.GetTextureID("gui/silkicons/group"))
surface.DrawTexturedRect(25 + 10,ScrH() - 100,16,16)
 
surface.SetTexture(surface.GetTextureID("gui/silkicons/heart"))
surface.DrawTexturedRect(25 + 10,ScrH() - 80,16,16)
 
surface.SetTexture(surface.GetTextureID("gui/silkicons/shield"))
surface.DrawTexturedRect(25 + 10,ScrH() - 60,16,16)
	
draw.SimpleText(LocalPlayer():Nick(),"TargetID", 25 + 30,ScrH() - 165, Color(255,255,255), TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP)
 
draw.SimpleText("$" .. v1,"TargetID", 25 + 30,ScrH() - 145, Color(255,255,255), TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP)
draw.SimpleText("$" .. v2,"TargetID", 25 + 30,ScrH() - 125, Color(255,255,255), TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP)
draw.SimpleText(LocalPlayer().DarkRPVars.job,"TargetID", 25 + 30,ScrH() - 105, Color(255,255,255), TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP)
draw.SimpleText(LocalPlayer():Health() ,"TargetID", 25 + 30,ScrH() - 85, Color(255,255,255), TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP)
draw.SimpleText(LocalPlayer():Armor() ,"TargetID", 25 + 30,ScrH() - 65, Color(255,255,255), TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP)
 
	Scrw, Scrh = ScrW(), ScrH()
	RelativeX, RelativeY = 0, Scrh
 
	DoActualHUD()
	GunLicense()
	Agenda()
	JobHelp()
	DrawVoiceChat()
	LockDown()
 
	Arrested()
	AdminTell()
end

Well for starters, you have to keep the roundedbox’s first argument to an even number (2, 4, 6, 8, 10) so on so forth. That’ll get rid of the corner-spacing.

yeah I did that but im not sure what to do next

This may help you <3 http://forum.facepunch.com/showthread.php?t=1227506

That code is really old, I would change my tutorial if maurits is editable

Is it possible you can edit maurits? like as in edit the actual gmod wiki tutorial

No, it’s just a html dump. He’d need a dump of the original wiki code for that.

[editline]26th November 2012[/editline]

Since I’m nice, here is a sorta dump of the HUD that works with Gmod 13; granted you’ll have to tweak a few things for your server since this version includes support for and stamina among other things.

[lua]
/---------------------------------------------------------------------------
HUD Seperate Elements
---------------------------------------------------------------------------
/
local Health = 0
local function DrawHealth()
Health = math.min(100, (Health == LocalPlayer():Health() and Health) or Lerp(0.1, Health, LocalPlayer():Health()))

local DrawHealth = math.Min(Health / GAMEMODE.Config.startinghealth, 1)
local Border = 4
if LocalPlayer():Health() &lt; 2 then
	Border = 2
end
draw.RoundedBox(Border, 29, RelativeY - 73, 192, 20, ConVars.Healthbackground)
draw.RoundedBox(Border, 30, RelativeY - 72, 191 * DrawHealth, 18, ConVars.Healthforeground)

draw.DrawText(math.Max(0, math.Round(LocalPlayer():Health())), "DarkRPHUD2", 21 + (HUDWidth - 8)/2, RelativeY - 73, ConVars.HealthText, 1)

end

local Stamina = 0
local function DrawStamina()
LocalPlayer().Stamina = LocalPlayer().Stamina or 100
Stamina = math.min(100, (Stamina == LocalPlayer().Stamina and Stamina) or Lerp(0.1, Stamina, LocalPlayer().Stamina))

local DrawHealth = math.Min(Stamina / 100, 1)
local Border = 4
if LocalPlayer().Stamina &lt; 2 then
	Border = 2
end
draw.RoundedBox(Border, 29, RelativeY - 50, 192, 20, ConVars.Healthbackground)
draw.RoundedBox(Border, 30, RelativeY - 49, 191 * DrawHealth, 18, Color(0,0,255))

draw.DrawText(math.Max(0, math.Round(LocalPlayer().Stamina)), "DarkRPHUD2", 21 + (HUDWidth - 8)/2, RelativeY - 50, ConVars.HealthText, 1)

end

local function DrawInfo()
LocalPlayer().DarkRPVars = LocalPlayer().DarkRPVars or {}

local v1 = LocalPlayer().DarkRPVars.money
if not v1 then v1 = "" end

local v2 = LocalPlayer().DarkRPVars.salary
if not v2 then v2 = "" end

/* Draw background */
draw.RoundedBox(6, 25, ScrH() - 175, 200, 150, Color(25,25,25,220))

/* Draw icons */
surface.SetDrawColor(255,255,255)
surface.SetMaterial(URP_texCache["SilkUser"])
surface.DrawTexturedRect(25 + 10,ScrH() - 160,16,16)

surface.SetMaterial(URP_texCache["SilkMoney"])
surface.DrawTexturedRect(25 + 10,ScrH() - 140,16,16)

surface.SetMaterial(URP_texCache["SilkMoneyAdd"])
surface.DrawTexturedRect(25 + 10,ScrH() - 120,16,16)

surface.SetMaterial(URP_texCache["SilkClock"])
surface.DrawTexturedRect(25 + 10,ScrH() - 100,16,16)

surface.SetMaterial(URP_texCache["SilkCalendar"])
surface.DrawTexturedRect(25 + 10,ScrH() - 80,16,16)


draw.SimpleText(LocalPlayer():Nick(),"TargetID", 55,ScrH() - 145, Color(255,255,255), TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP)
draw.SimpleText("$" .. formatNumber(v1),"TargetID", 55,ScrH() - 125, Color(255,255,255), TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP)

if v2 == 0 then
	draw.SimpleText("Unemployed","TargetID", 55,ScrH() - 105, Color(255,255,255), TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP)
else
	draw.SimpleText("$" .. formatNumber(v2),"TargetID", 55,ScrH() - 105, Color(255,255,255), TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP)
end

draw.SimpleText(LocalPlayer():Health() ,"TargetID", 55,ScrH() - 85, Color(255,255,255), TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP)

end

local function DrawHUD()
Scrw, Scrh = ScrW(), ScrH()
RelativeX, RelativeY = 0, Scrh

if not URP_texCache["TaxImageHud"] then URP_texCache["TaxImageHud"] = surface.GetTextureID("ultimaterp/hud/tax_hud") end
if not URP_texCache["InfoImageHud"] then URP_texCache["InfoImageHud"] = surface.GetTextureID("ultimaterp/hud/info_hud") end
if not URP_texCache["BBLogoImage"] then URP_texCache["BBLogoImage"] = surface.GetTextureID("ultimaterp/hud/bb_logo") end
if not URP_texCache["SilkUser"] then URP_texCache["SilkUser"] = Material("icon16/user.png") end
if not URP_texCache["SilkCoins"] then URP_texCache["SilkCoins"] = Material("icon16/coins.png") end
if not URP_texCache["SilkMoney"] then URP_texCache["SilkMoney"] = Material("icon16/money.png") end
if not URP_texCache["SilkMoneyAdd"] then URP_texCache["SilkMoneyAdd"] = Material("icon16/money_add.png") end
if not URP_texCache["SilkHeart"] then URP_texCache["SilkHeart"] = Material("icon16/heart.png") end
if not URP_texCache["SilkClock"] then URP_texCache["SilkClock"] = Material("icon16/clock.png") end
if not URP_texCache["SilkCalendar"] then URP_texCache["SilkCalendar"] = Material("icon16/calendar.png") end

DrawInfo()

DrawHealth()
DrawStamina()

DrawVoiceChat()
LockDown()

Arrested()
AdminTell()

end
[/lua]

Dont Use The Code Above Me Guys It Has A Known Exploit That Allows Him To Run Lua Scripts On Your Server

I thought I had got my ‘insightful shitty commentator’ vaccine, better get myself checked up.

But seriously, somebody ban his IP already.