YappersHQ.WeaponMenu.Shared 1.0.1

dotnet add package YappersHQ.WeaponMenu.Shared --version 1.0.1
                    
NuGet\Install-Package YappersHQ.WeaponMenu.Shared -Version 1.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="YappersHQ.WeaponMenu.Shared" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="YappersHQ.WeaponMenu.Shared" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="YappersHQ.WeaponMenu.Shared" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add YappersHQ.WeaponMenu.Shared --version 1.0.1
                    
#r "nuget: YappersHQ.WeaponMenu.Shared, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package YappersHQ.WeaponMenu.Shared@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=YappersHQ.WeaponMenu.Shared&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=YappersHQ.WeaponMenu.Shared&version=1.0.1
                    
Install as a Cake Tool

<div align="center"> <h1><strong>WeaponMenu</strong></h1> <p>Let players pick their primary/secondary loadout from a menu (or chat command) each round — for CS2 servers running ModSharp.</p> </div>

<p align="center"> <a href="https://github.com/Kxnrl/modsharp-public"><img src="https://img.shields.io/badge/framework-ModSharp-5865F2?logo=github" alt="ModSharp"></a> <img src="https://img.shields.io/badge/game-CS2-orange" alt="CS2"> <img src="https://img.shields.io/gitlab/stars/cs2-server-plugins/cs2-weaponmenu?gitlab_url=https%3A%2F%2Fgitlab.com" alt="Stars"> </p>


WeaponMenu gives players a !guns menu to choose a weapon, optionally exposes one chat/console command per weapon (!ak47, !awp, …), remembers the last choice and auto-gives it on spawn, and gates everything behind a configurable starting round and per-round budget. It is a ModSharp port of asapverneri/CS2-Gunsmenu.

🚀 Install

Copy the build output into your ModSharp install (<sharp> = your sharp directory):

From To
.build/modules/WeaponMenu.Core/ <sharp>/modules/WeaponMenu.Core/
.build/shared/WeaponMenu.Shared/ <sharp>/shared/WeaponMenu.Shared/
.assets/configs/weaponmenu.json <sharp>/configs/weaponmenu.json
.assets/locales/weaponmenu.json <sharp>/locales/weaponmenu.json

Restart the server (or change map) to load. Requires the ModSharp MenuManager, LocalizerManager, AdminManager, and ClientPreferences modules.

⌨️ Commands

All commands work from both chat (!guns) and console (guns).

Command Description
guns Open the full weapon menu (primary + secondary)
primary Open the primary-weapons menu
secondary Open the secondary-weapons menu
<weapon> Directly give a weapon, e.g. ak47, awp, deagle — one command per supported weapon (only when weaponCommands is enabled)

Commands are blocked unless the player is alive, has the configured permission (if set), and the live round is at least minRound.

⚙️ Configuration

configs/weaponmenu.json:

Setting Default Meaning
enabled true Master switch for the plugin
minRound 3 First live round the menu/commands become usable
countWarmup false Whether warmup rounds count toward minRound
permission "" AdminManager permission required to use the menu (empty = everyone)
weaponCommands true Register a per-weapon chat/console command for each weapon
blacklist ["NEGEV"] Weapon keys hidden from the menu and commands
rememberLastChoice true Save the last primary/secondary pick and auto-give it on spawn
maxPerRound 1 Max weapons a player may take per round (0 or less = unlimited)

🔧 How it works

Commands are installed through ModSharp's client-command system, so each one responds to both chat and console. Picking a weapon from the menu (or via a direct command) calls a weapon giver and, when rememberLastChoice is on, stores the choice in ClientPreferences cookies. On spawn the auto-give module reads those cookies and re-equips the saved loadout. A round tracker counts live rounds (optionally including warmup) so the minRound gate and per-round budget reset correctly across round transitions.

🧩 Public API

Other plugins can veto access per client by subscribing to IWeaponMenuShared (resolve in OnAllModulesLoaded):

var api = sharpModuleManager
    .GetOptionalSharpModuleInterface<IWeaponMenuShared>(IWeaponMenuShared.Identity)?.Instance;

// Return false to block a client from using the menu/commands.
api.CanUseFor += client => client.Team == CStrikeTeam.CT;

📦 Build

dotnet build -c Release

Outputs .build/modules/WeaponMenu.Core/WeaponMenu.Core.dll and .build/shared/WeaponMenu.Shared/WeaponMenu.Shared.dll.

🙏 Credits

Port of asapverneri/CS2-Gunsmenu.


<div align="center"> <p>Made with ❤️ by <a href="https://gitlab.com/cs2-server-plugins">yappershq</a></p> <p>⭐ Star this repo if you find it useful!</p> </div>

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 101 8/10/2026
1.0.0 117 8/1/2026