CS2MenuManager is a flexible and user-friendly menu system developed for Counter-Strike 2 using the CounterStrikeSharp library. This project provides server administrators and developers with the ability to create customisable menus. It is easy to use for players and easy to configure and extend for administrators.
If you would like to donate or need assistance with the plugin, feel free to contact me via Discord, either privately or on my server.
Discord nickname: schwarper
Discord link : Discord server
- Download:
- Download the latest release from GitHub Releases or Nuget.
- Install the files:
- Extract the contents of the downloaded ZIP file to the
addons/counterstrikesharp/sharedfolder.
- Configure the settings:
- Adjust the settings in the
config.tomlfile in theaddons/counterstrikesharp/shared/CS2MenuManager/directory.
- Restart server:
- Restart your server for the changes to take effect. You will need to use this API in your plugins.
You can create any type of menu. All menu types have a similar structure. Here's an example of how to create a Chat Menu:
Supported menus: ChatMenu, ConsoleMenu, CenterHtmlMenu, WasdMenu, ScreenMenu, PanoramaVote
ChatMenu menu = new("Title", this);
menu.AddItem("Option 1", (p, o) =>
{
p.PrintToChat("You selected option 1");
});
menu.AddItem("Option 2X", DisableOption.DisableShowNumber);
menu.AddItem("Option 3X", DisableOption.DisableHideNumber);
menu.Display(player);You can add submenus to any menu. Here's how to link a submenu:
menu.PrevMenu = AnySubMenu();
private static CenterHtmlMenu AnySubMenu()
{
CenterHtmlMenu menu = new("Title", this);
//...
return menu;
}You can set the behavior after selecting an option using PostSelectAction. The default is to close the menu after selection.
menu.AddItem("Option After Reset", (p, o) =>
{
o.PostSelectAction = PostSelectAction.Reset;
});You can set the time for the menu. When the time is up, the menu is automatically closed.
menu.Display(menu, 10);
// OR
ConsoleMenu menu = new("Console Menu", this)
{
MenuTime = 20
};The PanoramaVote menu allows you to create interactive vote menus using the Panorama UI. Here's an example:
var menu = new PanoramaVote("#SFUI_vote_panorama_vote_default", "Hold on, Let me Cook", VoteResultCallback, VoteHandlerCallback, this)
{
VoteCaller = player // null is the server.
};
menu.DisplayVoteToAll(20);public bool VoteResultCallback(YesNoVoteInfo info)
{
/*
public int TotalVotes;
public int YesVotes;
public int NoVotes;
public int TotalClients;
public Dictionary<int, (int, int)> ClientInfo = [];
*/
if (info.YesVotes > info.NoVotes)
{
Server.PrintToChatAll("Vote passed!");
return true;
}
Server.PrintToChatAll("Vote failed!");
return false;
}
public void VoteHandlerCallback(YesNoVoteAction action, int param1, CastVote param2)
{
switch (action)
{
case YesNoVoteAction.VoteAction_Start:
Server.PrintToChatAll("Vote started!");
break;
case YesNoVoteAction.VoteAction_Vote:
var player = Utilities.GetPlayerFromSlot(param1);
if (player == null) return;
player.PrintToChat("You voted: " + (param2 == CastVote.VOTE_OPTION1 ? "Yes" : "No"));
break;
case YesNoVoteAction.VoteAction_End:
switch ((YesNoVoteEndReason)param1)
{
case YesNoVoteEndReason.VoteEnd_Cancelled:
Server.PrintToChatAll("Vote Ended! Cancelled");
break;
case YesNoVoteEndReason.VoteEnd_AllVotes:
Server.PrintToChatAll("Vote Ended! Thank you for participating.");
break;
case YesNoVoteEndReason.VoteEnd_TimeUp:
Server.PrintToChatAll("Vote Ended! Time is up.");
break;
}
break;
}
}ChatMenu,ConsoleMenu,CenterHtmlMenu=> CounterStrikeSharp by roflmuffinWasdMenu=> WasdMenuAPI by Interesting-exeScreenMenu=> CS2ScreenMenuAPI by T3MariusPanoramaVote=> SLAYER_PanoramaVote by zakriamansoor47





