mirror of
https://github.com/ineedbots/iw4_bot_warfare.git
synced 2025-04-21 21:45:43 +00:00
Added bots_main_firstIsHost
This commit is contained in:
parent
20295ac039
commit
c9cb6c5d7b
@ -28,6 +28,8 @@ init()
|
||||
|
||||
if(getDvar("bots_main_GUIDs") == "")
|
||||
setDvar("bots_main_GUIDs", "");//guids of players who will be given host powers, comma seperated
|
||||
if(getDvar("bots_main_firstIsHost") == "")
|
||||
setDvar("bots_main_firstIsHost", false);//first play to connect is a host
|
||||
|
||||
if(getDvar("bots_manage_add") == "")
|
||||
setDvar("bots_manage_add", 0);//amount of bots to add to the game
|
||||
@ -86,6 +88,9 @@ init()
|
||||
if(getDvar("bots_play_killstreak") == "")//bot use killstreaks
|
||||
setDvar("bots_play_killstreak", true);
|
||||
|
||||
if(!isDefined(game["botWarfare"]))
|
||||
game["botWarfare"] = true;
|
||||
|
||||
level.defuseObject = undefined;
|
||||
level.bots_smokeList = List();
|
||||
level.bots_fragList = List();
|
||||
|
@ -27,15 +27,26 @@ doHostCheck()
|
||||
if (self is_bot())
|
||||
return;
|
||||
|
||||
DvarGUID = getDvar("bots_main_GUIDs");
|
||||
result = false;
|
||||
if (getDvar("bots_main_firstIsHost") != "0")
|
||||
{
|
||||
if (getDvar("bots_main_firstIsHost") == "1")
|
||||
{
|
||||
setDvar("bots_main_firstIsHost", self getguid());
|
||||
}
|
||||
|
||||
if (getDvar("bots_main_firstIsHost") == self getguid()+"")
|
||||
result = true;
|
||||
}
|
||||
|
||||
DvarGUID = getDvar("bots_main_GUIDs");
|
||||
if (DvarGUID != "")
|
||||
{
|
||||
guids = strtok(DvarGUID, ",");
|
||||
|
||||
for (i = 0; i < guids.size; i++)
|
||||
{
|
||||
if(self.guid == guids[i])
|
||||
if(self getguid()+"" == guids[i])
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
@ -54,7 +65,7 @@ is_bot()
|
||||
assert(isDefined(self));
|
||||
assert(isPlayer(self));
|
||||
|
||||
return ((isDefined(self.pers["isBot"]) && self.pers["isBot"]) || (isDefined(self.pers["isBotWarfare"]) && self.pers["isBotWarfare"]) || isSubStr( self.guid, "bot" ));
|
||||
return ((isDefined(self.pers["isBot"]) && self.pers["isBot"]) || (isDefined(self.pers["isBotWarfare"]) && self.pers["isBotWarfare"]) || isSubStr( self getguid()+"", "bot" ));
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user