From 14d92e01bde2b7aeed43d03108d6caec6c72e1fe Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 20 Aug 2020 16:32:03 -0600 Subject: [PATCH] limit op --- userraw/maps/mp/bots/_bot_script.gsc | 31 ++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/userraw/maps/mp/bots/_bot_script.gsc b/userraw/maps/mp/bots/_bot_script.gsc index ecc81d4..53132d0 100644 --- a/userraw/maps/mp/bots/_bot_script.gsc +++ b/userraw/maps/mp/bots/_bot_script.gsc @@ -279,11 +279,21 @@ chooseRandomPerk(perkkind) { perks = getPerks(perkkind); rank = self maps\mp\gametypes\_rank::getRankForXp( self getPlayerData("experience") ); + allowOp = (getDvarInt("bots_loadout_allow_op") >= 1); while (true) { perk = random(perks); + if (!allowOp) + { + if (perkkind == "perk4") + return "specialty_null"; + + if (perk == "specialty_pistoldeath") + continue; + } + if (perk == "specialty_null") continue; @@ -315,11 +325,18 @@ chooseRandomCamo() chooseRandomPrimary() { primaries = getPrimaries(); + allowOp = (getDvarInt("bots_loadout_allow_op") >= 1); while (true) { primary = random(primaries); + if (!allowOp) + { + if (primary == "riotshield") + continue; + } + if (!self isItemUnlocked(primary)) continue; @@ -333,11 +350,18 @@ chooseRandomSecondary(perk1) return "onemanarmy"; secondaries = getSecondaries(); + allowOp = (getDvarInt("bots_loadout_allow_op") >= 1); while (true) { secondary = random(secondaries); + if (!allowOp) + { + if (secondary == "at4" || secondary == "rpg" || secondary == "m79") + continue; + } + if (!self isItemUnlocked(secondary)) continue; @@ -351,6 +375,7 @@ chooseRandomSecondary(perk1) chooseRandomAttachmentComboForGun(gun) { atts = getAttachmentsForGun(gun); + allowOp = (getDvarInt("bots_loadout_allow_op") >= 1); while (true) { @@ -360,6 +385,12 @@ chooseRandomAttachmentComboForGun(gun) if (!isValidAttachmentCombo(att1, att2)) continue; + if (!allowOp) + { + if (att1 == "gl" || att2 == "gl") + continue; + } + retAtts = []; retAtts[0] = att1; retAtts[1] = att2;