• HUD textures wont dl
    5 replies, posted
i cant get the hud texture to dl even though i poppied it directly to my computer, still doesn't work? This is in an addon style thing server-side autorun: [lua] /*---------------------------------------------------------------- Server load ----------------------------------------------------------------/* AddCSLuaFile( "autorun/client/cl_HUD.lua" ) resource.AddFile( "materials/gui/HUD.vtf" ) resource.AddFile( "materials/gui/HUD.vmt" ) print( "\n==========================" ) print( " Chrome HUD loaded" ) print( "==========================\n" ) [/lua] Client side autorun: [lua] /*--------------------------------------------------- New hud ---------------------------------------------------*/ -- Removing default HUD function hidehud(name) for k, v in pairs{"CHudHealth", "CHudBattery"} do if name == v then return false end end end hook.Add("HUDShouldDraw", "hidehud", hidehud) function DrawHud () local ply = LocalPlayer() local health = ply:Health() local armor = ply:Armor() local texture = surface.GetTextureID("materials/gui/HUD") --Screen Percentage local x = ScrW()/100 local y = ScrH()/100 -- Draw red health bar under material local HBL = math.Clamp((health/100)*(x*28),(x*.5),(x*27.5)) draw.RoundedBox((x*.25),(x*1.1),(y*91),HBL,(y*7.5),Color(204,0,0,200)) -- Health bar --Draw rect's surface.SetTexture(texture) surface.SetDrawColor(255,255,255,0) surface.DrawTexturedRect(x,y*90,x*10,y*30) end hook.Add("HUDPaint", "DrawHud", DrawHud) [/lua] i have the material in the correct place too i think /addons/Chrome Hud/materials/gui/HUD.vtf
ive seen that code in other addons thats why i used it i didnt know any other way for it to work, im sure its in the correct place
it draws the red box under where the material should be but i just get the error missing materials:gui/hud something like that
Sorry, you need to Log In to post a reply to this thread.