Raised This Month: $ Target: $400
 0% 

can u make autoteambalancer? (for bots)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
1ka
Senior Member
Join Date: Jun 2012
Old 11-01-2016 , 12:24   can u make autoteambalancer? (for bots)
Reply With Quote #1

can u make autoteambalancer? (for bots)
i use https://forums.alliedmods.net/showthread.php?t=79556
But is not able to balance the Bots


Sometimes it happens
ct is 7 real player and 3 bots
in t, 2 real player and 8 bots

In this moment need tranfer ct-real player to T
and T-bots to ct
__________________
Sorry for my bad english.

Last edited by 1ka; 11-01-2016 at 12:26.
1ka is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 11-01-2016 , 14:23   Re: can u make autoteambalancer? (for bots)
Reply With Quote #2

Just remove the bot check from that plugin...
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
1ka
Senior Member
Join Date: Jun 2012
Old 11-01-2016 , 15:05   Re: can u make autoteambalancer? (for bots)
Reply With Quote #3

Quote:
Originally Posted by OciXCrom View Post
Just remove the bot check from that plugin...
Useless method
in this plugin
https://forums.alliedmods.net/showthread.php?t=79556
is not "bot check"
in this plugin is not difference between real player and bot
bot also is real player for this plugin
__________________
Sorry for my bad english.

Last edited by 1ka; 11-01-2016 at 15:06.
1ka is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 11-02-2016 , 11:11   Re: can u make autoteambalancer? (for bots)
Reply With Quote #4

PHP Code:
/*    Copyright © 2008, ConnorMcLeod

    Instant AutoTeamBalance is free software;
    you can redistribute it and/or modify it under the terms of the
    GNU General Public License as published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Instant AutoTeamBalance; if not, write to the
    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.
*/

#include <amxmodx>
#include <cstrike>

#define PLUGIN "Instant AutoTeamBalance"
#define AUTHOR "ConnorMcLeod"
#define VERSION "1.2.0"

#define BALANCE_IMMUNITY        ADMIN_RCON

#define MAX_PLAYERS    32

enum {
    
aTerro,
    
aCt
}

new 
bool:g_bImmuned[MAX_PLAYERS+1]

new 
Float:g_fJoinedTeam[MAX_PLAYERS+1] = {-1.0, ...}

new 
g_iMaxPlayers
new g_pcvarEnableg_pcvarImmuneg_pCvarMessage

// true when connected and not a HLTV
//new bool:g_bValid[MAX_PLAYERS+1]

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
g_pcvarEnable register_cvar("iatb_active""1")
    
g_pcvarImmune register_cvar("iatb_admins_immunity""1")
    
g_pCvarMessage register_cvar("iatb_message""Teams Auto Balanced")

    
register_logevent("LogEvent_JoinTeam"3"1=joined team")

    
register_event("TextMsg""Auto_Team_Balance_Next_Round""a""1=4""2&#Auto_Team")

    
g_iMaxPlayers get_maxplayers()
}

public 
LogEvent_JoinTeam()
{
    new 
loguser[80], name[32], id
    read_logargv
(0loguser79)
    
parse_loguser(logusername31)
    
id get_user_index(name)

    
g_fJoinedTeam[id] = get_gametime()
}

public 
client_authorized(id)
{
    
g_bImmuned[id] = bool:(get_user_flags(id) & BALANCE_IMMUNITY)
}

/*public client_putinserver(id)
{
    g_bValid[id] = bool:!is_user_hltv(id)
}*/

/*public client_disconnect(id)
{
    g_bValid[id] = false
}*/

public Auto_Team_Balance_Next_Round()
{
    if(!
get_pcvar_num(g_pcvarEnable))
        return

    if( 
balance_teams()  )
    {
        new 
szMessage[128]
        
get_pcvar_string(g_pCvarMessageszMessagecharsmax(szMessage))
        
client_print(0print_centerszMessage)
    }
}

cs_set_user_team_custom(idCsTeams:iTeam)
{
    switch(
iTeam)
    {
        case 
CS_TEAM_T
        {
            if( 
cs_get_user_defuse(id) )
            {
                
cs_set_user_defuse(id0)
                
// set body to 0 ?
            
}
        }
        case 
CS_TEAM_CT:
        {
            if( 
user_has_weapon(idCSW_C4) )
            {
                
engclient_cmd(id"drop""weapon_c4")
            }
        }
    }

    
cs_set_user_team(idiTeam)

    return 
1
}

