Modern Warfare 2 HUD

Even if you dont like mw2, the HUD is still great :slight_smile:

http://img7.imageshack.us/img7/7565/gmodhud2.png

http://img704.imageshack.us/img704/783/gmodhud.png

Thanks! need to more, just ask me :slight_smile:

BUMP! I want this too. It does look nice.

[editline]03:16AM[/editline]

Oh, and perhaps (just suggestion) the “no need part” could instead be a clock. (Even though there’s a steam gui clock) Or it could be a set timer.

[editline]03:17AM[/editline]

Edit #2 And perhaps the other “no need” part (the one on the right) could instead be the weapon slots.

well i’ll make a little rough one for ya real quick give me a bit and i’ll see what i can do.

heres a pic

http://img231.imageshack.us/img231/2218/gmconstruct0000d.jpg

Acually, on the part where it shows the throwing knife and stun grenade, you could list how many grenades you have. Then for the Weapon HUD, you could put it on the right side like in TF2.

I like it :slight_smile:

I started this project a while back but I pretty much gave up…

Here is the code:
[lua]local BackLine = surface.GetTextureID(“VGUI/backline”)
local Crouch = surface.GetTextureID(“VGUI/crouching”)
local Stand = surface.GetTextureID(“VGUI/standing”)
local Grenade = surface.GetTextureID(“VGUI/grenade”)
local Overlay3 = surface.GetTextureID(“VGUI/overlay3”)
local AmmoBar = surface.GetTextureID(“VGUI/ammobar”)
local Blood = surface.GetTextureID(“VGUI/blood”)

local TexX = 1024
local TexY = 768

surface.CreateFont( “BankGothic Md BT”, 30, 400, 0, 0, “BANKGOTHIC”)
surface.CreateFont( “BankGothic Md BT”, 15, 400, 0, 0, “BANKGOTHICSM”)

function DrawHud()
if LocalPlayer():GetActiveWeapon() == NULL or LocalPlayer():GetActiveWeapon() == “Camera” then return end
if !LocalPlayer():Alive() then return end

surface.SetTexture( BackLine )  
surface.SetDrawColor( 255, 255, 255, 175 )  
surface.DrawTexturedRect( 624, 643, 400, 100 )  
  
if LocalPlayer():GetActiveWeapon():Clip1() >= 0 and !(LocalPlayer():GetActiveWeapon():GetClass() == "weapon_physcannon") then
	draw.SimpleText( LocalPlayer():GetActiveWeapon():Clip1(), "BANKGOTHIC", 800, 704, Color( 255, 255, 255, 255 ), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER ) 
end  
 
if( LocalPlayer():KeyDown( IN_DUCK ) ) then
    surface.SetTexture( Crouch )
    surface.SetDrawColor ( 255, 255, 255, 255 )
    surface.DrawTexturedRect( 824, 672, 64, 64 )
else
    surface.SetTexture( Stand )
    surface.SetDrawColor ( 255, 255, 255, 255 )
    surface.DrawTexturedRect( 824, 663, 64, 64 )
end

end
hook.Add( “HUDPaint”, “DrawMW2Hud”, DrawHud )

function DrawGrenades()
local NumGrenades = LocalPlayer():GetAmmoCount(10)
surface.SetTexture( Grenade )
surface.SetDrawColor ( 255, 255, 255, 255 )

if NumGrenades == 0 then return end
for i = 1, NumGrenades do
    surface.DrawTexturedRect( 850 - i * 15, 725, 40, 40 )
end

end
hook.Add( “HUDPaint”, “DrawMW2Grenades”, DrawGrenades )

function PostProcess()

local tab = {}  
tab[ "$pp_colour_addr" ]        = (-LocalPlayer():Health() + 100)/100
tab[ "$pp_colour_addg" ]        = 0  
tab[ "$pp_colour_addb" ]        = 0  
tab[ "$pp_colour_brightness" ]  = 0  
tab[ "$pp_colour_contrast" ]    = 1  
tab[ "$pp_colour_colour" ]      = 1 //math.Clamp( LocalPlayer():Health() / 100, 0, 1 )  
tab[ "$pp_colour_mulr" ]        = 0
tab[ "$pp_colour_mulg" ]        = 0  
tab[ "$pp_colour_mulb" ]        = 0
if LocalPlayer():Health() < 85 then
	DrawColorModify( tab ) end

