mirror of
https://github.com/ineedbots/iw4_bot_warfare.git
synced 2025-04-22 05:55:42 +00:00
host func
This commit is contained in:
parent
792bf42c88
commit
c0bf3fbc6d
@ -10,11 +10,11 @@ init()
|
||||
{
|
||||
level.bw_VERSION = "2.0.0";
|
||||
|
||||
if(getDvar("bots_main_debug") == "")
|
||||
setDvar("bots_main_debug", 0);
|
||||
if(getDvar("bots_main") == "")
|
||||
setDvar("bots_main", true);
|
||||
|
||||
if(getDVarint("bots_main_debug"))
|
||||
return;
|
||||
if (!getDvarInt("bots_main"))
|
||||
return;
|
||||
|
||||
thread load_waypoints();
|
||||
thread hook_callbacks();
|
||||
@ -365,6 +365,9 @@ connected()
|
||||
{
|
||||
self endon("disconnect");
|
||||
|
||||
if (!isDefined(self.pers["bot_host"]))
|
||||
self thread doHostCheck();
|
||||
|
||||
if(!self is_bot())
|
||||
return;
|
||||
|
||||
@ -382,6 +385,8 @@ connected()
|
||||
|
||||
self thread maps\mp\bots\_bot_internal::connected();
|
||||
self thread maps\mp\bots\_bot_script::connected();
|
||||
|
||||
level notify("bot_connected", self);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -2,6 +2,16 @@
|
||||
#include maps\mp\_utility;
|
||||
#include maps\mp\gametypes\_hud_util;
|
||||
|
||||
is_host()
|
||||
{
|
||||
return (isDefined(self.pers["bot_host"]) && self.pers["bot_host"]);
|
||||
}
|
||||
|
||||
doHostCheck()
|
||||
{
|
||||
self.pers["bot_host"] = false;
|
||||
}
|
||||
|
||||
/*
|
||||
Returns if the player is a bot.
|
||||
*/
|
||||
|
@ -5,6 +5,9 @@
|
||||
|
||||
init()
|
||||
{
|
||||
if(getDvar("bots_main_debug") == "")
|
||||
setDvar("bots_main_debug", 0);
|
||||
|
||||
if(!getDVarint("bots_main_debug"))
|
||||
return;
|
||||
|
||||
@ -17,11 +20,13 @@ init()
|
||||
exitLevel(false);
|
||||
}
|
||||
|
||||
setDvar("bots_main", 0);
|
||||
setdvar("bots_main_menu", 0);
|
||||
setdvar("bots_manage_fill_mode", 0);
|
||||
setdvar("bots_manage_fill", 0);
|
||||
setdvar("bots_manage_add", 0);
|
||||
setdvar("bots_manage_fill_kick", 1);
|
||||
setDvar("bots_manage_fill_spec", 1);
|
||||
|
||||
if (getDvar("bots_main_debug_distance") == "")
|
||||
setDvar("bots_main_debug_distance", 512.0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user