Jump to content

PlayerTeam: Difference between revisions

no edit summary
(Added alternative for CLIENTSIDE scripts)
No edit summary
Tag: Source edit
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.


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.
Line 14: Line 15:
:The player is on the Gold team.
:The player is on the Gold team.


Note: This always returns 0 in a CLIENTSIDE script. Use <code>GetPlayerInfo(ConsolePlayerNumber(), PLAYERINFO_TEAM)</code> instead.


==Examples==
==Examples==
<syntaxhighlight lang="c" line="1">
<syntaxhighlight lang="c" line="1">
Script 1 ENTER
Script 1 ENTER
Line 31: Line 30:
}
}
</syntaxhighlight>
</syntaxhighlight>
[[category:ACS Functions]]
 
[[category:ACS functions]]