From b1579c0b3eea563eaf9aaa31a53a4f1a5f076292 Mon Sep 17 00:00:00 2001 From: INeedBots Date: Sun, 13 Dec 2020 16:47:52 -0600 Subject: [PATCH] Added ads dvar --- README.md | 1 + userraw/maps/mp/bots/_bot.gsc | 2 ++ userraw/maps/mp/bots/_bot_internal.gsc | 3 +++ userraw/maps/mp/bots/_menu.gsc | 11 +++++++++++ 4 files changed, 17 insertions(+) diff --git a/README.md b/README.md index b8cbcf7..18c2e7c 100644 --- a/README.md +++ b/README.md @@ -136,6 +136,7 @@ You can find the ModDB release post [here](https://www.moddb.com/mods/bot-warfar - bots_play_jumpdrop - a boolean value (0 or 1), whether or not if the bots will jump shot or drop shot - bots_play_target_other - a boolean value (0 or 1), whether or not if the bots will target claymores, killstreaks, etc. - bots_play_killstreak - a boolean value (0 or 1), whether or not if the bots will use killstreaks +- bots_play_ads - a boolean value (0 or 1), whether or not if the bots will ads --- diff --git a/userraw/maps/mp/bots/_bot.gsc b/userraw/maps/mp/bots/_bot.gsc index 1f14e47..123ec5d 100644 --- a/userraw/maps/mp/bots/_bot.gsc +++ b/userraw/maps/mp/bots/_bot.gsc @@ -87,6 +87,8 @@ init() setDvar("bots_play_target_other", true); if(getDvar("bots_play_killstreak") == "")//bot use killstreaks setDvar("bots_play_killstreak", true); + if(getDvar("bots_play_ads") == "")//bot ads + setDvar("bots_play_ads", true); if(!isDefined(game["botWarfare"])) game["botWarfare"] = true; diff --git a/userraw/maps/mp/bots/_bot_internal.gsc b/userraw/maps/mp/bots/_bot_internal.gsc index 3117229..a60fd6f 100644 --- a/userraw/maps/mp/bots/_bot_internal.gsc +++ b/userraw/maps/mp/bots/_bot_internal.gsc @@ -1350,6 +1350,9 @@ canAds(dist, curweap) if(curweap == "none") return false; + if (!getDvarInt("bots_play_ads")) + return false; + far = level.bots_noADSDistance; if(self _hasPerk("specialty_bulletaccuracy")) far *= 1.4; diff --git a/userraw/maps/mp/bots/_menu.gsc b/userraw/maps/mp/bots/_menu.gsc index bd8a91e..4303f8a 100644 --- a/userraw/maps/mp/bots/_menu.gsc +++ b/userraw/maps/mp/bots/_menu.gsc @@ -773,6 +773,13 @@ AddOptions() else _temp = "false"; self AddMenu("set1", 11, "Bots can use killstreaks: "+_temp, ::bot_func, "killstreak", _tempDvar); + + _tempDvar = getDvarInt("bots_play_ads"); + if(_tempDvar) + _temp = "true"; + else + _temp = "false"; + self AddMenu("set1", 12, "Bots can ads: "+_temp, ::bot_func, "ads", _tempDvar); } bot_func(a, b) @@ -827,6 +834,10 @@ bot_func(a, b) setDvar("bots_play_killstreak", !b); self iPrintln("Bots use killstreaks: " + !b); break; + case "ads": + setDvar("bots_play_ads", !b); + self iPrintln("Bots ads: " + !b); + break; } }