Seeking help with server.cfg bot config

idfix

New member
Hi

I am not very experienced with server configs and I am looking for my server to work like this:

(My server is basically humans vs bots btw.)

- When I join the server alone, I want to be playing with 2 bot friends and 3 opposite bots on the other team.
- When a friend joins, I want him to replace one of the bots on our team, so that we are 2 humans with a bot friend against 3 bot enemies.
- When a third person joins in, I want us all to be human players on our team against 3 bots on the opposite team.
- When a fourth person and +more joins, I always want an extra bot to be added to the opposite team.

How do I set this up in server.cfg?


The server is already using a code that makes you only join the CT team. So that is working fine.
 

Vertigo

⍥????
Staff member
Administrator
The server.cfg configuration alone won't work to match your requirement. Your first 3 requirements can be done using below configs:
JavaScript:
// Enable/disable bots on server
bot_add
// If set to 1, bots will automatically leave to make room for new human player
bot_auto_vacate "1"
// To reduce load on server, recommended to set to 1. If at least 1 human player is present, then bots will automatically join the server.
bot_join_after_player "1"
// Restrict bots to join team "any", "ct", "t"
bot_join_team "any"
// Maximum number of allowed bots in the server
bot_quota "6"
// Determines the bot_quota type
// Values: "normal", "fill", "match".
// "fill" - The server will automatically adjust the bots to keep N bots in the game, where N is bot_quota.
// "match" - The server will maintain 1:N ratio of humans to bots, where N is bot_quota.
bot_quota_mode "fill"
- When a fourth person and +more joins, I always want an extra bot to be added to the opposite team.
For this you will need a plugin to auto adjust the bot_quota based on number of human players currently in server.
 

idfix

New member
Ok, so it turns out this plugin doesn't generate a cfg file. When opening the source, this is what I get to edit inside botsonserver.sp:

/*
Bots on the server.

Plugin by Mauricio Frb.

Description: This plugin add bots on the server according a limit of a real players playing the game.

Cvar:
sm_bot_mplayers <(Default: 10)>
// < > - The number of maximum players that bots can enter the game.
// Like if sm_bot_mplayers is equal 10 and don't have a player, the number of bots is 0.
// If have one player, the number of bots is 9.
// ...
// And if have 5 players, the number of bots is 5.
// ...
// And if have 10 players or more, the number of bots is 0.

Changelog:
1.0 - First release.
*/

#include <sourcemod>
#pragma semicolon 1

new Handle:Mplayers;
new bool:botsOn = false;

public Plugin:myinfo =
{
name = "Bots on the server",
author = "Mauricio Frb",
description = "This plugin add bots on the server according a limit of a real players playing the game.",
version = "1.0",
url = "http://forums.alliedmods.net"
};

public OnPluginStart()
{
Mplayers = CreateConVar("sm_bot_mplayers", "10", "The number of maximum players that bots can enter the game.", FCVAR_PLUGIN);

HookEvent("round_start", Event_RoundStart);
}

public Action:Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
new clients = 0;

for(new i = 1; i < GetMaxClients(); i++)
{
if(IsClientInGame(i) && !IsFakeClient(i)) clients++;
}

if(clients < GetConVarInt(Mplayers))
{
ServerCommand("bot_quota %i", (GetConVarInt(Mplayers) - clients));
botsOn = true;
}
else if(clients >= GetConVarInt(Mplayers) || clients == 0)
{
if(botsOn == true)
{
ServerCommand("bot_quota 0");
botsOn = false;
}
}
}

public OnPluginEnd()
{
UnhookEvent("round_start", Event_RoundStart);
}




I'm not sure what value to set on "sm_bot_mplayers" for my server to work the way I want when 4 players and above join in.
 

idfix

New member
My server has 32 slots. If I put in "sm_bot_mplayers", "16" - will it be equal (bots vs humans) after 4 players have joined in?
Humans CT team, Bots T
 

Vertigo

⍥????
Staff member
Administrator
My server has 32 slots. If I put in "sm_bot_mplayers", "16" - will it be equal (bots vs humans) after 4 players have joined in?
Humans CT team, Bots T
Contact me over discord (vertigo#9152). I'll give you a plugin and we'll see if that works.
 

idfix

New member
Wow, that is really nice of you. I don't have discord on this machine but will install it and give you a contact within this hour.
Btw, I tried out that plugin above but quickly realized it wasn't doing anything for my needs. Alright, downloading Discord now!
 
Top
AdBlock Detected

We get it, advertisements are annoying!

Sure, ad-blocking software does a great job at blocking ads, but it also blocks useful features of our website. For the best site experience please disable your AdBlocker.

I've Disabled AdBlock