The Place to Start


Changing the Default Multiplayer Weapons 
cOda
Easy


Changing the Default Multiplayer Weapons
Hey there. Changing the weapons a player spawns with is very easy, very simple. There is nothing
simpler, I think than this. Origanal VALVe code is in Red My code is in Yellow

First open the mp.dll workspace in Microsoft Visual Studios. Then open multiplay_gamerules.cpp and go to line 452.

you should see something like:
if ( addDefault )
{
pPlayer->GiveNamedItem( "weapon_crowbar" );
pPlayer->GiveNamedItem( "weapon_9mmhandgun" );
pPlayer->GiveAmmo( 68, "9mm", _9MM_MAX_CARRY );// 4 full reloads
}

GiveNamedItem means the game will give the named item when the player spawns. GiveAmmo is self explanitory.
so for my sanity, lets give the player the MP5 and the 357 Magnum. So we sould change the above to:

if ( addDefault )
{

pPlayer->GiveNamedItem( "weapon_python" ); //the python is the magnum
pPlayer->GiveAmmo( 68, "357box", _357_MAX_CARRY );//this is the ammo for the magnum
pPlayer->GiveNamedItem( "weapon_mp5" );//the auto rifle
pPlayer->GiveAmmo( 68, "mp5clip" _9MM_MAX_CARRY );//this gives us the mp5 ammo
}

Compile the mp.dll and place it in your mod's dlls folder.

More than 2 weapons can be given, all you need to do it add
pPlayer->GiveNamedItem( "weapon_yourchoice" ); and its ammo which would be
pPlayer->GiveAmmo( 68, "ammotype" AMMO_MAX_CARRY ); PLEASE dont forget the semi-colen (;) at the end of the line!
Other weapons to choose from are:

weapon_crowbar
weapon_9mmhandgun
weapon_python
weapon_mp5
weapon_crossbow
weapon_shotgun
weapon_rpg
weapon_gauss
weapon_egon
weapon_hornetgun
weapon_handgrenade
weapon_tripmine
weapon_satchel
weapon_snark
MP5 Grenades

Their ammo is as follows (in the same order):

Weapon name Max Ammo Definitionammo type
crowbar nonenone
9mmhandgun _9MM_MAX_CARRY9mm
python (magnum) _357_MAX_CARRY357box
mp5 _9MM_MAX_CARRYmp5clip
crossbow BOLT_MAX_CARRYcrossbowclip
shotgun BUCKSHOT_MAX_CARRYbuckshotbox
rpg ROCKET_MAX_CARRYrpgclip
gauss URANIUM_MAX_CARRYuraniumbox
egon URANIUM_MAX_CARRYuraniumbox
hornetgun (hivehand) HORNET_MAX_CARRY*none
handgrenade HANDGRENADE_MAX_CARRYnone
tripmine TRIPMINE_MAX_CARRYnone
satchel SATCHEL_MAX_CARRYnone
Snarks SNARK_MAX_CARRYsnarkbox
mp5 GrenadesM203_GRENADE_MAX_CARRYm203box

Any questions or suggestions should be sent to me: coda@elp.rr.com