DarkRP Hud Test Issue

Okay so when I put my money above 500 it goes to far over to the right. Is there anyway I can make the text move to the left instead of the right?

Before:

http://yougold.org/shorting/screenshots/gmod/testing/rp_downtown_v4c_v20066.jpg

After:

http://yougold.org/shorting/screenshots/gmod/testing/rp_downtown_v4c_v20067.jpg

Code:



local AvatarDrawn = false

local hideHUDElements = {
	-- This is the one you're most likely to replace first
	-- DarkRP_LocalPlayerHUD is the default HUD you see on the bottom left of the screen
	["DarkRP_LocalPlayerHUD"] = true,
}

hook.Add("HUDShouldDraw", "HideDefaultDarkRPHud", function(name)
	if hideHUDElements[name] then return false end
end)

local function hideElements(name)

	if name == "CHudHealth" or name == "CHudBattery" or name == "CHudSuitPower" then
		return false
	end
	
	if hideHUDElements[name] then
		return false
	end
	
end
hook.Add("HUDShouldDraw", "hideElements", hideElements)

surface.CreateFont("Name+Money", {
	font = "Trebuchet24", 
	size = 30, 
	weight = 850, 
	blursize = 0, 
	scanlines = 0, 
	antialias = true, 
	underline = false, 
	italic = false, 
	strikeout = false, 
	symbol = false, 
	rotary = false, 
	shadow = false, 
	additive = false, 
	outline = false, 
})

surface.CreateFont("Job", {
	font = "Trebuchet24", 
	size = 19.5, 
	weight = 850, 
	blursize = 0, 
	scanlines = 0, 
	antialias = true, 
	underline = false, 
	italic = false, 
	strikeout = false, 
	symbol = false, 
	rotary = false, 
	shadow = false, 
	additive = false, 
	outline = false, 
})

surface.CreateFont("Wallet", {
	font = "Trebuchet24", 
	size = 19.5, 
	weight = 850, 
	blursize = 0, 
	scanlines = 0, 
	antialias = true, 
	underline = false, 
	italic = false, 
	strikeout = false, 
	symbol = false, 
	rotary = false, 
	shadow = false, 
	additive = false, 
	outline = false, 
})

surface.CreateFont("Tripps-v2", {
	font = "Trebuchet24", 
	size = 15, 
	weight = 850, 
	blursize = 0, 
	scanlines = 0, 
	antialias = true, 
	underline = false, 
	italic = false, 
	strikeout = false, 
	symbol = false, 
	rotary = false, 
	shadow = false, 
	additive = false, 
	outline = false, 
})

local function DoActualHUD()
	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.RoundedBox(10, 20, ScrH() - 140, 420, 120, Color(48,48,48,255))
	draw.RoundedBox(10, 20, ScrH() - 140, 420, 120, Color(48,48,48,255))
	
	local ply = LocalPlayer()
	//name
	draw.SimpleText(LocalPlayer():Nick() .. " - $" .. v2, "Name+Money", 25 + 65 , ScrH() - 109, Color(255,255,255), TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP)
	//job
	draw.SimpleText(LocalPlayer().DarkRPVars.job, "Job", 25 + 65 , ScrH() - 80, Color(255,255,255), TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP)
	//money
	draw.SimpleText("Wallet: $" .. v1, "Wallet", 25 + 298, ScrH() - 80, Color(255,255,255), TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP)

	local ply = LocalPlayer()
	local HP = ply:Health()
	local Armor = ply:Armor()
	//hp
	draw.RoundedBox( 4, 30, ScrH() - 75, 400, 20, Color( 0,0,0,185 ))
	draw.RoundedBox( 4, 33, ScrH() - 72, 393, 12.5, Color( 89,89,89,185 ))
	draw.RoundedBox( 4, 33, ScrH() - 72, math.Clamp( HP, 0, 393 )*3.925, 12.5, Color( 204,0,0,185 ))
	draw.SimpleText("Health: " .. HP, "Tripps-v2", 25 + 172, ScrH() - 58.5, Color(255,255,255), TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP)
	//armor
	draw.RoundedBox( 4, 30, ScrH() - 50, 400, 20, Color( 0,0,0,185 ))
	draw.RoundedBox( 4, 33, ScrH() - 46, 393, 12.5, Color( 89,89,89,185 ))
	draw.RoundedBox( 4, 33, ScrH() - 46, math.Clamp( Armor, 0, 393 )*3.925, 12.5, Color( 0,0,204,255 ))
	draw.SimpleText("Armor: " .. Armor, "Tripps-v2", 25 + 172.5, ScrH() - 32.5, Color(255,255,255), TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP)
	
	//avatar
	draw.RoundedBox(4, 30, ScrH() - 135, 57, 57, Color(0,0,0,255))
	if not AvatarDrawn then
		local avatar = vgui.Create("AvatarImage")
		avatar:SetPos(32,ScrH() - 133.5)
		avatar:SetSize(53,53)
		avatar:SetPlayer(ply,64)
		AvatarDrawn = true
	end
	
end
hook.Add("HUDPaint", "HUD_TEST", DoActualHUD)

local function DrawHUD()
	Scrw, Scrh = ScrW(), ScrH()
	RelativeX, RelativeY = 0, Scrh
	
	DoActualHUD()
	GunLicense()
	Agenda()
	JobHelp()
	DrawVoiceChat()
	LockDown()
 
	Arrested()
	AdminTell()
end


You would need to mess with the positioning in this code:

draw.SimpleText(“Wallet: $” … v1, “Wallet”, 25 + 298, ScrH() - 80, Color(255,255,255), TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP)

TEXT_ALIGN_RIGHT is the enum your looking for.

Moving the number over wouldn’t have done anything.

Ah thank you so much. Fixed my problem instantly.