Andrzej221
New Member
- Joined
- Aug 19, 2007
- Messages
- 22
- Reaction score
- 0
Well, i wanna the Code like "Team System".
It is like when:
if Team1 got more players than Team2
then players what trying to login on team1 going to team2 (auto)
same as if Team2 got more players than Team1 then ...
I trying to do it basing on code from HotServ created by Rex
When i replace above code with:
Then i can't load account when trying to login.
Help me please
It is like when:
if Team1 got more players than Team2
then players what trying to login on team1 going to team2 (auto)
same as if Team2 got more players than Team1 then ...
I trying to do it basing on code from HotServ created by Rex
Code:
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 = IOLoginData.loadAccount((int)loadTeam);
}
else
{
if(accnumber != 2 || accnumber != 1)
account = IOLoginData.loadAccount(accnumber);
}
When i replace above code with:
Code:
Account account = IOLoginData.loadAccount(accnumber);
Then i can't load account when trying to login.
Help me please
Last edited: