yonilerner / cs2-retakes-allocator

Advanced weapon allocation for B3none/cs2-retakes
GNU General Public License v3.0
58 stars 16 forks source link

# CS2 Retakes Allocator

Build RetakesAllocator.zip

Retakes

This plugin is made to run alongside B3none's retakes implementation: https://github.com/b3none/cs2-retakes

Installation

Usage

Round Types

This plugin implements 3 different round types:

How these round types are chosen can be configured. See more in the "Configuration" section below.

Weapon Preferences

There are a few different ways to set weapon preferences:

See more info below about the commands in the "Commands" section.

AWP Queue

Currently one AWPer will be selected per team as long as at least one person on the team has chosen to get an AWP. AWP queue features will be expanded over time, you can take a look at existing Github Issues to see what has been proposed so far.

Buy Menu

If the convars are set to give players money and let them buy, player weapon choices can be selected via the buy menu. The buy menu will look like it allows you to buy any weapon, but it will only let you have weapons that are appropriate for the current round type.

The convars can be tweaked to customize the experience. For example, if you dont want to allow people to use the buy menu the entire round, you can tweak the mp_buytime variable as you see fit.

Configuration

The config file is located in the plugin folder under config/config.json.

Round Type Configuration

Weapon Configuration

For any of the weapon configs, the valid weapon names come from here. For example in

        [EnumMember(Value = "item_kevlar")]
        Kevlar = 000,

Kevlar is the name of the weapon, not item_kevlar. In

[EnumMember(Value = "weapon_m4a1_silencer")]
M4A1S = 401,
SilencedM4 = M4A1S,

both M4A1S and SilencedM4 are valid weapon names, but weapon_m4a1_silencer is not.

Here are the weapon configs:

Nade Configuration

{
  "MaxNades": {
    "GLOBAL": {
      "Terrorist": {
        "Flashbang": 2,
        "Smoke": 1,
        "Molotov": 1,
        "HighExplosive": 1
      },
      "CounterTerrorist": {
        "Flashbang": 2,
        "Smoke": 1,
        "Molotov": 2,
        "HighExplosive": 1
      }
    }
  }
}

but you specifically want to allow 2 smokes for CT on mirage, you can do:

{
  "MaxNades": {
    "GLOBAL": {
      "Terrorist": {
        "Flashbang": 2,
        "Smoke": 1,
        "Molotov": 1,
        "HighExplosive": 1
      },
      "CounterTerrorist": {
        "Flashbang": 2,
        "Smoke": 1,
        "Incendiary": 2,
        "HighExplosive": 1
      }
    },
    "de_mirage": {
      "CounterTerrorist": {
        "Smoke": 2
      }
    }
  }
}

This will keep the defaults the same for everything but override just CT smokes on mirage.

The valid keys for nades on Terrorist are:

The valid keys for nades on CounterTerrorist are:

If you mix up Incendiary and Molotov, the plugin will fix it for you.

NOTE: There is a bug right now where the plugin will not always give the maximum number of nades, even if players have room for it.

Other Configuration

Commands

You can use the following commands to select specific weapon preferences per-user:

Building

To automatically copy the built DLL to your running server location, set the build variable CopyPath to the folder where the mod should be copied to. This only works on Windows.

Notes: