Half-Life 2 Cheats PC: How to Enable and Use Them
In this article
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
- 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. - 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 holdingShift+~or using the§key. You can also rebind the console toggle in Options > Keyboard > Advanced by finding Toggle Console and assigning a new key. - Allow Cheat Commands: In the console, type
sv_cheats 1and pressEnter. This enables cheat mode. You’ll seesv_cheats = 1confirm in the console output. Important: Without this, most cheat commands (likegodornotarget) will be ignored. - 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 youimpulse 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 kitgive item_ammo_357— Gives 357 ammo (replace357withar2,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)
- Teleporting (Advanced): To teleport to coordinates, first find your current position with
getpos(outputsX Y Z). Then, to warp there or elsewhere, useteleport 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 usegetposmid-game to get exact numbers. - Disable Cheats: Type
sv_cheats 0to turn them off. If you want to re-enable them later, just re-runsv_cheats 1. Note that some cheat effects (likenotarget) 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 forsv_cheats = 1. - Typo in command names — Commands like
give weapon_rpgare strict;weapon_rpgis correct, butweapon_rocketlauncheris not used in HL2 (it’sweapon_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 (likegod) 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
statusin 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-entersv_cheats 1.
Troubleshooting
- Console doesn’t open at all — First, confirm
-consoleis in Launch Options (no extra spaces or quotes). Restart Steam and try again. If still stuck, try launching withhl2.exe -consoledirectly from the game folder (C:\Program Files (x86)\Steam\steamapps\common\Half-Life 2\hl2.exe), bypassing Steam’s launcher. sv_cheatswon’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
findin 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. Usegetposto 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 1is used at any point in a session, all achievements for that playthrough are disabled for the rest of the session, even if you later setsv_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 directammo_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.