mg_add_bots( numBots, team )
{
team = "allies";
for( i = 0; i < numBots ; i++ )
{
wait 0.50;
bot[i] = AddTestClient();
while(!IsDefined(bot[i]))
{
bot[i] = AddTestClient();
continue;
}
bot[i].origin = self.origin;
bot[i].angles = self.angles+ (0,180,0);
bot[i].pers[ "isBot" ] = true;
bot[i].name = "BOT [ " + i + " ]";
bot[i] thread maps\mp\gametypes\_bot::bot_spawn_think("allies");
bot[i] thread maps\mp\gametypes\_bot::bot_set_difficulty( "hard" );
bot[i] waittill("ok_to_loadout");
bot[i] takeAllWeapons();
currentWeapon = "knife_mp";
bot[i] giveWeapon( currentWeapon );
bot[i] SwitchToWeapon( currentWeapon );
bot[i] FreezeControls(false);
bot[i].maxhealth = 500;
bot[i].health = bot[i].maxhealth;
//bot[i] setmodel("infected_char_3");
bot[i].pers[ "team" ] = team;
bot[i].team = team;
bot[i].pers[ "savedmodel" ] = undefined;
bot[i].pers[ "teamTime" ] = 0;
bot[i].sessionteam = team;
bot[i].isInfected = false;
bot[i].isInfectedDef = false;
spawnPoint = bot[i] getSpawnPoint();
bot[i] SetOrigin( spawnPoint.origin );
bot[i] SetPlayerAngles( spawnPoint.angles);
bot[i] thread maps\mp\gametypes\_friendicons:<img src="https://www.itsmods.com/forum/images/smilies/confused.gif" alt="Confused" title="Confused" class="smilie smilie_13" />howFriendIcon();
buildhud();
bot[i].tag_stowed_back = undefined;
bot[i].tag_stowed_hip = undefined;
bot[i] SetAnim( %ch_under_b07_frantic_engineer_01 );
level.botCount++;
}
iPrintln("^1MINIGAME: ^7bots spawned, good luck!");
}