Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
f6aaeeb
Update RetakesAllocator.cs
Micka2302 Apr 1, 2025
4bb7783
Update AdvancedGunMenu.cs
Micka2302 Apr 1, 2025
faca5bc
Merge branch 'yonilerner:main' into main
Micka2302 Sep 19, 2025
01c1da1
Treat SSG08 as preferred weapon
Micka2302 Sep 19, 2025
a680303
Merge pull request #1 from Micka2302/codex/update-weapon-allocation-f…
Micka2302 Sep 19, 2025
ce49905
Merge pull request #3 from Micka2302/dev
Micka2302 Sep 19, 2025
8850aaf
Rename preferred weapon configuration to AWP
Micka2302 Sep 19, 2025
f770043
Merge pull request #5 from Micka2302/codex/rename-preferredweapon-to-…
Micka2302 Sep 19, 2025
901db5e
Merge pull request #6 from Micka2302/dev2
Micka2302 Sep 19, 2025
0f10864
Add SSG queue configuration and tests
Micka2302 Sep 19, 2025
b9838d0
Merge pull request #7 from Micka2302/codex/enhance-ssg-weapon-support…
Micka2302 Sep 19, 2025
2826d8a
Merge pull request #8 from Micka2302/dev-ssg08
Micka2302 Sep 19, 2025
439a27c
Update README.md
Micka2302 Sep 20, 2025
5a94ca0
Add EnableAllWeaponForEveryone option
Micka2302 Sep 27, 2025
2532dcd
Merge pull request #11 from Micka2302/dev
Micka2302 Sep 27, 2025
819a1a0
!guns menu rework
Micka2302 Sep 27, 2025
1855b91
Rework with Kitsune menu
Micka2302 Sep 27, 2025
662eabc
Update en.json
Micka2302 Sep 27, 2025
ce50dde
Update menu for vip player
Micka2302 Sep 27, 2025
7b7b929
Add Random option for Sniper Preference
Micka2302 Sep 30, 2025
831d889
Add !zeus command like !awp or !ssg
Micka2302 Sep 30, 2025
0b79426
Merge pull request #12 from Micka2302/dev
Micka2302 Sep 30, 2025
fbeac6c
Fix random give 2 awp on same team
Micka2302 Oct 11, 2025
a72f14b
Feat : Add EnemyStuff
Micka2302 Oct 11, 2025
0f38418
update
Micka2302 Oct 11, 2025
6968b29
Merge pull request #13 from Micka2302/dev
Micka2302 Oct 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": 1,
"isRoot": true,
"tools": {
"dotnet-ef": {
"version": "9.0.9",
"commands": [
"dotnet-ef"
],
"rollForward": false
}
}
}
45 changes: 33 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# CS2 Retakes Allocator
# CS2 Retakes Allocator

