3 string cache_mutatormsg;
4 string cache_lastmutatormsg;
6 // client counts for each team
7 //float c1, c2, c3, c4;
8 // # of bots on those teams
13 entity lowestplayerteam1;
14 entity lowestplayerteam2;
15 entity lowestplayerteam3;
16 entity lowestplayerteam4;
17 entity lowestbotteam1;
18 entity lowestbotteam2;
19 entity lowestbotteam3;
20 entity lowestbotteam4;
22 int redowned, blueowned, yellowowned, pinkowned;
24 //float audit_teams_time;
26 void TeamchangeFrags(entity e);
28 void LogTeamchange(float player_id, float team_number, float type);
30 void default_delayedinit(entity this);
32 void ActivateTeamplay();
34 void InitGameplayMode();
36 string GetClientVersionMessage(entity this);
38 string getwelcomemessage(entity this);
40 void SetPlayerColors(entity player, float _color);
42 /// \brief Sets the team of the player.
43 /// \param[in,out] player Player to adjust.
44 /// \param[in] teamnum Team number to set. See TEAM_NUM constants.
45 /// \return True if team switch was successful, false otherwise.
46 bool SetPlayerTeamSimple(entity player, int teamnum);
48 /// \brief Sets the team of the player.
49 /// \param[in,out] player Player to adjust.
50 /// \param[in] destinationteam Team to set.
51 /// \param[in] sourceteam Previous team of the player.
52 /// \param[in] noprint Whether to print this event to players' console.
53 /// \return True if team switch was successful, false otherwise.
54 bool SetPlayerTeam(entity player, int destinationteam, int sourceteam, bool noprint);
56 // set c1...c4 to show what teams are allowed
57 void CheckAllowedTeams (entity for_whom);
59 float PlayerValue(entity p);
61 // c1...c4 should be set to -1 (not allowed) or 0 (allowed).
62 // teams that are allowed will now have their player counts stored in c1...c4
63 void GetTeamCounts(entity ignore);
65 /// \brief Returns whether one team is smaller than the other.
66 /// \param[in] teama First team.
67 /// \param[in] teamb Second team.
68 /// \param[in] e Player to check.
69 /// \param[in] usescore Whether to take into account team scores.
70 /// \return True if first team is smaller than the second one, false otherwise.
71 /// \note This function assumes that CheckAllowedTeams and GetTeamCounts have
73 bool IsTeamSmallerThanTeam(int teama, int teamb, entity e, bool usescore);
75 /// \brief Returns whether one team is equal to the other.
76 /// \param[in] teama First team.
77 /// \param[in] teamb Second team.
78 /// \param[in] e Player to check.
79 /// \param[in] usescore Whether to take into account team scores.
80 /// \return True if first team is equal to the second one, false otherwise.
81 /// \note This function assumes that CheckAllowedTeams and GetTeamCounts have
83 bool IsTeamEqualToTeam(int teama, int teamb, entity e, bool usescore);
85 /// \brief Returns the bitmask of the best teams for the player to join.
86 /// \param[in] player Player to check.
87 /// \param[in] usescore Whether to take into account team scores.
88 /// \return Bitmask of the best teams for the player to join.
89 /// \note This function assumes that CheckAllowedTeams and GetTeamCounts have
91 int FindBestTeams(entity player, bool usescore);
93 // returns # of smallest team (1, 2, 3, 4)
94 // NOTE: Assumes CheckAllowedTeams has already been called!
95 float FindSmallestTeam(entity player, float ignore_player);
97 int JoinBestTeam(entity this, bool only_return_best, bool forcebestteam);
99 /// \brief Auto balances bots in teams after the player has changed team.
100 /// \param[in] sourceteam Previous team of the player (1, 2, 3, 4).
101 /// \param[in] destinationteam Current team of the player (1, 2, 3, 4).
102 /// \return No return.
103 /// \note This function assumes that CheckAllowedTeams and GetTeamCounts have
105 void AutoBalanceBots(int sourceteam, int destinationteam);
107 void ShufflePlayerOutOfTeam (float source_team);
109 void setcolor(entity this, int clr);