Start the game with the -console command line parameter. Press [~] during game play to display the console window. Enter sv_cheats 1 at the console to enable cheat modes. Then, enter one of the following codes to activate the corresponding cheat function.
You can also modify your existing half-life 2 episode twoep2cfgconfig.cfg and change con_enable to "1" to enable the console
god — God mode (Server only)
noclip — No clipping mode
impulse 101 — All weapons
notarget — Enemies do not target you
maps — Map list
budda — Cannot die due to damage
hurtme [number] — Damage player by indicated amount
impulse 82 — Spawn Jeep
hud_quickhelp/text? 1 — Crosshairs on
exec [filename] — Run script file
developer [0-2] — Developer mode
cl_drawhud [0 or 1] — Toggle HUD
cl_enablehud [0 or 1] — Toggle HUD
showfps — Toggle framerate display
npc_create_aimed — Spawn NPC
npc_create — Spawn NPC
picker — Picker mode
sv_gravity [number] — Set gravity
sv_waterdist [number] — Set vertical view
air_density [number] — Set air density
dsp_explosion_effect_duration [number] — Set explosion length
mat_numtexttureunits [number] — Limit texture units
prop_debug — Bounding box debug
sv_bounce [number] — Set bounce multiplier
speed sv_stopspeed [number] — Set minimum stopping
setang [number] — Set pitch yaw
sv_friction [number] — Set friction
sv_maxvelocity [number] — Set maximum velocity
map [map name] — Load indicated map
give [weapon or item name] — Spawn indicated weapon or item
Weapon and item names:
Use one of the following entries with the give code:
weapon_alyxgun
weapon_ar1
weapon_ar2
weapon_bugbait
weapon_cguard
weapon_crowbar
weapon_extinguisher
weapon_flaregun
weapon_frag
weapon_gauss
weapon_hopwire
weapon_iceaxe
weapon_physcannon
weapon_physgun
weapon_pistol
weapon_rpg
weapon_shotgun
weapon_smg1
weapon_smg2
weapon_stickylauncher
weapon_stunstick
weapon_thumper
weapon_sniperrifle
weapon_rollerwand
weapon_molotov
weapon_manhack
weapon_immolator
weapon_irifle
weapon_slam
weapon_hmg1
weapon_cubemap
weapon_binoculars
weapon_ml
weapon_brickbat
item_box_buckshot
item_box_mrounds
item_box_sniper_rounds
item_box_srounds
item_healthkit
item_battery
item_suit
item_ml_grenade
item_ar2_grenade
item_healthvial
Portal: Cheat mode:
Enter the options menu, select "Controls", then "Advanced". Turn on the option for the console. Then press [~] during game play to display the console window. Type sv_cheats 1 to enable cheat mode. Then, enter one of the following codes at the console window to activate the corresponding cheat function:
change_portalgun_linkage_id [0-3] — Allow separate sets of portals 2 be created
ent_create_portal_weight_box — Spawn Weighted Storage Cube
fire_energy_ball — Fire an energy ball
sv_portal_placement_never_bump 1 — Portal placement cannot be bumped
sv_portal_placement_never_fail 1 — Portals can be placed on almost any surface
upgrade_portalgun — Allow use of second portal placement