Page 1 of 1

Team Specific Pick-ups

Posted: Sat Apr 16, 2016 5:59 am
by Gibs
Is it possible to limit pick-ups to certain teams IE RedTeam is allowed to pick up pistol ammo but BlueTeam is not?

Re: Team Specific Pick-ups

Posted: Sat Apr 16, 2016 6:36 am
by fr blood
Yes it is, by giving a custom Inventory for a team when the other won't have it, then you'll have to edit the item to check if the player trying to pick it has the inventory or not.

Re: Team Specific Pick-ups

Posted: Sat Apr 16, 2016 4:48 pm
by SwordGrunt
Sure. Try this:

Code: Select all

const int TEAMNUM_BLUE = 0;
const int TEAMNUM_RED = 0;

actor PistolAmmoBlueTeam : CustomInventory
{
+INVENTORY.AUTOACTIVATE
states
{
   Spawn:
      CLIP A -1
      stop
   Pickup:
      TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(667) == TEAMNUM_BLUE,"GiveAmmo")
      fail
   GiveAmmo:
      TNT1 A 0 A_GiveInventory("Clip",10)
      stop
}
}

Code: Select all

#library "TEAMAMMO"
#include "zcommon.acs"

script 667 (void)
{
   SetResultValue(GetPlayerInfo(PlayerNumber(),PLAYERINFO_TEAM));
}

Re: Team Specific Pick-ups

Posted: Sun Apr 17, 2016 2:20 am
by Gibs
You Guys are the best thanks!