I found remade hud for darkrp gamemode, and faced with problem.
It doesn't work in a good way, it doesn't show "Job", "Salary" and "Wallet".
My DarkRP version 2.4.2, this hud was made for custome version of this gamemode, and has a differ from mine.
DarkRP 2.4.2 using this vars for display information about:
"Job" - [B]LocalPlayer().DarkRPVars.job[/B]
"Salary" - [B]LocalPlayer().DarkRPVars.salary[/B]
"Wallet" - [B]LocalPlayer().DarkRPVars.money[/B]
I tried made it myself, but when i change smth. hud disappearing.
I passed a part of remade hud which responsible for this.
[CODE]
-------- Draw the text labels --------
textinfo.xalign = TEXT_ALIGN_RIGHT
textinfo.pos[1] = x + 80
textinfo.color = Color(255, 255, 255, 255)
textinfo.text = "Job: "
textinfo.pos[2] = temp.cury
draw.TextShadow(textinfo, 2, 200)
textinfo.text = "Income: "
textinfo.pos[2] = textinfo.pos[2] + lineheight
draw.TextShadow(textinfo, 2, 200)
textinfo.text = "Bank: "
textinfo.pos[2] = textinfo.pos[2] + lineheight
draw.TextShadow(textinfo, 2, 200)
-------- Draw the text fields --------
textinfo.xalign = TEXT_ALIGN_LEFT
textinfo.pos[1] = textinfo.pos[1] + 5
textinfo.text = [B]LocalPlayer():GetNWString("job")[/B]
textinfo.pos[2] = temp.cury
draw.TextShadow(textinfo, 2, 200)
textinfo.text = "$"[B]..LocalPlayer():GetNWInt("salary")[/B]
textinfo.pos[2] = textinfo.pos[2] + lineheight
draw.TextShadow(textinfo, 2, 200)
textinfo.text = "$"[B]..LocalPlayer():GetNWInt("money")[/B]
textinfo.pos[2] = textinfo.pos[2] + lineheight
draw.TextShadow(textinfo, 2, 200)
temp.cury = temp.cury + (3 * lineheight) + 15[/CODE]
I want this strings to be workable - LocalPlayer():GetNWString("job"), LocalPlayer():GetNWString("salary"), LocalPlayer():GetNWString("money").
DarkRP 2.4.2 doesn't use such strings.
Please help me to fix it.
I will be very grateful for your help.
Well, first of all, don't use NWStrings, they are slow as HELL, and LocalPlayer().DarkRPVars.salary and such should work, I don't know why they don't, any errors?
I fixed it by adding this:
[QUOTE]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
local v3 = LocalPlayer().DarkRPVars.job
if not v3 then v3 = "" end[/QUOTE]
Sorry, you need to Log In to post a reply to this thread.