surface draw material not working.

Here is the hud code which is in cl_init.
The material png file is in content/materials.
For some odd reason no matter what I do it keep getting pink and black textures on hud.

local hpsplat2 = Material(“materials/headersplat.png”)
surface.SetMaterial(hpsplat2)
surface.SetDrawColor(0, 0, 0, 158)
surface.DrawTexturedRect(-52, 8, 360, 115)

I’ve included the file also in init.
Its weird because it works on my listen server but not dedi server.

resource.AddFile(“materials/bloodsplat.png”)
resource.AddFile(“materials/headersplat.png”)

Any help thanks :slight_smile:

You must put these on SERVER:


resource.AddFile("materials/bloodsplat.png")
resource.AddFile("materials/headersplat.png")

NOT client.