• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

RevScripts Auto Balanced

Joined
Dec 10, 2016
Messages
48
Reaction score
10
I need a scrip for Auto Balanced teams on a 8.6 war server that works this way: you put 1/1 and you go for 1/1 or 2/2 team the one who have less people at the moment. I found this one but didn't work for me at TFS 0.3.7:

Account account;
if(g_config.getString(ConfigManager::TEAM_SYSTEM) == "yes")
{
int32_t Team1 = 0, Team2 = 0;
unsigned short loadTeam = 0;
AutoList<Player>::listiterator it = Player::listPlayer.list.begin();
while(it != Player::listPlayer.list.end())
{
if((*it).second->accountNumber == 1)
Team1 += 1;
else if((*it).second->accountNumber == 2)
Team2 += 1;
++it;
}
if(Team1 > Team2)
{
loadTeam = 2;
accnumber = 2;
password = "2";
}
else if(Team2 > Team1)
{
loadTeam = 1;
accnumber = 1;
password = "1";
}
account = IOAccount::instance()->loadAccount((int)loadTeam);
}
else
{
if(accnumber != 2 || accnumber != 1)
account = IOAccount::instance()->loadAccount(accnumber);
}
 
Back
Top