Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Half-Life 2 Cheats PC: How to Enable and Use Them

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Half-Life 2 on PC does not include official, built-in console-style cheat codes like some other games—but cheat commands can be enabled and used by modifying the game's launch options and console settings. This guide explains how to activate the developer console, enter valid cheat commands, and use them safely without breaking your game. Note: Using cheats disables achievements and may cause instability in multiplayer (though Half-Life 2’s original multiplayer is largely inactive now). For single-player only.

What You'll Need

  • A legitimate, installed copy of Half-Life 2 on Windows PC (via Steam)
  • Steam client open and logged into your account
  • Basic familiarity with entering commands in the Windows File Explorer or notepad

Step-by-Step

  1. Enable the Developer Console in Steam: Right-click Half-Life 2 in your Steam library, select Properties, go to the General tab, and locate the Launch Options field. Type -console (without quotes) and click Close. This tells the game to load the console on startup.
  2. Launch the Game and Open the Console: Start Half-Life 2 through Steam. Once in the main menu or during gameplay, press the ` (grave accent) key—usually located above Tab on U.S. keyboards—to open the console window. If it doesn’t open, verify your keyboard layout: some non-U.S. keyboards require holding Shift + ~ or using the § key. You can also rebind the console toggle in Options > Keyboard > Advanced by finding Toggle Console and assigning a new key.
  3. Allow Cheat Commands: In the console, type sv_cheats 1 and press Enter. This enables cheat mode. You’ll see sv_cheats = 1 confirm in the console output. Important: Without this, most cheat commands (like god or notarget) will be ignored.
  4. Use Basic Cheat Commands: Now you can enter the following valid commands (case-insensitive):
    • god — Makes your character invincible (health stays at 100, no damage taken)
    • notarget — Enemies ignore you; they won’t aggro or fire at you
    • impulse 101 — Gives you all weapons (including those not normally available)
    • give weapon_* — Gives specific weapons (e.g., give weapon_pistol, give weapon_rpg)
    • give item_healthkit — Gives a health kit
    • give item_ammo_357 — Gives 357 ammo (replace 357 with ar2, smg1, etc., for other types)
    • mp_give_player_crowbar — Gives a crowbar if you lost it (note: mp_ prefix often works even in single-player)
  5. Teleporting (Advanced): To teleport to coordinates, first find your current position with getpos (outputs X Y Z). Then, to warp there or elsewhere, use teleport X Y Z angleX angleY angleZ. Example: teleport 123.45 678.90 100.0 0 0 0 (angles are rotation in degrees; 0/0/0 faces forward). You can use getpos mid-game to get exact numbers.
  6. Disable Cheats: Type sv_cheats 0 to turn them off. If you want to re-enable them later, just re-run sv_cheats 1. Note that some cheat effects (like notarget) persist until you reload the level or restart the game.

Common Mistakes

  • Forgetting sv_cheats 1 — Most cheat commands silently fail if this is not set first. Always check the console output for sv_cheats = 1.
  • Typo in command names — Commands like give weapon_rpg are strict; weapon_rpg is correct, but weapon_rocketlauncher is not used in HL2 (it’s weapon_rpg).
  • Console not opening — If the ` key doesn’t work, check keyboard language settings. In Windows, go to Settings > Time & Language > Language & Region > Administrative Language Settings > Change System Locale and ensure it’s set to English (United States) if using non-standard layouts. Alternatively, rebind the console key in-game as noted in Step 2.
  • Assuming all cheats work in every context — Some commands (e.g., impulse 101) may not give weapons you can’t already pick up later in the level due to scripted restrictions. Others (like god) stop working after certain cutscenes.

Tips

  • Save before using cheats — Even with sv_cheats 1, the game can crash if you misuse teleport commands or give invalid items.
  • Use status in console — This prints your current position, health, ammo, and active entities—helpful for debugging or verifying cheat status.
  • Make a cheat command list — Create a text file (e.g., hl2_cheats.txt) with your favorite commands and paste them into the console to avoid typos.
  • Use in single-player only — While Half-Life 2’s multiplayer is defunct, if you play mods or community servers, cheats are almost always disabled server-side and may get you kicked or banned.
  • Restart the console session — If commands stop working, close the console with `, then press it again and re-enter sv_cheats 1.

Troubleshooting

  • Console doesn’t open at all — First, confirm -console is in Launch Options (no extra spaces or quotes). Restart Steam and try again. If still stuck, try launching with hl2.exe -console directly from the game folder (C:\Program Files (x86)\Steam\steamapps\common\Half-Life 2\hl2.exe), bypassing Steam’s launcher.
  • sv_cheats won’t change to 1 — This usually means you’re in a multiplayer game or a map that blocks cheats (e.g., some Source engine mods). Try starting a new game from the main menu, or load a save from an earlier chapter (e.g., Chapter 1: Black Mesa East).
  • Cheat commands return “Command not found” — Double-check spelling and case. Use find in the console to search for commands (e.g., find give). If it’s not listed, the command may be unsupported in your version.
  • Game crashes after using teleport — Teleporting into solid geometry or out-of-bounds areas can crash the game. Use getpos to find a safe spot, then teleport there. If the game crashes repeatedly, restart it and avoid teleporting during scripted sequences.
  • Cheats work but achievements still enable — This is normal. Once sv_cheats 1 is used at any point in a session, all achievements for that playthrough are disabled for the rest of the session, even if you later set sv_cheats 0.

Frequently Asked Questions

Do Half-Life 2 cheats work in Source Engine games like Portal or Half-Life 2: Episode Two?

Yes, but only if the cheat commands are supported. sv_cheats 1 works in most Source single-player campaigns, but some games (like Portal) disable or restrict cheat commands for gameplay reasons. Always check the specific game’s documentation.

Can I use cheat commands in Half-Life 2: Deathmatch?

No. Deathmatch and other multiplayer modes block cheat commands entirely. Even with -console and sv_cheats 1, commands like god or notarget will not function.

Why does god stop working after a cutscene?

Many cutscenes in Half-Life 2 reset player state for cinematic control. After a cutscene, re-enter god to re-enable invincibility.

Is there a way to get infinite ammo?

There’s no direct ammo_inf cheat, but you can use give item_ammo_357, give item_ammo_ar2, etc., repeatedly, or use impulse 101 to get all weapons (which also grants their default ammo). Alternatively, use mp_spawnarmor and mp_dropweapon commands only in custom maps or mods that support them.

Do cheats work in the episodic add-ons (Episode One, Episode Two)?

Yes, the same console commands work in Episode One and Episode Two, provided you launch them via the main Steam game or use their own launch options with -console.

What happens if I use teleport to jump out of the map?

The game will usually load the next map or reset your position if it detects falling out of bounds. In rare cases, you’ll get stuck and need to restart the chapter from the main menu or a save file.