Problem with adding a custom texture

I’m trying to add a custom texture to my HUD, I first converted it to vtf/vmt with VTFEdit, and then tried adding it to my hud with

[lua] if ( SERVER ) then
AddCSLuaFile(“evohud.lua”)
resource.AddFile(“materials/schud/evo_logo.vmt”)
resource.AddFile(“materials/schud/evo_logo.vtf”)
return
end

local function ScHud()
surface.SetTexture( surface.GetTextureID( “schud/evo_logo” ) )
surface.SetDrawColor( 255, 255, 255, 255 )
surface.DrawTexturedRect( 250, 250, 512, 256 )
end

hook.Add( “HUDPaint”, “ScHUD”, ScHud ) [/lua]

the materials are located in addon/materials/shhud/evo_logo.vmt vtf etc and the vmt consists of
[lua]
“UnlitGeneric”
{
“$basetexture” “schud/evo_logo”
“$nolod” 1
“$vertexalpha” 1
“$vertexcolor” 1
}
[/lua]

Edit: Forgot to add the problem ^.^, I only see a pink/black checkered board texture where it suppose to be.

Only problem i can see with the above is that the hook and called function (ScHud) may not be running clientside. Try putting it inside an if statement like you did with the serverside stuff:

[lua]
if CLIENT then
local function ScHud()
surface.SetTexture( surface.GetTextureID( “schud/evo_logo” ) )
surface.SetDrawColor( 255, 255, 255, 255 )
surface.DrawTexturedRect( 250, 250, 512, 256 )
end

hook.Add( "HUDPaint", "ScHUD", ScHud )

end
[/lua]

EDIT:
If you’re seeing that it means it can’t find the texture, try printing what surface.GetTextureID() returns.

You were right, apparently I’m not completely confident about how the file is read. Thanks.

[editline]11th June 2011[/editline]

Now i’m having trouble making the white around the image transparent, I already tried adding in a alpha channel and that didn’t seem to do much for me.

make sure the material had alpha on it when you made it in to a vtf, then add
$translucent 1
to the vmt