Raised This Month: $82 Target: $400
 20% 

PODBots control(kick or add) automatically.


Post New Thread Reply   
 
Thread Tools Display Modes
iveto69
Junior Member
Join Date: Aug 2018
Old 04-15-2019 , 02:08   Re: PODBots control(kick or add) automatically.
Reply With Quote #11

Quote:
Originally Posted by Bugsy View Post
Having a hard time figuring out how to disable the automatic bot management. When my plugin kicks one, the module re-adds automatically.
or this is:


Human players = 1, X bots = 5
Human players = 1, X bots = 5
Human players = 2, X bots = 5
Human players = 3, X bots = 5
Human players = 4, X bots = 5
Human players = 5, X bots = 5
Human players = 6, X bots = 5
Human players = 7, X bots = 5
Human players = 8, X bots = 5
Human players = 9, X bots = 5
Human players = 10, X bots = 0
Human players = 11, X bots = 0
Human players = 12, X bots = 0
......
Human players = 20, X bots = 0
iveto69 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-15-2019 , 21:07   Re: PODBots control(kick or add) automatically.
Reply With Quote #12

I understand what you wanted, but as I said, I cannot disable to automatic podbot bot management. It keeps adding as I kick them to balance the bot count.

Try this:
Code:
pb_minbots 5
pb_maxbots 5
pb_bot_quota_match 5
__________________
Bugsy is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-16-2019 , 19:30   Re: PODBots control(kick or add) automatically.
Reply With Quote #13

Bot balancing occurs at round end or after first player join on map change/server start. I could not thoroughly test as I do not run a server so I could only test with 1 player.

PHP Code:

#include <amxmodx>

new const Version[] = "0.1";

enum PlayerCount
{
    
HumanCount,
    
BotCount
}

new 
g_PlayerCountsPlayerCount ];
new 
g_RoundEnd;

new const 
g_BotsNeeded32 ] = 
{
    
0// 0 humans
    
5// 1 humans
    
5// 2 humans
    
5// 3 humans
    
5// 4 humans
    
5// 5 humans
    
5// 6 humans
    
5// 7 humans
    
4// 8 humans
    
4// 9 humans
    
3// 10 humans
    
2// 11 humans
    
1  // 12 humans 
       // 13-32 humans = 0 bots
}

public 
plugin_init() 
{
    
register_plugin"PodBot Manager"Version "bugsy" );
    
    
register_logevent"RoundEnd" "1=Round_End" );
    
server_cmd"pb removebots" );
    
set_cvar_num"pb_minbots" );
    
set_cvar_num"pb_maxbots" g_BotsNeeded] );
}

public 
client_authorizedid )
{
    
g_PlayerCountsPlayerCount:is_user_botid ) ]++;
    
    
//Handle bots on map change
    
if ( !g_RoundEnd )
    {
        
set_task5.0 "BalanceBots" );
        
g_RoundEnd get_systime();
    }
}

public 
client_disconnectedid )
{
    
g_PlayerCountsPlayerCount:is_user_botid ) ]--;
}

public 
RoundEnd()
{
    if ( ( 
get_systime() - g_RoundEnd ) > )
    {
        
BalanceBots();
    }
    
    
g_RoundEnd get_systime();
}

public 
BalanceBots()
{
    new 
iNumBots g_PlayerCountsBotCount ];
    new 
iNumHumans g_PlayerCountsHumanCount ];
    new 
iBotsNeeded g_BotsNeedediNumHumans ];
    new 
szName32 ] , iBots32 ] , iBotCount i;
    
    if ( 
iNumBots iBotsNeeded )
    {
        
get_playersiBots iBotCount "d" );
        
        while ( 
iNumBots-- > iBotsNeeded )
        {
            
get_user_nameiBotsi++ ] , szName charsmaxszName ) );
            
server_cmd"pb remove ^"%s^"" szName );
        }
    }
    else if ( 
iNumBots iBotsNeeded )
    {
        while ( 
iNumBots++ < iBotsNeeded )
        {
            
server_cmd"pb add" );
        }
    }

__________________

Last edited by Bugsy; 04-20-2019 at 11:46.
Bugsy is offline
iveto69
Junior Member
Join Date: Aug 2018
Old 04-17-2019 , 03:44   Re: PODBots control(kick or add) automatically.
Reply With Quote #14

Thanks ! I will test it.
iveto69 is offline
iveto69
Junior Member
Join Date: Aug 2018
Old 04-18-2019 , 08:21   Re: PODBots control(kick or add) automatically.
Reply With Quote #15

I'm sorry, but it does not work. The plug-in is compiled, the server accepts it in the amx list, but it does not work.
I'm sorry, I know that you are quite experienced and you understand these things well... , but maybe what I want is unattainable ?
iveto69 is offline
Mordekay
Squirrel of Fortune
Join Date: Apr 2006
Location: Germany
Old 04-18-2019 , 13:27   Re: PODBots control(kick or add) automatically.
Reply With Quote #16

http://forums.bots-united.com/forumdisplay.php?f=47
This is the official forum for pod-bot. You may would ask there.
__________________

Mordekay is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-18-2019 , 18:41   Re: PODBots control(kick or add) automatically.
Reply With Quote #17

Can you be specific about what does not work? Like I said, when I test by myself, it works exactly as expected. What you requested is not complicated at all.

Server start/map change and no humans = no bots
Server start/map change, I connect, 5 bots join
__________________

Last edited by Bugsy; 04-18-2019 at 18:42.
Bugsy is offline
Reply


Thread Tools
Display Modes

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 05:21.


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