Added custom bot names

This commit is contained in:
ineedbots 2021-06-28 16:49:43 -06:00
parent bc91d819ea
commit 3ed8a393d3
2 changed files with 15 additions and 0 deletions

View File

@ -3,8 +3,19 @@
namespace Components namespace Components
{ {
const char* Bots::ConnectString = "connect \"\\cg_predictItems\\1\\cl_punkbuster\\0\\cl_anonymous\\0\\color\\4\\head\\default\\model\\multi\\snaps\\20\\"
"rate\\5000\\name\\%s\\protocol\\%d\"";
int Bots::BuildConnectString(char* buffer, const char*, [[maybe_unused]] int num, int protocol)
{
const char* botName = Utils::String::VA("bota%d", num);
return sprintf(buffer, ConnectString, botName, protocol);
}
Bots::Bots() Bots::Bots()
{ {
// intercept the sprintf when creating the bot connect string
Utils::Hook(0x45655B, BuildConnectString, HOOK_CALL).install()->quick();
} }
Bots::~Bots() Bots::~Bots()

View File

@ -7,5 +7,9 @@ namespace Components
public: public:
Bots(); Bots();
~Bots(); ~Bots();
private:
static const char* ConnectString;
static int BuildConnectString(char*, const char*, int, int);
}; };
} }