Начинающий
-
Автор темы
- #1
Made a very simple buy bot. No clue why it crashes
C++:
if (g_cfg[XOR("misc_buybot")].get<bool>()) {
if (!g_csgo.m_engine->IsInGame()) return;
// Primary
if (g_cfg[XOR("primary_choice")].get<int>() == 0) {
g_csgo.m_engine->ExecuteClientCmd(tfm::format(XOR("buy scar20;")).data());
g_csgo.m_engine->ExecuteClientCmd(tfm::format(XOR("buy g3sg1;")).data());
}
else if (g_cfg[XOR("primary_choice")].get<int>() == 1) {
g_csgo.m_engine->ExecuteClientCmd(tfm::format(XOR("buy ssg08;")).data());
}
else if (g_cfg[XOR("primary_choice")].get<int>() == 2) {
g_csgo.m_engine->ExecuteClientCmd(tfm::format(XOR("buy awp;")).data());
}
// Secondary
if (g_cfg[XOR("secondary_choice")].get<int>() == 0) {
g_csgo.m_engine->ExecuteClientCmd(tfm::format(XOR("buy elite;")).data());
}
else if (g_cfg[XOR("secondary_choice")].get<int>() == 1) {
g_csgo.m_engine->ExecuteClientCmd(tfm::format(XOR("buy revolver;")).data());
g_csgo.m_engine->ExecuteClientCmd(tfm::format(XOR("buy deagle;")).data());
}
// Other
if (g_cfg[XOR("armor_choice")].get<bool>()) {
g_csgo.m_engine->ExecuteClientCmd(tfm::format(XOR("buy vest;")).data());
g_csgo.m_engine->ExecuteClientCmd(tfm::format(XOR("buy vesthelm;")).data());
}
if (g_cfg[XOR("nades_choice")].get<bool>()) {
g_csgo.m_engine->ExecuteClientCmd(tfm::format(XOR("buy hegrenade;")).data());
g_csgo.m_engine->ExecuteClientCmd(tfm::format(XOR("buy molotov;")).data());
g_csgo.m_engine->ExecuteClientCmd(tfm::format(XOR("buy incgrenade;")).data());
g_csgo.m_engine->ExecuteClientCmd(tfm::format(XOR("buy smokegrenade;")).data());
g_csgo.m_engine->ExecuteClientCmd(tfm::format(XOR("buy defuser;")).data());
g_csgo.m_engine->ExecuteClientCmd(tfm::format(XOR("buy taser;")).data());
}
}