So I have literally tried everything to get this working, and I have got it working before easily but now it is literally the most retarded thing ever.
[lua]
local WPOINTMAT = Material("waypointimage.png")
hook.Add( "HUDPaint", "HUDPaint_DrawABox", function()
for k,v in pairs(waypointsCL) do
local WP_pos = v:ToScreen()
drawcolor = waypointcoloursCL[k]
drawtext = waypointnamesCL[k]
surface.SetMaterial( WPOINTMAT )
surface.SetDrawColor( drawcolor )
surface.DrawTexturedRect( WP_pos.x-8,WP_pos.y-8,16,16)
end
end )[/lua]
I have the image in my garrysmod/materials in the client + server
i've tried multiple different solutions but it's still coming up with a black and purple checkerboard texture :/
Where did you put the WPOINTMAT variable?
local WPOINTMAT = Material("waypointimage.png")
Make sure it is before you try to call it. It's a local variable, so make sure the hook is within the same codeblock. Make sure the texture file is in the right directory. Should be directly inside materials. Also, make sure to fully restart the server, it won't work if you put it on there while it's running.
Also, are you sure it is spelt exactly the same way in every directory? not an extra space or anything that would mess it up? good luck, I hope I could help any
I have done all of that except for restarting the server maybe thats the problem, I'll make sure to try it out. Thanks for trying to help <3
Sorry, you need to Log In to post a reply to this thread.