end
hook.Add( “RenderScreenspaceEffects”, “RedEffect”, PostProcess )

function PostProcessOverlay()
if LocalPlayer():Health() < 75 then
surface.SetTexture( Overlay3 )
surface.SetDrawColor ( 255, 0, 0, 255 - (LocalPlayer():Health() * 2) )
surface.DrawTexturedRect ( 0, 0, 1024, 768 )
end
if LocalPlayer():Health() < 50 then
surface.SetTexture( Blood )
surface.SetDrawColor ( 255, 0, 0, 255 - (LocalPlayer():Health() * 2) )
surface.DrawTexturedRect ( 0, 0, 1024, 768 )
end
end
hook.Add( “RenderScreenspaceEffects”, “BloodEffect”, PostProcessOverlay )

function DrawAmmoBars ()
if LocalPlayer():Alive() then
local NumAmmo = LocalPlayer():GetActiveWeapon():Clip1()
surface.SetTexture( AmmoBar )
surface.SetDrawColor ( 255, 255, 255, 255 )
if NumAmmo == 0 then
return end
for i = 1, NumAmmo do
surface.DrawTexturedRect( 724 - i * 6, 688, 32, 32 )
end
end
end
hook.Add( “HUDPaint”, “DrawMW2AmmoBars”, DrawAmmoBars)

function ShowWeaponName ()
local old_wep = LocalPlayer():GetActiveWeapon()
if old_wep ~= LocalPlayer():GetActiveWeapon() then
print(“YAY!”)
local starttime = CurTime()
while (CurTime-starttime > 2.5) do
draw.SimpleText( LocalPlayer():GetActiveWeapon():GetPrintName(), “BANKGOTHICSM”, ScrW() - 220, ScrH() - 120, Color( 255, 255, 255, 255 ), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER )
end
end
end
hook.Add( “HUDPaint”, “DrawWeaponName”, ShowWeaponName)

function HideThings( name )
if (name == “CHudHealth” or name == “CHudBattery” or name == “CHudAmmo” or name == “CHudSecondaryAmmo” or name == “CHudWeapon”) then
return false
end
end
hook.Add( “HUDShouldDraw”, “HideThings”, HideThings ) [/lua]

Code is screwy and bad. Half of it doesn’t even work right but see what you can do. I’m pretty sure the textures are laid out right and the ammo, bars, grenades, and blood effect, work.

Materials and Font: http://filesmelt.com/dl/MW2HUD.zip

Srry, havent cheacked this thread out for 1 or 2 days, anyways, could you take a picture? xD
or tell me what to do, I can beta test it, (or alpha test O.o?)

Sorry haven’t been working much on it still trying to figure out how to do compass. I think i can get the part where it shows each bullet to work relativly easy just have to mess with it ill post my code that is in my pic in a bit.I added a clock telling you how long you’ve been playing to.
EDIT: ok heres a new pic i added the radar and the ammo count, it shows up to 50 bullets and i have yet to make it work for guns that have over 50.

http://img191.imageshack.us/img191/8518/gmconstruct0000ig.jpg

You should probably make the lines a little thicker and color them with a light gray-ish color.

Is that code in lua, because I would like to try and learn it.

Really, really sexy

thanks and yes i am going to make the lines thicker,im probably going to make it into its own texture. Sorry i wasn’t using the code posted above but i promise when i get time i’ll go through and comment it like crazy for people that want to learn lua.

Have it do the image of whether you’re crouching, or standing. And then maybe you could add a custom crosshair mw2-like (just suggestion). And last thing, maybe you could make it so it has a blood overlay when you’re dead.

[editline]10:35PM[/editline]

Oh, and maybe make them shorter like they are in mw2, and thicker would be good.

I need materials for the crouching and standing the link above i cant get to work. I’m also going to work on adding the blood effects a bit. If anyone has those materials though i would really like to have them.

Try this link: http://www.mediafire.com/file/tmnnnmnwmrm/MW2HUD.zip

Have been on vedication, srry for not haveing acces to the internett :frowning:
Keep working, I see a nice HUD here :slight_smile:

Now… how is it going?

hope its doing well this looks good, oh and by the way make it to where u can disable/enable it for machinma

I can’t wait for the HUD!!

Yea try and gradient the lines out from white to opaque to give it a more “natural” and i’ve seen a mini map done before so you could rip the code straight from that.