From 41648436d730b6d67c52e9b369da63dcb6a4cf8d Mon Sep 17 00:00:00 2001 From: INeedBots Date: Thu, 11 Mar 2021 01:56:20 -0600 Subject: [PATCH] sniper --- userraw/scripts/bots_pvb.gsc | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/userraw/scripts/bots_pvb.gsc b/userraw/scripts/bots_pvb.gsc index 2f4232e..698d34d 100644 --- a/userraw/scripts/bots_pvb.gsc +++ b/userraw/scripts/bots_pvb.gsc @@ -20,6 +20,42 @@ init() level thread watchBoxmap(); level thread watchNuke(); + + level thread watchSniper(); +} + +watchSniper() +{ + for (;;) + { + numPlayers = 0; + numSnipers = 0; + + foreach(player in level.players) + { + if (player is_bot()) + continue; + + if (!isDefined(player.team)) + continue; + + numPlayers++; + + if (isDefined(player.isSniper) && player.isSniper) + numSnipers++; + } + + if (numPlayers > 0) + { + if (numSnipers / numPlayers >= 0.5) + setDvar("bots_sniperLoadout", 1); + else + setDvar("bots_sniperLoadout", 0); + } + + + wait 30; + } } watchNuke()