I have this code, and its suposed to be a really simple hud, jsut a box and your cash. But its not drawing. This is the entire cl_init.lua at the moment:
[lua]
include( 'shared.lua' )
function GM:HUDShouldDraw(name)
for k, v in pairs{"CHudHealth", "CHudBattery", "CHudAmmo", "CHudSecondaryAmmo"} do
if name == v then return false end
end
end
function GM:HUDPaint()
draw.RoundedBox( 6, ScrW()/5, ScrW()/5, 100, 50, Color(100,200,255,255))
draw.SimpleText( "Current Cash: "..tostring(Brom_Lib.Networking.Get("int", "cash")) or tostring(0), "TabLarge", ScrW()/5+5, ScrH()/5+35, Color(255,0,255,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER )
if(Brom_Lib.Networking.Get("string","round") == "Loading" or Brom_Lib.Networking.Get("string","round") == "Build") then
draw.SimpleText( "Time untill fight: "..tostring(Brom_Lib.Networking.Get("int", "c")), "TabLarge", ScrW()/5+5, ScrH()/5, Color(255,0,255,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER )
elseif(Brom_Lib.Networking.Get("string","round") == "Survive") then
draw.SimpleText( "Time untill build: "..tostring(Brom_Lib.Networking.Get("int", "c")), "TabLarge", ScrW()/5+5, ScrH()/5, Color(255,0,255,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER )
end
draw.SimpleText( "Health: "..tostring(LocalPlayer():Health()), "TabLarge", ScrW()/5+20, ScrH()/5, Color(255-255*(LocalPlayer():Health()/255),255*(LocalPlayer():Health()/255),255,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER )
surface.SetDrawColor(255*(LocalPlayer():Health()/255),255-255*(LocalPlayer():Health()/255),0,255)
surface.DrawRect(ScrW()/5,ScrH()/5+5,LocalPlayer():Health()/1.5,10)
end
[/lua]
I did do the ADDCSLUAFILE thing in init.lua... What could be wrong? I also tried it with a hook, with the same results.
[highlight](User was banned for this post ("Wrong section (please stop this)" - mahalis))[/highlight]
Stick some print statements in there, to check if the script is even getting loaded. Use the lua_openscript_cl console command to load it to test it.
Sorry, you need to Log In to post a reply to this thread.