PlayerTeam: Difference between revisions
(Added alternative for CLIENTSIDE scripts) |
DrinkyBird (talk | contribs) mNo edit summary Tag: Source edit |
||
(One intermediate revision by the same user not shown) | |||
Line 2: | Line 2: | ||
int '''PlayerTeam''' (void) | int '''PlayerTeam''' (void) | ||
==Usage== | == Usage == | ||
=== Return value === | |||
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>. This function always returns 0 in a CLIENTSIDE script; use <code>GetPlayerInfo(ConsolePlayerNumber(), PLAYERINFO_TEAM)</code> instead. | |||
*'''TEAM_BLUE''' = 0 | *'''TEAM_BLUE''' = 0 | ||
:The player is on the Blue team. | :The player is on the Blue team. | ||
Line 13: | Line 14: | ||
* 3 | * 3 | ||
:The player is on the Gold team. | :The player is on the Gold team. | ||
==Examples== | ==Examples== | ||
<syntaxhighlight lang="c" line="1"> | <syntaxhighlight lang="c" line="1"> | ||
Script 1 ENTER | Script 1 ENTER | ||
Line 31: | Line 29: | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
[[category:ACS | |||
[[category:ACS functions]] |
Latest revision as of 00:37, 3 July 2022
This article documents a Zandronum-specific ACS feature which may not be supported by ZDoom and its other child ports. |
int PlayerTeam (void)
Usage
Return value
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)
. This function always returns 0 in a CLIENTSIDE script; use GetPlayerInfo(ConsolePlayerNumber(), PLAYERINFO_TEAM)
instead.
- 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!");
}