Half Life 2 / Source Games - Half Life Source, Left for Dead, etc
To get this to work you have to enable the console first. To do that, create a text file named: autoexec.cfg and put it in the Half Life 2\hl2\cfg folder.
put the following commands in the autoexec.cfg
bind "h" "cl_drawhud 0"
or, use this command to create a toggle:
bind "q" "toggle cl_drawhud"
replace "h" and "q" with the key of your choice.
Commands may vary with games that use the source engine, such as: hidehud, instead of cl_drawhud. Some may require more like:
0 returns to normal. 2 and 3 toggle certain elements on/off.
Make sure you also create a bind for it so that you can just press a button to disable the hud. Replace the 'h' key with whatever key you want to disable the hud. This may make switching weapons difficult, so make sure to enable fast weapon switch in the game menu so that you can just use next weapon to change weapons instantly. It may require pressing the number keys instead though.