Modme Forums

how to make it where max ammo fills clip and stock ammo?

Game Modding | Call of Duty: Black Ops 3 | Scripting


ModmeBot:

Thread By: itznvy
This was my favorite feature in some world at war custom maps, so i'd like to be able to have it in my own.

Can anyone help?


ModmeBot:

Reply By: Abnormal202

itznvy
This was my favorite feature in some world at war custom maps, so i'd like to be able to have it in my own. Can anyone help?

If you look in the ScriptDocs, you can find:
self SetWeaponAmmoClip( weapon, weapon.clipSize )


In order to override the original max ammo script, we must copy & paste _zm_powerup_full_ammo.gsc from ROOT/Share/raw/scripts/zm to ROOT/usermaps/yourmapname/scripts/zm

In that script now change the lines around 110:
if ( players[i] HasWeapon( primary_weapons[x] ) )
				players[i] GiveMaxAmmo( primary_weapons[x] );

to:
if ( players[i] HasWeapon( primary_weapons[x] ) )
			{
				players[i] GiveMaxAmmo( primary_weapons[x] );
				players[i] SetWeaponAmmoClip( primary_weapons[x], primary_weapons[x].clipSize );
			}


ModmeBot:

Reply By: itznvy

Abnormal202
itznvy This was my favorite feature in some world at war custom maps, so i'd like to be able to have it in my own. Can anyone help? If you look in the ScriptDocs, you can find: self SetWeaponAmmoClip( weapon, weapon.clipSize ) In order to override the original max ammo script, we must copy & paste _zm_powerup_full_ammo.gsc from ROOT/Share/raw/scripts/zm to ROOT/usermaps/yourmapname/scripts/zm In that script now change the lines around 110: if ( playersHasWeapon( primary_weapons[x] ) ) playersGiveMaxAmmo( primary_weapons[x] ); to: if ( playersHasWeapon( primary_weapons[x] ) ) { playersGiveMaxAmmo( primary_weapons[x] ); playersSetWeaponAmmoClip( primary_weapons[x], primary_weapons[x].clipSize ); }
Thanks!