Page 1 of 1

Deny pickup weapon twice

Posted: Thu Nov 01, 2018 5:16 am
by dot
Small mutator for disable pickup weapon if you already have one.

Intended fix collect weapons by others players if you die on MH server.
Usually on MH servers ammo increase automatically, so you do not need collect weapon or ammo. Exclude WarHead.
But if you die and your weapons collected it can be pity for you.

Mutator written maximally compatible and must work with any others.
It must be first in chain for properly work.

Code: Select all

class DenyPickupWeaponTwice extends Mutator;

function bool HandlePickupQuery(Pawn Other, Inventory item, out byte bAllowPickup) {
	Local Weapon weap;
	if (item.isA('Weapon')) {
		weap = Weapon(Other.FindInventoryType(item.Class));
		if (weap != None) {
			bAllowPickup = 0;
			if (item.isA('WarHeadLauncher') && weap.AmmoType != None && weap.AmmoType.AmmoAmount < weap.AmmoType.MaxAmmo) bAllowPickup = 1;
			if (item.isA('Enforcer') && !weap.isA('DoubleEnforcer')) bAllowPickup = 1;
			if (bAllowPickup == 0) return true;
		}
	}
   return super.HandlePickupQuery(Other, item, bAllowPickup);
}
DenyPickupWeaponTwice2.zip
(1.35 KiB) Downloaded 43 times

Re: Deny pickup weapon twice

Posted: Thu Nov 01, 2018 1:10 pm
by RocketJedi
thanks! I will check it out.

Re: Deny pickup weapon twice

Posted: Thu Nov 01, 2018 1:43 pm
by dot
I forgot mention about WarHeadLauncher. It is collectable until you not get max ammo for it.

Fix pickup enforcer for double enforcer.