Solved, here's the code! Remember to run this in a loop 🙂
// We need to make sure the player shot and is holding the shooting button
if(self isFiring() && self attackButtonPressed()){
// Use stock instead of clip
if( self GetWeaponAmmoStock( self getCurrentWeapon() ) > 0)
{
ClipSize = WeaponClipSize( self getCurrentWeapon() );
CurrentClip = self GetWeaponAmmoClip( self getCurrentWeapon() );
CurrentClipDiff = ClipSize - CurrentClip;
CurrentStock = self GetWeaponAmmoStock( self getCurrentWeapon() );
self setWeaponAmmoClip(self getCurrentWeapon(), ClipSize);
self setWeaponAmmoStock(self getCurrentWeapon(), CurrentStock - CurrentClipDiff);
}
}
I'm unsure how this would work for dual wield weapons, the following might work for World at War but unsure about other games
Add this to any if statement:
&& !maps\_zombiemode_weapons::weapon_is_dual_wield( CurrentWeapon )