3 string cache_mutatormsg;
4 string cache_lastmutatormsg;
6 // client counts for each team
7 //float c1, c2, c3, c4;
9 // The following variables are used for balancing. They are not updated
10 // automatically. You need to call CheckAllowedTeams and GetTeamCounts to get
12 float numbotsteam1; ///< Number of bots in the first team.
13 float numbotsteam2; ///< Number of bots in the second team.
14 float numbotsteam3; ///< Number of bots in the third team.
15 float numbotsteam4; ///< Number of bots in the fourth team.
16 entity lowesthumanteam1; ///< Human with the lowest score in the first team.
17 entity lowesthumanteam2; ///< Human with the lowest score in the second team.
18 entity lowesthumanteam3; ///< Human with the lowest score in the third team.
19 entity lowesthumanteam4; ///< Human with the lowest score in the fourth team.
20 entity lowestbotteam1; ///< Bot with the lowest score in the first team.
21 entity lowestbotteam2; ///< Bot with the lowest score in the second team.
22 entity lowestbotteam3; ///< Bot with the lowest score in the third team.
23 entity lowestbotteam4; ///< Bot with the lowest score in the fourth team.
25 int redowned, blueowned, yellowowned, pinkowned;
27 //float audit_teams_time;
29 void TeamchangeFrags(entity e);
31 void LogTeamchange(float player_id, float team_number, float type);
33 void default_delayedinit(entity this);
35 void ActivateTeamplay();
37 void InitGameplayMode();
39 string GetClientVersionMessage(entity this);
41 string getwelcomemessage(entity this);
43 void SetPlayerColors(entity player, float _color);
45 /// \brief Sets the team of the player.
46 /// \param[in,out] player Player to adjust.
47 /// \param[in] teamnum Team number to set. See TEAM_NUM constants.
48 /// \return True if team switch was successful, false otherwise.
49 bool SetPlayerTeamSimple(entity player, int teamnum);
51 /// \brief Sets the team of the player.
52 /// \param[in,out] player Player to adjust.
53 /// \param[in] destinationteam Team to set.
54 /// \param[in] sourceteam Previous team of the player.
55 /// \param[in] noprint Whether to print this event to players' console.
56 /// \return True if team switch was successful, false otherwise.
57 bool SetPlayerTeam(entity player, int destinationteam, int sourceteam, bool noprint);
59 // set c1...c4 to show what teams are allowed
60 void CheckAllowedTeams (entity for_whom);
62 float PlayerValue(entity p);
64 // c1...c4 should be set to -1 (not allowed) or 0 (allowed).
65 // teams that are allowed will now have their player counts stored in c1...c4
66 void GetTeamCounts(entity ignore);
68 /// \brief Returns whether one team is smaller than the other.
69 /// \param[in] teama First team.
70 /// \param[in] teamb Second team.
71 /// \param[in] e Player to check.
72 /// \param[in] usescore Whether to take into account team scores.
73 /// \return True if first team is smaller than the second one, false otherwise.
74 /// \note This function assumes that CheckAllowedTeams and GetTeamCounts have
76 bool IsTeamSmallerThanTeam(int teama, int teamb, entity e, bool usescore);
78 /// \brief Returns whether one team is equal to the other.
79 /// \param[in] teama First team.
80 /// \param[in] teamb Second team.
81 /// \param[in] e Player to check.
82 /// \param[in] usescore Whether to take into account team scores.
83 /// \return True if first team is equal to the second one, false otherwise.
84 /// \note This function assumes that CheckAllowedTeams and GetTeamCounts have
86 bool IsTeamEqualToTeam(int teama, int teamb, entity e, bool usescore);
88 /// \brief Returns the bitmask of the best teams for the player to join.
89 /// \param[in] player Player to check.
90 /// \param[in] usescore Whether to take into account team scores.
91 /// \return Bitmask of the best teams for the player to join.
92 /// \note This function assumes that CheckAllowedTeams and GetTeamCounts have
94 int FindBestTeams(entity player, bool usescore);
96 // returns # of smallest team (1, 2, 3, 4)
97 // NOTE: Assumes CheckAllowedTeams has already been called!
98 float FindSmallestTeam(entity player, float ignore_player);
100 int JoinBestTeam(entity this, bool only_return_best, bool forcebestteam);
102 /// \brief Auto balances bots in teams after the player has changed team.
103 /// \param[in] sourceteam Previous team of the player (1, 2, 3, 4).
104 /// \param[in] destinationteam Current team of the player (1, 2, 3, 4).
105 /// \return No return.
106 /// \note This function assumes that CheckAllowedTeams and GetTeamCounts have
108 void AutoBalanceBots(int sourceteam, int destinationteam);
110 void ShufflePlayerOutOfTeam (float source_team);
112 void setcolor(entity this, int clr);