Roleplay HUD help

Hello, Im having a few problems with my HUD that I have semi made/edited.

I made a health and armour bar, and just above the health bar is a bar when the job will be displayed. I got someone to make it so when you have a short named job, the box is short, and when you have a long name job, the box changes it length to fit all the text in.

That was no problem, but the text didn’t appear, it may be because no color was set for the text.

Here is the code:


	surface.SetFont("TargetID")
	local w, h = surface.GetTextSize("Job: "..slujba)
	draw.RoundedBox(0,7,ScrH() - 49,w+22,18,Color(255,255,255,240))
	draw.RoundedBox(0,8,ScrH() - 48,w+20,16,Color(0,0,0,254))
	surface.GetTextSize("Job: "..slujba,"TargetID",11,ScrH() - 47)

Here is a picture of the HUD so far.

http://puu.sh/3iaOQ.png

If someone could help me make the text appear that would be great!

Another thing I am wondering about is some console errors.

These are the errors that im getting spammed.



[ERROR] gamemodes/darkrp/gamemode/client/hud.lua:68: attempt to concatenate global 'CUR' (a nil value)
  1. DrawInfo - gamemodes/darkrp/gamemode/client/hud.lua:68
   2. DrawHUD - gamemodes/darkrp/gamemode/client/hud.lua:233
    3. unknown - gamemodes/darkrp/gamemode/client/hud.lua:344



These are the lines inside that lua file.

Line 68:


	local Salary = 	LANGUAGE.salary .. CUR .. (LocalPlayer().DarkRPVars.salary or 0)

Line 233:


	DrawInfo()

Line 344:


	DrawHUD()

Now, these errors only started happening when i put this code in:


	surface.SetFont("TargetID")
	local w, h = surface.GetTextSize("Job: "..slujba)
	draw.RoundedBox(0,7,ScrH() - 49,w+22,18,Color(255,255,255,240))
	draw.RoundedBox(0,8,ScrH() - 48,w+20,16,Color(0,0,0,254))
	surface.GetTextSize("Job: "..slujba,"TargetID",11,ScrH() - 47)

Before I added this code it was this:


	draw.RoundedBox(0,7,ScrH() - 49,150,18,Color(255,255,255,240))
	draw.RoundedBox(0,8,ScrH() - 48,148,16,Color(0,0,0,254))
	draw.SimpleText("Job: "..slujba,"TargetID",11,ScrH() - 47)

So its something to do with the first code that is causing script errors: /

can someone try their best to help me out please?

Thank you!

CUR was removed from DarkRP’s init.lua and cl_init.lua. Just add


CUR = "$"

to the top of the init.lua file and cl_init.lua file

[lua] surface.SetFont(“TargetID”)
local w, h = surface.GetTextSize("Job: "…slujba)
draw.RoundedBox(0,7,ScrH() - 49,w+22,18,Color(255,255,255,240))
draw.RoundedBox(0,8,ScrH() - 48,w+20,16,Color(0,0,0,254))
draw.SimpleText("Job: "…slujba,“TargetID”,11,ScrH() - 47, Color(255, 255, 255))
[/lua]

fixed

Thank you I have done that :slight_smile:

[editline]18th June 2013[/editline]

Thank you so much !! Means alot.

You don’t even need to add that to the top of the init and cl_init lua files. Just change the CUR to “$” and it functions the same way. By modifying the main files it confuses a lot of people when they go to update DarkRP and everything breaks again. :stuck_out_tongue:


	local w, h = surface.GetTextSize("Job: "..slujba)

Russian?

Just saying, you do and not <u> it is BBCode xD