Possible To Alter Team Player Ratioss?
Bullet_Force
Join Date: 2012-11-02 Member: 165952Members
in Modding
Comments
Edit this function:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->// Enforce balanced teams
function NS2Gamerules:GetCanJoinTeamNumber(teamNumber)
local team1Players = self.team1:GetNumPlayers()
local team2Players = self.team2:GetNumPlayers()
if (team1Players > team2Players) and (teamNumber == self.team1:GetTeamNumber()) then
return false
elseif (team2Players > team1Players) and (teamNumber == self.team2:GetTeamNumber()) then
return false
end
return true
end<!--c2--></div><!--ec2-->
Also remember to update the auto-team balance code, the join random team code and the numbers of players per team. I have published how do set teams with different numbers of players on this forum previously, but that was before all this auto-balance stuff was added...