how to update the text of my hud

Hello,
how to update the text of my hud, the money does not move and the job and the salary even if their values ​​change

Can we see your code? You probably are storing the money outside your hudpaint hook and calling it or something like that.

[lua]
local money = LocalPlayer():getDarkRPVar(“money”)
local salaire = LocalPlayer():getDarkRPVar(“salary”)
local job = team.GetName(LocalPlayer():Team())

draw.SimpleText(""…job, “phona_font_job”, 73, ScrH() - 260, Color(255,255,255))
draw.SimpleText(""…money…" €", “phona_font_money”, 68, ScrH() - 300, Color(255,255,255))
draw.SimpleText(""…salaire…" €", “phona_font_money”, 68, ScrH() - 338, Color(255,255,255))[/lua]

[editline]29th September 2017[/editline]

[lua]
local money = LocalPlayer():getDarkRPVar(“money”)
local salaire = LocalPlayer():getDarkRPVar(“salary”)
local job = team.GetName(LocalPlayer():Team())

draw.SimpleText(""…job, “phona_font_job”, 73, ScrH() - 260, Color(255,255,255))
draw.SimpleText(""…money…" €", “phona_font_money”, 68, ScrH() - 300, Color(255,255,255))
draw.SimpleText(""…salaire…" €", “phona_font_money”, 68, ScrH() - 338, Color(255,255,255))[/lua]

Is there an HUDPaint hook surrounding that code?

yes
hook.Add( “HUDPaint”, “HUDHealth”, function()

[editline]29th September 2017[/editline]

You should show all of your code instead of little snippets.

Doubt this will work, but try this instead.



draw.SimpleText(team.GetName(LocalPlayer():Team()), "phona_font_job", 73, ScrH() - 260, Color(255,255,255))
draw.SimpleText(LocalPlayer():getDarkRPVar("money").." €", "phona_font_money", 68, ScrH() - 300, Color(255,255,255))
draw.SimpleText(LocalPlayer():getDarkRPVar("salary").." €", "phona_font_money", 68, ScrH() - 338, Color(255,255,255))


You probably just did something stupid and we can’t see it because of the small snippets you gave.

I do not know how to do

You did it in your second post…

Use code tags and copy and paste your code in…

you can do it for me please because i d’ont inderstand

If you don’t understand something then ask questions about what you don’t understand and actually try to learn instead of begging us to do everything for you.

No I really can’t get YOUR code and put it in here…

Use code tags and copy and paste your code in…

We are saying PASTE THE ENTIRETY OF YOUR OWN CODE IN.

[lua] include(“config_replacement.lua”)
resource.AddFile( “material/bunkero/phona_tout.png” )
local b_base = Material( “material/bunkero/phona_tout.png” ) – Calling Material() every frame is quite expensive

resource.AddFile( “material/bunkero/phona_sans_faim.png” )
local b_faim = Material( “material/bunkero/phona_sans_faim.png” ) – Calling Material() every frame is quite expensive

local icone = false
faim = true
local money = LocalPlayer():getDarkRPVar(“money”)
local salaire = LocalPlayer():getDarkRPVar(“salary”)
local job = team.GetName(LocalPlayer():Team())
---------------------------------------police------------------------------------------------------
surface.CreateFont( “phona_font_money”, {
font = “impact”,
size = 30,
weight = 500,
blursize = 0,
scanlines = 0,
antialias = true,

} )

surface.CreateFont( “phona_font_job”, {
font = “impact”,
size = 30,
weight = 500,
blursize = 0,
scanlines = 0,
antialias = true,

} )
--------------------------------------------------vie-----------------------------------------------------------------------------
hook.Add( “HUDPaint”, “HUDHealth”, function()
if faim == true then
– Background
surface.SetDrawColor( 255, 255, 255, 255 )
surface.SetMaterial(b_base) – If you use Material, cache it!
surface.DrawTexturedRect( 0, 634, 260, 440 )
elseif faim == false then
surface.SetDrawColor( 255, 255, 255, 255 )
surface.SetMaterial(b_faim) – If you use Material, cache it!
surface.DrawTexturedRect( 0, 634, 260, 440 )
end
– Foreground
if faim == false then
local health = LocalPlayer():Health() or 0
if health < 0 then health = 0 elseif health > 100 then health = 100 end
draw.RoundedBox( 0, 69, ScrH() -158, health *2 -72, 13, Color(192, 57, 43, 255)) – box de vie
elseif faim == true then
local health = LocalPlayer():Health() or 0
if health < 0 then health = 0 elseif health > 100 then health = 100 end
draw.RoundedBox( 0, 69, ScrH() -164, health *2 -72, 13, Color(192, 57, 43, 255)) – box de vie
end

local armor = LocalPlayer():Armor()
if armor > 0 && faim == false then
draw.RoundedBox( 0, 69, ScrH() -105, armor *4 +8, 13, Color(41, 128, 185))
end

if armor > 0 && faim == true then
draw.RoundedBox( 0, 69, ScrH() -127, armor *4 +8, 13, Color(41, 128, 185))
end
draw.SimpleText(""…job, “phona_font_job”, 73, ScrH() - 260, Color(255,255,255))
draw.SimpleText(""…money…" €", “phona_font_money”, 68, ScrH() - 300, Color(255,255,255))
draw.SimpleText(""…salaire…" €", “phona_font_money”, 68, ScrH() - 338, Color(255,255,255))
end )----------------------------------------Désactiver les hud de base----------------------------------------------------------------------
------------------------------Darkrp
local HideElements = { “DarkRP_HUD”, “DarkRP_LocalPlayerHUD”, “DarkRP_EntityDisplay”, “DarkRP_Agenda”, “DarkRP_Hungermod” }

local function HUDShouldDraw( Element )

if table.HasValue( HideElements, Element ) then return false end

end
hook.Add( “HUDShouldDraw”, “HUDShouldDraw”, HUDShouldDraw )
-------------------------------------- Sandbox
hook.Add( “HUDShouldDraw”, “DefautHUD”, function( name ) if ( name == “CHudHealth” or name == “CHudBattery” ) then return false end
end )
------------------------------------- Créateur text, s’il vous plait ne pas suprimer et ne pas modifier----------------------------------------------
print(“L’hud de se serveur est : Bunkera HUD”)
print(“Par: Séméron”)[/lua]

There’s no need to shout, dude.

[editline]29th September 2017[/editline]

You’re problem is that you’re caching the strings outside of the HUDPaint hook.

You’re problem is that you’re caching the strings outside of the HUDPaint hook.
???

Yeah that’s what I said.

yes, sorry i d’ont inderstand this

You’re only calling the functions once outside of the HUDPaint hook, meaning that they will never update. You need to call them again if you want them to change. Just move the variables into the hook.