Element/Team: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(New page: __NOTOC__ The team class represents teams controlled by the server. This class is created created/destroyed using scripting functions on the server. The element type of this class is '''"...)
 
No edit summary
 
(14 intermediate revisions by 7 users not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
The team class represents teams controlled by the server. This class is created created/destroyed using scripting functions on the server.
The team class represents player teams. Players on the same team can use team features such as teamchat or friendly fire.


The element type of this class is '''"team"'''.
A common misconception is that players would be child elements of team elements. This is wrong. Being part of a team is merely a relational connection rather than a change in element hierarchy. To perform logic on all the players of a team you have to use the [[getPlayersInTeam]] function.
 
The element type of this class is: '''"team"'''.
 
'''NOTE:''' It is likely that the colorR/G/B values will be changed to the more standard color="#RRGGBB" before the final release.
 
==XML syntax==
<syntaxhighlight lang="xml">
<team name="" colorR="" colorG="" colorB="" friendlyfire=""/>
</syntaxhighlight>
 
===Required Attributes===
* '''name''': A name of the team
 
===Optional Attributes===
* '''colorR''': The red component of the team's color
* '''colorG''': The green component of the team's color
* '''colorB''': The blue component of the team's color
* '''friendlyfire''': Should friendly fire be allowed (true/false)


==Related scripting functions==
==Related scripting functions==
Line 9: Line 27:
===Server===
===Server===
{{Team functions}}
{{Team functions}}
[[Category:Element Types]]
[[en:Element/Team]]
[[ru:Element/Team]]
[[hu:Element/Team]]

Latest revision as of 11:17, 15 December 2021

The team class represents player teams. Players on the same team can use team features such as teamchat or friendly fire.

A common misconception is that players would be child elements of team elements. This is wrong. Being part of a team is merely a relational connection rather than a change in element hierarchy. To perform logic on all the players of a team you have to use the getPlayersInTeam function.

The element type of this class is: "team".

NOTE: It is likely that the colorR/G/B values will be changed to the more standard color="#RRGGBB" before the final release.

XML syntax

<team name="" colorR="" colorG="" colorB="" friendlyfire=""/>

Required Attributes

  • name: A name of the team

Optional Attributes

  • colorR: The red component of the team's color
  • colorG: The green component of the team's color
  • colorB: The blue component of the team's color
  • friendlyfire: Should friendly fire be allowed (true/false)

Related scripting functions

Client


Server