I indented this for you. Does this actually even work lol? I really doubt it.
Just by installing a cvar and setting random value's to it doesn't mean the bots actually get stronger or weaker? This makes no sense in my eyes.
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
new PLUGIN[] = "PodBot Manager"
new AUTHOR[] = "Ish Chhabra"
new VERSION[] = "1.00"
new pbmaxbot_cvar
new pbmaxbots
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
pbmaxbot_cvar = register_cvar("amx_pbmaxbots", "10")
pbmaxbots = get_pcvar_num(pbmaxbot_cvar)
register_clcmd("say /podbotcheck", "podbots", ADMIN_KICK, "Check PodBots Skill just now")
new map[32]
get_mapname(map, 31)
// chcek if current map is awp_*
if (containi(map, "awp_") == 0) {
// [executes disable() function]
set_task(1.0, "disable")
} else {
// [executes enable()
// function]
set_task(1.0, "enable")
// [executes podbots()
// function]
register_logevent("podbots", 2, "1=Round_End")
}
}
// disable podbot on having AWP maps
public disable(){
server_cmd("pb_maxbots 1")
}
// enable podbot on other maps by setting podbot maxbots to more than 0
public enable(){
server_cmd("pb_maxbots %d", pbmaxbots)
}
new Players_bot[32]
new Players[32]
new playerCount_bot, i, player_bot
new playerCount, player
new bot_final_deaths = 0
new player_final_deaths = 0
new maxbotskill = 80
new minbotskill = 50
new bot_name[33]
// manage the skills of podbot to make them not owned by pro players
// or not own weak players
public podbots()
{
get_players(Players_bot, playerCount_bot, "d")
for (i = 0; i < playerCount_bot; i++) {
player_bot = Players_bot[i]
new bot_deaths = get_user_deaths(player_bot)
bot_final_deaths = bot_final_deaths + bot_deaths
}
get_players(Players, playerCount, "c")
for (i = 0; i < playerCount; i++) {
player = Players[i]
new player_deaths = get_user_deaths(player)
player_final_deaths = player_final_deaths + player_deaths
}
if (player_final_deaths != 0 && bot_final_deaths != 0 && playerCount != 0 && playerCount_bot != 0) {
if (player_final_deaths / playerCount < bot_final_deaths / playerCount_bot - 2 && maxbotskill >= 10 && minbotskill >= 20) {
maxbotskill = maxbotskill - 10
minbotskill = maxbotskill - 20
server_cmd("pb_maxbotskill %d", maxbotskill)
server_cmd("pb_minbotskill %d", minbotskill)
for (i = 0; i < playerCount_bot; i++) {
player_bot = Players_bot[i]
get_user_name(player_bot, bot_name, 32)
server_cmd("amx_kick %s", bot_name)
}
}
else if (player_final_deaths / playerCount > bot_final_deaths / playerCount_bot + 4 && maxbotskill <= 95 && minbotskill <= 90) {
maxbotskill = maxbotskill + 5
minbotskill = minbotskill + 10
server_cmd("pb_maxbotskill %d", maxbotskill)
server_cmd("pb_minbotskill %d", minbotskill)
for (i = 0; i < playerCount_bot; i++) {
player_bot = Players_bot[i]
get_user_name(player_bot, bot_name, 32)
server_cmd("amx_kick %s", bot_name)
}
}
}
}
__________________