add bots_manage_fill_watchplayers

This commit is contained in:
ineed bots 2024-05-16 19:29:08 -06:00
parent 9c0e3e26cd
commit 3ee5453c87

View File

@ -67,6 +67,11 @@ init()
setdvar( "bots_manage_fill_kick", false ); // kick bots if too many setdvar( "bots_manage_fill_kick", false ); // kick bots if too many
} }
if ( getdvar( "bots_manage_fill_watchplayers" ) == "" )
{
setdvar( "bots_manage_fill_watchplayers", false ); // add bots when player exists, kick if not
}
if ( getdvar( "bots_skill" ) == "" ) if ( getdvar( "bots_skill" ) == "" )
{ {
setdvar( "bots_skill", 0 ); // 0 is random, 1 is easy 7 is hard, 8 is custom, 9 is completely random setdvar( "bots_skill", 0 ); // 0 is random, 1 is easy 7 is hard, 8 is custom, 9 is completely random
@ -583,6 +588,14 @@ addBots_loop()
} }
} }
if ( !randomint( 999 ) )
{
setdvar( "testclients_doreload", true );
wait 0.1;
setdvar( "testclients_doreload", false );
// doExtraCheck();
}
amount = bots; amount = bots;
if ( fillMode == 0 || fillMode == 2 ) if ( fillMode == 0 || fillMode == 2 )
@ -590,17 +603,34 @@ addBots_loop()
amount += players; amount += players;
} }
if ( players <= 0 && getdvarint( "bots_manage_fill_watchplayers" ) )
{
amount = fillAmount + bots;
}
if ( amount < fillAmount ) if ( amount < fillAmount )
{ {
setdvar( "bots_manage_add", 1 ); setdvar( "bots_manage_add", fillAmount - amount );
} }
else if ( amount > fillAmount && getdvarint( "bots_manage_fill_kick" ) ) else if ( amount > fillAmount && getdvarint( "bots_manage_fill_kick" ) )
{
botsToKick = amount - fillAmount;
if ( botsToKick > 64 )
{
botsToKick = 64;
}
for ( i = 0; i < botsToKick; i++ )
{ {
tempBot = getBotToKick(); tempBot = getBotToKick();
if ( isdefined( tempBot ) ) if ( isdefined( tempBot ) )
{ {
BotBuiltinCmdExec( "clientkick " + tempBot getentitynumber() ); BotBuiltinCmdExec( "clientkick " + tempBot getentitynumber() + " EXE_PLAYERKICKED" );
wait 0.25;
}
} }
} }
} }