Half-Life 2

Half-Life 2

174 ratings
Console Commands(Cheat Codes) Guide
By Honor Guard
These are ALL the codes We learned for HL2

We each gave a fair share so you thank one you should thank all of us if you like it( Honor Guard,Myback, and Reloaded)

HG will continue to update this guide upon request.
   
Award
Favorite
Favorited
Unfavorite
For Starters
Here is some simple stuff (yes ,I finally fixed that misspell)

A few codes may crash the game if spammed or used in multiplayer ; Reminder, you have been Warned that it can crash

Most of the commands should work in HL2DM, Garry's mod, the episodes, and mods, but I can not say all will

P.S to enable the console go to Options > controls > Advanced button > check Dev console > hit ` beside 1 & above tab on a QWERTY keyboard
Binding
example

bind a "npc_create npc_citizen"

More less it goes like this

bind * "code"

* is the key you want to bind to
NPC spawning and arming
here are a few ways to spawn NPCs

npc_create npc_ (let them spawn with a gun where you point)

ent_create npc_ (they spawn where you point)

give npc_ (they spawn in you)

for ent_create and give, you can use the following code
additionalequipment weapon_*****
example ent_create npc_citizen additionalequipment weapon_ar2 to spawn a basic civilian rebel with a AR2 pulse rifle

I use npc_create npc_ most for A you can give them guns and do it in mass with a shorter code


Weapons for you to use with npc_create npc_
Note you must use below in order for them to get a weapon

npc_create_equipment weapon_***

In place of the *** put one of the following

crowbar
stunstick
pistol
357 (kind of works they do fire but well it goes in a kind of different spot then what you think)
alyxgun
smg1
annabelle(shoots 357 ammo/gun father Grigori uses)
ar2(pulse rifle)
shotgun
rpg



THESE DO NOT WORK CORRECTLY ON ALL NPCS THAT USE WEAPONS
crossbow
physcannon (gravity gun)
frag (grenade)

if you like to delete all use npc_kill
NPC list
As you recall, NPCs (Non Playable Characters) are programmed from the game's code, and can be spawned using three methods. Two of these methods can be used in-game via developer console.

citizen(rebel - the citizen clothing, except in HL2 E1)
combine_s (Combine Soldier for the elite and nova prospect variants. you'll need to use a model code)
combine_s model models/combine_super_soldier.mdl
combine_s model models/combine_soldier_prisonguard.mdl
metropolice (Police in City 17)
vortigaunt
antlion
zombie
zombie_fast(May lag game if spammed)
headcrab
antlionguard
headcrab_fast
poisonzombie
rollermine
manhack
stalker
turret_floor
cscanner(KILL OR DELETE AFTER IN HL2DM OR IT WILL CRASHES BY TAKING A PICTURE IT ; A MEGA BAD IDEA IN HL2DM TO SPAWN)
seagull
pigeon
zombie_torso
combinegunship
helicopter
heli_nobomb
headcrab_poison
monk (Father Grigori)
dog
barney
mossman
eli
breen
grenade_frag (Effectively the prop, used to start the detonation when picked up)
Stat Affecting Codes
They are different codes for dmg between the player and NPC *** is where you put weapon name here a example

"sk_plr_dmg_357 40000"
"sk_max_ar2 600"(600 is max regular ammo for the pulse rifle now.)

-weapons
sk_plr_dmg_***
sk_npc_dmg_***
sk_max_***
sk_combine_guard_kick ***

-NPCs
******* is npc
sk_******_health

Weapons, Ammo and other item spawning
This shall be a bit of a repeat, but rather useful info to know

ent_create ****
give ****

Replace **** with one below


Weapons

weapon_crowbar

weapon_stunstick (suit energy in HL2 or in Gmod/HL2DM the weapon)

weapon_pistol

weapon_smg1

weapon_ar2 (overwatch standard issue pulse aka pulse rifle or AR2)

weapon_crossbow

weapon_rpg

weapon_frag


Ammo
These are best for RP reasons or such

givecurrentammo - Gives moreless any ammo needed at time

Handguns
item_box_srounds (9mm rounds) or item_ammo_

item_ammo_357 (357 ammo) or item_ammo_357

SMG
item_box_mrounds (SMG ammo) or item_ammo_smg1

item_ar2_grenade (SMG grenades,odd ain't it? )

Shotgun
item_box_buckshot

Crossbow
item_ammo_crossbow

RPG rockets
item_ml_grenade
item_rpg_round

AR2 Primary
item_box_lrounds (ar2 pulse ammo)
item_ammo_ar2

AR2 Secondary
item_ammo_ar2_altfire

Misc.
HEV Suit
item_suit

Healing items
item_healthkit
item_healthvial
item_battery (suit batteries)
Making a battle
here how you make a battle where it NPC vs NPC
Step 1
sv_cheats 1

Step 2
Decide what you desire to be involved in the battle and location (Options o options)

Step 3 ai_disable
Optionally you can use noclip and notarget (Disables AI targeting you) to watch the battle rather than partake in it

Step 4
Spawn in your desired NPCs
Optionally you can bind them to a button press along with setting the weapon if you use npc_create rather than ent_create

Step 5
ai_disable and enjoy your creation.


Note this is fun specially if you set up obstacles,cover,short cuts,traps,and safer zones
A tip make a room closed off with zombies in it closed by destructible items

I find the antlion beaches after the lighthouse fight a very good spot

NOTE : Feel free to experiment, after all it gets old watching a fight made in a similar manner
More Advanced codes
any codes that needs sv_cheats 1 will have * beside it

impulse 203(deletes ANYTHING on ANY HL2 INCLUDING HL2DM IT WILL CRASH THE SERVER IF YOU USED ON A PLAYER)*
impulse 82 or ch_createjeep (makes a jeep that yes you can drive and shoot as well as get ammo from back)*
impulse 101 (gives you all default weapons)*
impulse 83 or ch_createairboat (spawn hoverboat unarmed)*
sv_infinite_aux_power 1 *
sv_cheats 1 (enables commands,but you will not earn achievements until you restart the game)
sbox_weapons 0


These are more of help me codes

give item_healthkit (25 hp)
give item_healthvial (15 hp)
physcannon_mega_enabled 1 (makes your gravity gun mega)


And this one just for fun
r_screenoverlay effects/combine_binocoverlay.vmt Combine vision
Other codes
These codes MAY work in HL2DM

ent_create (spawns where you aim)
give (spawns in you)

buddha (goes to 1 hp but no lower unless attacked by a script)
impulse 101 (refills ammo)

These use
give or ent_create

weapon_crowbar
weapon_stunstick
weapon_ar2
weapon_bugbait
weapon_crowbar
weapon_frag
weapon_crossbow
weapon_alyxgun
weapon_physcannon
weapon_pistol
weapon_rpg
weapon_shotgun
weapon_smg1
weapon_alyxgun

for ammo it goes like item_ammo_(gun name)


prop_thumper (a working thumper may not work in HL2DM)
item_suitcharger
item_healthcharger
weapon_striderbuster(HL2 E2 ONLY)

Abit of help
ent_rotate 90(rotates any item or npc to turn to right)
e_rotate 90(rotates them to more less go up or down like a circle upwards/downwards)

impulse 200 (removes weapon model)
thirdperson (3rd person view)
firstperson (first person view)

Afew spare NPC codes

ent_setname (name here - the () ) that code names the NPC,or object your pointing at to help make like a Boss NPC


ent_fire (named NPC,or general NPC) ent_fire changes stats such as like i want a rebel to go medic i could name it G then type ent_fire g setmedicon

or for a ammo supplier ent_fire g setammoresupplieron

to turn those off,just instead of having on at back,put off ,easy

cl_showfps 1 (shows Frames per second)

impulse 102 (skulls spawner)

Impulse 76 (Grunt O matic)

sv_infinite_aux_power 1 (should enable infinite aux power for your sprint & the like,go get them doom man with thou super pas 12)
adding the gun to the airboat/hoverboat
Step 1 spawn a airboat (impulse 83 or ch_createairboat)

Step 2 look at it and type the command
ent_setname NAME

Step 3 ent_fire NAME enablegun 1

Example
ent_setname g
ent_fire g enablegun 1

Step 4. Enjoy your newly armed airboat

Step 5. If desired you can type ent_fire NAME enablegun 0
If there any codes you want tell me in comments and HG will try to find them
I'll read any comment but I delete ones that do not relate to the guide.to HL2 Console commands,help requests or such (HG)
Myback and Reloaded told me at the very LEAST 50%-75% of the codes in this guide/helped me in learning them
262 Comments
Honor Guard  [author] 27 Jun @ 9:13am 
lex what do you mean precisely?
léxpardo 27 Jun @ 9:11am 
pls infinite heal code
Honor Guard  [author] 26 Jan @ 12:15pm 
So Kingittjr to answer your requests
on how to make a guide, you can do it from the game's community hub guide section if memory serves

unsure on how to attach ANY weapon to the airboat

No clue on the sprint
kinigittjr 26 Jan @ 7:10am 
how do you make your sprint super fast^
kinigittjr 23 Jan @ 12:32pm 
how do you attach a wepon of choice to the airboat?
kinigittjr 23 Jan @ 11:10am 
how do you make a steam guide (TM)?:steamhappy:
kinigittjr 23 Jan @ 11:09am 
If you want to spawn that, you have to have Garrys Mod (TM)
Honor Guard  [author] 6 Jan @ 7:02am 
not to my knowledge
Very cool guy 5 Jan @ 5:03pm 
is there anyway to spawn live grenades?
Honor Guard  [author] 16 Nov, 2024 @ 1:56pm 
So for anyone having achievement troubles ; install the Episode 1 & Episode 2 in your library in the tool section (based on which achievements you don't have you previously had), launch them to main menu, close, launch HL2 and should give you the achievements.