
Now search int gmsgShake = 0 and add this right above it ALERT(at_console, "You must now restart to use Sawn-o-matic.\n") is suppose to tell the console to say restart but it does not work. and monster_rat is what it is going to spawn.
#HALF LIFE 2 CHEATS IMPULSE CODE#
giPrecahceRat is seen 2 times the both have to be the same, this tells the code to set giPrecahceRat to 1 instead of 0 which we will add in a minute. UTIL_MakeVectors( Vector( 0, pev->v_angle.y, 0 ) ) Ĭreate("monster_rat", pev->origin + gpGlobals->v_forward * 128, pev->angles) Here is the basic code we need to add in the player.cppĪLERT(at_console, "You must now restart to use Sawn-o-matic.\n") We are going to spawn a rat to annoy code stealers it will be really easy to do your self if you actually read this. Now lets do the harder code, we are going to spawn a monster like impulse 76 were it spawns a human grunt. The GiveNamedItem( "item_suit" ) tells it to give player a suit, change item_suit to what ever item you want to spawn or what ever weapon. This is very simple, case 1 sates that when the player types impulse 1 into the console it will activate this command. Lets get started with the weapon/ item spawn first search case 101 and you should see the impulse commands scroll above one of them and add these lines of code. We will be doing this whole tutorial in player.cpp server side code. The second requirement is the value must be a number no letters. Impulse commands are essentially cheat codes most common know is impulse 101 which gives you all the weapons. First most people know what impulse commands are but just in case you don't I will give you a quick run down.
