A_JumpIf team

Discuss all aspects related to modding Zandronum here.
Post Reply
Reddevilhunter
New User
Posts: 2
Joined: Sat Aug 18, 2012 1:00 pm

A_JumpIf team

#1

Post by Reddevilhunter » Wed Dec 18, 2013 3:46 pm

Hi thar!

does anyone know if there is a way to use A_JumpIf in combinition with what team you are in?

I think there should be because in the wiki special resides under variables and under special you can find Player_SetTeam.

But I really can't get it to work.

Thanks in advance,

Reddevilhunter

Qent
Retired Staff / Community Team Member
Posts: 1424
Joined: Tue May 29, 2012 7:56 pm
Contact:

RE: A_JumpIf team

#2

Post by Qent » Wed Dec 18, 2013 5:21 pm

You need some ACS and DECORATE:
Spoiler: teamitem.acs (Open)

Code: Select all

#library "teamitem"
#include "zcommon.acs"

script 788 ENTER {
  giveTeamItems();
}

script 789 RESPAWN {
  giveTeamItems();
}

function void giveTeamItems(void) {
  GiveInventory("TeamCounter", GetPlayerInfo(PlayerNumber(), PLAYERINFO_TEAM));
}
Spoiler: decorate.txt (Open)

Code: Select all

// Encodes the player's team in inventory.
actor TeamCounter : Inventory {
  +INVENTORY.UNDROPPABLE
  Inventory.MaxAmount 255
}

Code: Select all

TNT1 A 0 A_JumpIfInventory("TeamCounter", 4, "OnNoTeam")
TNT1 A 0 A_JumpIfInventory("TeamCounter", 3, "OnGoldTeam")
TNT1 A 0 A_JumpIfInventory("TeamCounter", 2, "OnGreenTeam")
TNT1 A 0 A_JumpIfInventory("TeamCounter", 1, "OnRedTeam")
Goto OnBlueTeam // Having no TeamCounters means you're Blue.

Post Reply