• Hud Problem
    0 replies, posted
Hello guys, i have a problem with my hud, this is how it looks: [IMG]http://gyazo.com/a2386943bb1ab5165be393d07eb6ea25.png?1365892805[/IMG] The problem as you can see is that: my Level, Req Exp and Free Points values stay in 0, ( when i level up, all the values load correctly Like: Level: 22, Exp Rq: 259 Free Points: 8 ) This is my hud lua code: [lua] local function ExperienceHUD() if !pl:Alive() then return end if(pl:GetActiveWeapon() == "Camera") then return end if(pl.RP_SQL == nil) then pl.RP_SQL = {}; end; //Level draw.RoundedBox( 0, 640, 9, 150, 18, Color( 125, 125, 125, 180 ) ) surface.SetDrawColor( Color( 65, 65, 65, 180 ) ) surface.DrawOutlinedRect( 640, 9, 150, 18 ) local strDisplay = "0" or pl.RP_SQL["StrengthLvl"]; local strXP = pl.RP_SQL["StrengthExp"] or "0"; draw.SimpleText( "Level: "..strDisplay , "TabLarge", 590 + 150 / 2 + surface.GetTextSize( "Level: ".. strXP ) / 2, 11, Color( 255, 255, 255, 255 ), 0, 0 ) //Exp draw.RoundedBox( 0, 820, 9, 150, 18, Color( 125, 125, 125, 180 ) ) surface.SetDrawColor( Color( 65, 65, 65, 180 ) ) surface.DrawOutlinedRect( 820, 9, 150, 18 ) draw.SimpleText( "Req Exp: ".. tonumber(strDisplay) * 10 - tonumber(strXP) , "TabLarge", 750 + 150 / 2 + surface.GetTextSize( "Req Exp: ".. tonumber(strDisplay) * 10 - tonumber(strXP) ) / 2, 11, Color( 255, 255, 255, 255 ), 0, 0 ) //Points draw.RoundedBox( 0, 1000, 9, 150, 18, Color( 125, 125, 125, 180 ) ) surface.SetDrawColor( Color( 65, 65, 65, 180 ) ) surface.DrawOutlinedRect( 1000, 9, 150, 18 ) local agilXP = pl.RP_SQL["AgilityExp"] or "0"; draw.SimpleText( "Free Points: "..agilXP , "TabLarge", 930 + 150 / 2 + surface.GetTextSize( "Free Points: "..agilXP) / 2 , 11, Color( 255, 255, 255, 255 ), 0, 0 ) end hook.Add( "HUDPaint", "ExperienceHUD", ExperienceHUD ) [/lua] Thanks guys :()
Sorry, you need to Log In to post a reply to this thread.