mirror of
https://github.com/ineedbots/iw3_bot_warfare.git
synced 2025-04-22 18:25:44 +00:00
Updated to mw2's
This commit is contained in:
parent
aba2d55e42
commit
37ac438d57
@ -20,8 +20,6 @@ init()
|
||||
cac_init_patch();
|
||||
thread hook_callbacks();
|
||||
|
||||
setDvar("sv_botsPressAttackBtn", true);
|
||||
|
||||
if(getDvar("bots_main_GUIDs") == "")
|
||||
setDvar("bots_main_GUIDs", "");//guids of players who will be given host powers, comma seperated
|
||||
|
||||
@ -87,6 +85,8 @@ init()
|
||||
|
||||
level.smokeRadius = 255;
|
||||
|
||||
level.bots = [];
|
||||
|
||||
level.bots_fullautoguns = [];
|
||||
level.bots_fullautoguns["rpd"] = true;
|
||||
level.bots_fullautoguns["m60e4"] = true;
|
||||
@ -257,6 +257,16 @@ fixPerksAndScriptKick()
|
||||
self.pers["isBot"] = true;
|
||||
}
|
||||
|
||||
/*
|
||||
When a bot disconnects.
|
||||
*/
|
||||
onDisconnect()
|
||||
{
|
||||
self waittill("disconnect");
|
||||
|
||||
level.bots = array_remove(level.bots, self);
|
||||
}
|
||||
|
||||
/*
|
||||
Called when a player connects.
|
||||
*/
|
||||
@ -287,9 +297,23 @@ connected()
|
||||
self thread maps\mp\bots\_bot_internal::connected();
|
||||
self thread maps\mp\bots\_bot_script::connected();
|
||||
|
||||
level.bots[level.bots.size] = self;
|
||||
self thread onDisconnect();
|
||||
|
||||
level notify("bot_connected", self);
|
||||
}
|
||||
|
||||
/*
|
||||
When a bot gets added into the game.
|
||||
*/
|
||||
added()
|
||||
{
|
||||
self endon("disconnect");
|
||||
|
||||
self thread maps\mp\bots\_bot_internal::added();
|
||||
self thread maps\mp\bots\_bot_script::added();
|
||||
}
|
||||
|
||||
/*
|
||||
Adds a bot to the game.
|
||||
*/
|
||||
@ -472,7 +496,12 @@ teamBots()
|
||||
if(player.pers["team"] == toTeam)
|
||||
continue;
|
||||
|
||||
player notify("menuresponse", game["menu_team"], toTeam);
|
||||
if (toTeam == "allies")
|
||||
player thread [[level.allies]]();
|
||||
else if (toTeam == "axis")
|
||||
player thread [[level.axis]]();
|
||||
else
|
||||
player thread [[level.spectator]]();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -495,7 +524,7 @@ teamBots()
|
||||
{
|
||||
if(axis > teamAmount)
|
||||
{
|
||||
player notify("menuresponse", game["menu_team"], "allies");
|
||||
player thread [[level.allies]]();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -503,12 +532,12 @@ teamBots()
|
||||
{
|
||||
if(axis < teamAmount)
|
||||
{
|
||||
player notify("menuresponse", game["menu_team"], "axis");
|
||||
player thread [[level.axis]]();
|
||||
break;
|
||||
}
|
||||
else if(player.pers["team"] != "allies")
|
||||
{
|
||||
player notify("menuresponse", game["menu_team"], "allies");
|
||||
player thread [[level.allies]]();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -619,17 +648,6 @@ addBots()
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
When a bot gets added into the game.
|
||||
*/
|
||||
added()
|
||||
{
|
||||
self endon("disconnect");
|
||||
|
||||
self thread maps\mp\bots\_bot_internal::added();
|
||||
self thread maps\mp\bots\_bot_script::added();
|
||||
}
|
||||
|
||||
/*
|
||||
A thread for ALL players, will monitor and grenades thrown.
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user