Player SetTeam: Difference between revisions

From Zandronum Wiki
(3.1 is released, so Devfeature templates have been removed)
(This is an action special too)
Tag: Source edit
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{DISPLAYTITLE:Player_SetTeam}}
{{DISPLAYTITLE:Player_SetTeam}}
{{Template:ACSWarning}}
{{Template:ACSWarning}}
int '''Player_SetTeam''' (int ''team'')
'''145:Player_SetTeam (int ''team''[, bool ''nobroadcast''])'''


int '''Player_SetTeam''' (int ''team'', bool ''nobroadcast'')
== Usage ==
Changes the team of the player who activated the special to ''team''. A valid team is anywhere between 0 and sv_maxteams (so 2, 3, 4). The teams are 0 = Blue, 1 = Red, 2 = Green, 3 = Gold. Using the current value of sv_maxteams removes the player from their current team without making them join another.


==Usage==
=== Parameters ===
* ''team'': ID of the team for the player to join.
* ''nobroadcast'': When true, the team switch will not be announced in chat.


Changes the team of the player who activated the special to ''team''. A valid team is anywhere between 0 and sv_maxteams (so 2, 3, 4). The teams are 0 = Blue, 1 = Red, 2 = Green, 3 = Gold. Using the current value of sv_maxteams removes the player from his current team without making him join another.
=== Return value ===
Returns true if the player was switched successfully.


The <tt>nobroadcast</tt> argument is optional, and suppresses the "{player} joined the {team}" chat message.
== Examples ==
{{noexamples}}


==Example==
[[Category: ACS functions]]
{{noexamples}}
[[Category: Action specials]]

Latest revision as of 02:19, 3 July 2022


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

145:Player_SetTeam (int team[, bool nobroadcast])

Usage

Changes the team of the player who activated the special to team. A valid team is anywhere between 0 and sv_maxteams (so 2, 3, 4). The teams are 0 = Blue, 1 = Red, 2 = Green, 3 = Gold. Using the current value of sv_maxteams removes the player from their current team without making them join another.

Parameters

  • team: ID of the team for the player to join.
  • nobroadcast: When true, the team switch will not be announced in chat.

Return value

Returns true if the player was switched successfully.

Examples

This article lists no examples, please add one.