mirror of
https://github.com/ineedbots/iw3_bot_warfare.git
synced 2025-04-22 10:15:44 +00:00
host func
This commit is contained in:
parent
b94d247135
commit
1cf3e43a78
@ -10,6 +10,12 @@ init()
|
|||||||
{
|
{
|
||||||
level.bw_VERSION = "1.0.0";
|
level.bw_VERSION = "1.0.0";
|
||||||
|
|
||||||
|
if(getDvar("bots_main") == "")
|
||||||
|
setDvar("bots_main", true);
|
||||||
|
|
||||||
|
if (!getDvarInt("bots_main"))
|
||||||
|
return;
|
||||||
|
|
||||||
thread load_waypoints();
|
thread load_waypoints();
|
||||||
cac_init_patch();
|
cac_init_patch();
|
||||||
thread hook_callbacks();
|
thread hook_callbacks();
|
||||||
@ -278,6 +284,9 @@ connected()
|
|||||||
{
|
{
|
||||||
self endon("disconnect");
|
self endon("disconnect");
|
||||||
|
|
||||||
|
if (!isDefined(self.pers["bot_host"]))
|
||||||
|
self thread doHostCheck();
|
||||||
|
|
||||||
if(!self is_bot())
|
if(!self is_bot())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -297,6 +306,8 @@ connected()
|
|||||||
|
|
||||||
self thread maps\mp\bots\_bot_internal::connected();
|
self thread maps\mp\bots\_bot_internal::connected();
|
||||||
self thread maps\mp\bots\_bot_script::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\_utility;
|
||||||
#include maps\mp\gametypes\_hud_util;
|
#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.
|
Returns if the player is a bot.
|
||||||
*/
|
*/
|
||||||
|
@ -4,6 +4,12 @@
|
|||||||
|
|
||||||
init()
|
init()
|
||||||
{
|
{
|
||||||
|
if(getDvar("bots_main_debug") == "")
|
||||||
|
setDvar("bots_main_debug", 0);
|
||||||
|
|
||||||
|
if(!getDVarint("bots_main_debug"))
|
||||||
|
return;
|
||||||
|
|
||||||
if(!getDVarint("developer"))
|
if(!getDVarint("developer"))
|
||||||
{
|
{
|
||||||
setdvar("developer_script", 1);
|
setdvar("developer_script", 1);
|
||||||
@ -13,6 +19,14 @@ init()
|
|||||||
exitLevel(false);
|
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") == "")
|
if (getDvar("bots_main_debug_distance") == "")
|
||||||
setDvar("bots_main_debug_distance", 512.0);
|
setDvar("bots_main_debug_distance", 512.0);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user