balance_teams()
{
    new 
aTeams[2][MAX_PLAYERS], aNum[2], id

    
for(id 1id <= g_iMaxPlayersid++)
    {
        
/*if(!g_bValid[id])
        {
            continue
        }*/

        
switch( cs_get_user_team(id) )
        {
            case 
CS_TEAM_T:
            {
                
aTeams[aTerro][aNum[aTerro]++] = id
            
}
            case 
CS_TEAM_CT:
            {
                
aTeams[aCt][aNum[aCt]++] = id
            
}
            default:
            {
                continue
            }
        }
    }

    new 
iCheck
    
new iTimes aNum[aCt] - aNum[aTerro]

    if(
iTimes 0)
    {
        
iCheck aCt
    
}
    else if(
iTimes 0)
    {
        
iCheck aTerro
    
}
    else
    {
        return 
0
    
}

    
iTimes abs(iTimes/2)

    new 
bool:bTransfered[MAX_PLAYERS+1],
        
bool:bAdminsImmune bool:get_pcvar_num(g_pcvarImmune)

    new 
iLastiCount
    
while( iTimes )
    {
        
iLast 0
        
for(new i=0<aNum[iCheck]; i++)
        {
            
id aTeams[iCheck][i]
            if( 
g_bImmuned[id] && bAdminsImmune )
            {
                continue
            }
            if(
bTransfered[id])
            {
                continue
            }
            if(
g_fJoinedTeam[id] > g_fJoinedTeam[iLast])
            {
                
iLast id
            
}
        }

        if(!
iLast)
        {
            return 
0
        
}

        
cs_set_user_team_custom(iLastiCheck CS_TEAM_T CS_TEAM_CT)

        
bTransfered[iLast] = true
        iCount
++
        
iTimes--
    }
    return 
1

__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
1ka
Senior Member
Join Date: Jun 2012
Old 11-03-2016 , 05:13   Re: can u make autoteambalancer? (for bots)
Reply With Quote #5

Napoleon_be

if u make this

PHP Code:
/*public client_putinserver(id)
{
    g_bValid[id] = bool:!is_user_hltv(id)
}*/

/*public client_disconnect(id)
{
    g_bValid[id] = false
}*/

        /*if(!g_bValid[id])
        {
            continue
        }*/ 
plugin works for bots???
__________________
Sorry for my bad english.
1ka is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 11-03-2016 , 05:47   Re: can u make autoteambalancer? (for bots)
Reply With Quote #6

why don't you test it, didn't even test it myself so i don't know if this works.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
1ka
Senior Member
Join Date: Jun 2012
Old 11-03-2016 , 05:56   Re: can u make autoteambalancer? (for bots)
Reply With Quote #7

not works dude
3 round
in CT is 8 bots
and T team is 3 bots
real players also unbalanced
not balanced

i think need
if(!is_user_bot(id)) or if(is_user_bot(id))
but i dont know more
two script need
one balance only bots
second balance only real players


I was amazed
in this forum cant find (teambalancer) for bots (or only real players)
and i have CT 1 real player and 9 bots, and T team 9 real player and 1 bot
lol
__________________
Sorry for my bad english.

Last edited by 1ka; 11-03-2016 at 06:00.
1ka is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 11-03-2016 , 07:13   Re: can u make autoteambalancer? (for bots)
Reply With Quote #8

Quote:
Originally Posted by 1ka View Post
not works dude
3 round
in CT is 8 bots
and T team is 3 bots
real players also unbalanced
not balanced

i think need
if(!is_user_bot(id)) or if(is_user_bot(id))
but i dont know more
two script need
one balance only bots
second balance only real players


I was amazed
in this forum cant find (teambalancer) for bots (or only real players)
and i have CT 1 real player and 9 bots, and T team 9 real player and 1 bot
lol
Maybe this is just coinsidence? Try balancing a few times to see if this problem persists.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
1ka
Senior Member
Join Date: Jun 2012
Old 11-03-2016 , 09:15   Re: can u make autoteambalancer? (for bots)
Reply With Quote #9

does not work..
please search for the means to teambalance bots

An example of such a situation
CT 1 real player and 9 bots
and TER team 9 real player and 1 bot
I need to balance only BOTS and separately balance only Real players
__________________
Sorry for my bad english.
1ka is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:27.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode