Hi, i am making an "Instant Team Balances" plugin for CS1.6 Deathmatch gameplay (no roundend). But something goes wrong, the function is called but it not balance the teams but inverted.
For example:
Current TR -- 8 players
Current CT -- 4 players
If one player disconnect then i set AutoTeamBalance after 10 seconds. When the function called, current players will be:
Current TR -- 9 players
Current CT -- 2 players
public OnInstallGameRules_Post() { GameRules = OrpheuGetReturn() }
public OnTeamInfo() { new id = read_data(1) if(!is_user_alive(id)) { new PlayerTeam[32] read_data(2, PlayerTeam, 31) switch(PlayerTeam[0]) { case 'C': DoTask(); case 'T': DoTask(); case 'S': DoTask(); } } }
public OnClientDisconnect(id) { DoTask() }
public TaskBalanceTeam() { new iTR = GetPlayerCount(1) //T count new iCT = GetPlayerCount(2) //CT count
//players >= 2 in 1 team, then call BalanceTeams if((iTR-iCT >= 2) || (iCT-iTR >= 2)) { client_print(0, print_chat, "[ITB] TR: [%d] -- CT: [%d]", iTR, iCT) //debug chat OrpheuCall(BalanceTeams, GameRules) client_print(0, print_center, "*** Teams Auto Balanced, Check Your Team ***") } }
//get team player count 1=TR | 2=CT GetPlayerCount(team) { new j, iCount = 0 for(j=1;j<=iMaxClients;j++) { if(!is_user_connected(j)) continue;