Half-Life 2 Cheats. Turn on the cheat console in-game, and press the tilde (~) to bring it up. You can then type the codes in below for the desired effect... Hit tilde “~” and type "npc_create npc_ [name]” to spawn an NPC.