[![Build RetakesAllocator.zip](https://github.com/yonilerner/cs2-retakes-allocator/actions/workflows/build.yml/badge.svg)](https://github.com/yonilerner/cs2-retakes-allocator/actions/workflows/build.yml)

Expand Down Expand Up @@ -69,17 +69,23 @@ There are a few different ways to set weapon preferences:

- Built-in buy menu (See "Buy Menu" section for more info on how to set that up)
- `!gun <gun>` - Set a preference for a particular gun (will automatically figure out the round type)
- `!awp` - Toggles if you want an AWP or not.
- `!awp` - Toggles if you want an AWP or not. (Fullbuy Rounds)
- `!ssg` - Toggle if you want SSG or not (Fullbuy Rounds)
- `!zeus` - Toggle whether you will receive a Zeus each round.
- `!guns` - Opens a chat-based menu for 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.

#### SSG Queue

Players who prefer the SSG (Scout) can also enter a dedicated queue. On full buy rounds the plugin will independently
roll for SSG availability, apply the SSG-specific limits and then merge the resulting list with any AWP picks before
weapons are allocated. See the configuration section below for the options that control the SSG queue.

### 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.
Expand Down Expand Up @@ -169,12 +175,21 @@ Here are the weapon configs:
```


- `ZeusPreference`: Whether or not to give a Zeus. Options are `Always` or `Never`. Defaults to `Never`.
- `AllowPreferredWeaponForEveryone`: If `true`, everyone can get the AWP. This overrides every other "preferred" weapon
- `EnableZeusPreference`: Enables the Zeus toggle in the Kitsune loadout menu. When disabled, no one receives a Zeus and the menu entry is hidden. Defaults to `false`.
- `EnableEnemyStuffPreference`: Enables the enemy weapon toggle in the Kitsune loadout menu for players holding the configured permission flag. Defaults to `false`.
- `EnemyStuffPermission`: Permission flag required to see and toggle enemy weapons when the feature is enabled. Defaults to `@css/vip`.
- `EnableAllWeaponsForEveryone`: When `true`, Counter-Terrorists and Terrorists can equip each other's primary and secondary weapons while VIP-restricted weapons keep their existing limits. Defaults to `false`.
- `AllowAwpWeaponForEveryone`: If `true`, everyone can get the AWP. This overrides every other "preferred" weapon
setting. Defaults to `false`.
- `MaxPreferredWeaponsPerTeam`: The maximum number of AWPs for each team.
- `MinPlayersPerTeamForPreferredWeapon`: The minimum number of players on each team necessary for someone to get an AWP.
- `ChanceForPreferredWeapon`: The % chance that the round will have an AWP.
- `AllowSsgWeaponForEveryone`: If `true`, everyone with an SSG preference can receive one. Defaults to `false`.
- `MaxAwpWeaponsPerTeam`: The maximum number of AWPs for each team.
- `MaxSsgWeaponsPerTeam`: The maximum number of SSGs for each team.
- `MinPlayersPerTeamForAwpWeapon`: The minimum number of players on each team necessary for someone to get an AWP.
- `MinPlayersPerTeamForSsgWeapon`: The minimum number of players on each team necessary for someone to get an SSG.
- `ChanceForAwpWeapon`: The % chance that the round will have an AWP.
- `ChanceForSsgWeapon`: The % chance that the round will have an SSG.
- `ChanceForEnemyStuff`: The % chance that a player who has enabled enemy weapons will receive gear from the opposing team.
- `MaxEnemyStuffPerTeam`: Maximum number of players per team who can receive enemy weapons each round. Set to `-1` for no limit.

#### Nade Configuration

Expand Down Expand Up @@ -267,7 +282,7 @@ room for it*.
#### Other Configuration

- `EnableNextRoundTypeVoting`: Whether to allow voting for the next round type via `!nextround`. `false` by default.
- `NumberOfExtraVipChancesForPreferredWeapon`: When randomly selecting preferred weapons per team (ie. "AWP queue"), how
- `NumberOfExtraVipChancesForAwpWeapon`: When randomly selecting AWPs per team (ie. "AWP queue"), how
many extra chances should VIPs get.
- The default is 1, meaning VIPs will get 1 extra chance. For example, lets say
there are 3 players on the team and this config is set to 1. Normally each person would have a 33% chance of
Expand All @@ -277,7 +292,11 @@ room for it*.
the other two players will each have 25% chance of getting the AWP.
- If you set this to 0, there will be no preference for VIPs.
- If you set this to -1, only VIPs can get the AWP
- `ChanceForPreferredWeapon`: This allows you to determine chance of players getting preferred weapon. (ie. 100 = %100, 50 = %50)
- `ChanceForAwpWeapon`: This allows you to determine chance of players getting the AWP. (ie. 100 = %100, 50 = %50)
- `NumberOfExtraVipChancesForSsgWeapon`: When randomly selecting SSGs per team, how many extra chances VIPs get.
- The behaviour matches the AWP queue. `1` gives VIPs an extra entry, `0` removes the bonus and `-1` restricts SSGs
to VIPs.
- `ChanceForSsgWeapon`: This allows you to determine the chance of players getting the SSG. (ie. 100 = %100, 50 = %50)
- `AllowedWeaponSelectionTypes`: The types of weapon allocation that are allowed.
- Choices:
- `PlayerChoice` - Allow players to choose their preferences for the round type
Expand Down Expand Up @@ -339,6 +358,7 @@ You can use the following commands to select specific weapon preferences per-use
Galil
- `!guns` - Opens up a chat-based menu for setting weapon preferences.
- `!awp` - Toggle whether or not you want to get an AWP.
- `!zeus` - Toggle whether you will receive a Zeus each round.
- `!removegun <weapon> [T|CT]` - Remove a preference for the chosen weapon for the team you are currently on, or T/CT if
provided
- For example, if you previously did `!gun galil` while a terrorist, and you do `!removegun galil` while a
Expand All @@ -358,3 +378,4 @@ Notes:

- Run the dedicated server
with `start cs2.exe -dedicated -insecure +game_type 0 +game_mode 0 +map de_dust2 +servercfgfile server.cfg`

22 changes: 22 additions & 0 deletions RetakesAllocator/Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,28 @@ public static bool IsWindows()

public static bool IsVip(CCSPlayerController player) => AdminManager.PlayerHasPermissions(player, "@css/vip");

public static bool PlayerHasPermission(CCSPlayerController player, string? permission)
{
if (string.IsNullOrWhiteSpace(permission))
{
return false;
}

return AdminManager.PlayerHasPermissions(player, permission) ||
AdminManager.PlayerHasPermissions(player, "@css/root");
}

public static bool HasEnemyStuffPermission(CCSPlayerController player)
{
var permission = Configs.GetConfigData().EnemyStuffPermission;
if (string.IsNullOrWhiteSpace(permission))
{
return true;
}

return PlayerHasPermission(player, permission);
}

public static async Task<bool> DownloadMissingFiles()
{
if (!Configs.GetConfigData().AutoUpdateSignatures)
Expand Down
12 changes: 12 additions & 0 deletions RetakesAllocator/KitsuneMenu/Core/Enums/MenuTextSize.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace KitsuneMenu.Core.Enums;

public enum MenuTextSize
{
ExtraSmall, // fontSize-xs
Small, // fontSize-s
SmallMedium, // fontSize-sm
Medium, // fontSize-m
MediumLarge, // fontSize-ml
Large, // fontSize-l
ExtraLarge // fontSize-xl
}
Loading