Set an icon in my hud. (DarkRP)

Hello, I want this “icon16/money.png” icon in my hud…
But how do I put it there, somehow?

In the vgui.lua there is like

		F4MenuTabs:AddSheet("Money/Commands", F4Tabs[1], "icon16/money.png", false, false)

and I want the icon to be placeable somewhere… help please…

I am pretty new to LUA and I am learning… so yeah :smiley:

[editline]31st January 2013[/editline]

Never mind, found this:

	surface.DrawTexturedRect(25 + 10,ScrH() - 140,16,16)

But appears as the texture does not exist(black and purple.)

Place where? Like at the end of tab or move it out of the F4Menu completely? If you want this in hud, check hud.lua. You can add icons with surface.SetMaterial, google the surface functions if that’s what you want.

Ah, found it out why it was like an error.
Because that texture didn’t exist in single player… lol.

surface.DrawTexturedRect(25 + 10,ScrH() - 140,16,16)
Don’t you have to put that instead?

Try this in

local function DrawGenericHud()

// Playername
surface.DrawTexturedRect(Offset + 10, ((ScrH() - 165) - Offset) + 10, 16, 16)

Here a link for some Icons

Why would you download those icons when they’re already on every single server? (The icon16 folder)
It’s much better than letting people download extra content.

Will try it, thanks.

Didn’t work, so I tried this from GunLicense function.
And it worked.
local money = Material(“icon16/money.png”)
surface.SetDrawColor(255, 255, 255, 255)
surface.DrawTexturedRect(265 + 10,ScrH() - 37,16,16)