Hey guys, im attempting to make a custom HUD, and im stuck on when i hold a crowbar, or physgun(eg) they say 0/0 ammo instead of nothing at all and how can i place the players Avatar on screen and make it rounded (Look like a circle).
Thanks in advance
[editline]18th June 2015[/editline]
Also how to add pngs to the screen ?
Just check if the ammo count is equal to 0 and only draw if it isn't
[code]
if(ply:GetAmmoCount(ply:GetActiveWeapon():GetPrimaryAmmoType()) != 0){
// Draw stuff here
}
[/code]
To show an avatar, [URL="http://wiki.garrysmod.com/page/Category:AvatarImage"]use this[/URL]. To round it you'll need to use stencils (I googled it and found this: [URL="http://pastebin.com/FVEKbxM9"]http://pastebin.com/FVEKbxM9[/URL] - Credit to Handsome Matt (apparently))
To 'add pngs to the screen', just use [URL="surface.DrawTexturedRect"]surface.DrawTexturedRect[/URL] in the HUDPaint hook, after using [URL="surface.SetMaterial"]surface.SetMaterial[/URL] with a [URL="http://wiki.garrysmod.com/page/Global/Material"]Material[/URL] parameter
Sorry, you need to Log In to post a reply to this thread.