Team Specific Pick-ups

Discuss all aspects related to modding Zandronum here.
Post Reply
User avatar
Gibs
 
Posts: 19
Joined: Wed Oct 10, 2012 8:37 am
Location: USA

Team Specific Pick-ups

#1

Post by Gibs » Sat Apr 16, 2016 5:59 am

Is it possible to limit pick-ups to certain teams IE RedTeam is allowed to pick up pistol ammo but BlueTeam is not?

User avatar
fr blood
Frequent Poster Miles card holder
Posts: 995
Joined: Wed Mar 06, 2013 4:04 pm
Location: France

Re: Team Specific Pick-ups

#2

Post by fr blood » Sat Apr 16, 2016 6:36 am

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.

User avatar
SwordGrunt
Forum Regular
Posts: 377
Joined: Thu Jun 07, 2012 8:43 pm

Re: Team Specific Pick-ups

#3

Post by SwordGrunt » Sat Apr 16, 2016 4:48 pm

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));
}

User avatar
Gibs
 
Posts: 19
Joined: Wed Oct 10, 2012 8:37 am
Location: USA

Re: Team Specific Pick-ups

#4

Post by Gibs » Sun Apr 17, 2016 2:20 am

You Guys are the best thanks!

Post Reply