level.bots

This commit is contained in:
INeedBots
2020-10-02 15:08:47 -06:00
parent 3d327af52d
commit cfd1d6e8e3
3 changed files with 37 additions and 29 deletions

View File

@ -94,6 +94,8 @@ init()
level.botPushOutDist = 30;
level.smokeRadius = 255;
level.bots = [];
level.bots_nonfullautoguns = [];
level.bots_nonfullautoguns["barrett"] = true;
@ -360,6 +362,16 @@ watchScrabler()
}
}
/*
When a bot disconnects.
*/
onDisconnect()
{
self waittill("disconnect");
level.bots = array_remove(level.bots, self);
}
/*
Called when a player connects.
*/
@ -388,6 +400,9 @@ 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);
}