PlayerTeam: Difference between revisions

From Zandronum Wiki
(Created page with "{{Template:ACSWarning}} int '''PlayerTeam''' (void) ==Usage== This function returns the activator's team, or the amount of teams if the player is not on a team. This is equi...")
 
No edit summary
Line 4: Line 4:
==Usage==
==Usage==


This function returns the activator's team, or the amount of teams if the player is not on a team. This is equivalent to '''{{Zdoomwiki|GetPlayerInfo}}(PlayerNumber(), PLAYERINFO_TEAM)'''
This function returns the activator's team, or the amount of teams if the player is not on a team. This is equivalent to <code>'''{{Zdoomwiki|GetPlayerInfo}}(PlayerNumber(), PLAYERINFO_TEAM)'''</code>
*'''TEAM_BLUE''' = 0
*'''TEAM_BLUE''' = 0
:The player is on the Blue team.
:The player is on the Blue team.

Revision as of 16:30, 21 August 2016

This article documents a Zandronum-specific ACS feature which may not be supported by ZDoom and its other child ports.

int PlayerTeam (void)

Usage

This function returns the activator's team, or the amount of teams if the player is not on a team. This is equivalent to GetPlayerInfo(PlayerNumber(), PLAYERINFO_TEAM)

  • TEAM_BLUE = 0
The player is on the Blue team.
  • TEAM_RED = 1
The player is on the Red team.
  • 2
The player is on the Green team.
  • 3
The player is on the Gold team.

Examples

Script 1 ENTER
{
    if (PlayerTeam() == TEAM_BLUE)
        Print(s:"You're on the blue team!");
    if (PlayerTeam() == TEAM_RED)
        Print(s:"You're on the red team!");
    if (PlayerTeam() == 2)
        Print(s:"You're on the green team!");
    if (PlayerTeam() == 3)
        Print(s:"You're on the yellow team!");
}