Page 1 of 1

A_JumpIf team

Posted: Wed Dec 18, 2013 3:46 pm
by Reddevilhunter
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

RE: A_JumpIf team

Posted: Wed Dec 18, 2013 5:21 pm
by Qent
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.