Caution
This plug-in is not finished an may not be suitable and production-ready. It works well enough but may change in future. Other plug-ins which depend on it (like my knife-fight or native-mapvote plug-in may break in future without updating them, too).
Tip
This plug-in does nothing on it's own. You either need to develop your own plug-in or use a third-party plug-in to make use of this :)
The Panorama Vote Manager allows plugins to interact with the CS2 Panorama Vote UI to start votes (the ones on the left side where the player can press F1 to agree or F2 to disagree). Plugins can request votes for specific users or all users. Votes for all users block other votes and can have an optional cooldown. After the cooldown, plugins can request votes again. The plugin provides an easy API for initiating votes and checking if they were successful. Votes can also be withdrawn if needed.
What is special about this implementation? This plug-in was created because I had the need to create votings in my plug-ins and wanted to make sure only ONE vote is active during any given time. Therefore this plug-in allows other developers to initialize votes and this plug-in queues the vote in case another vote is already running. It also returns the estimated time until the vote will start (so a plug-in developer could check if this meets the requirements and wait or dismiss the vote entirely).
This plug-in also allows to show votes only to specific players. This is primarily good for knife-fight plug-ins like mine.
- Download and extract the latest release from the GitHub releases page.
- Stop the server.
- Move the "PanoramaVoteManager" folder to the
/addons/counterstrikesharp/plugins/directory. - Move the "PanoramaVoteManagerAPI" folder to the
/addons/counterstrikesharp/shared/directory. - Restart the server.
To be able to use custom vote text your clients (and your server) need the platform_english.txt inside the csgo/resource folder. An example is provided via this repository. Otherwise the vote will NOT show up when using custom text. You can still use the default vote strings inside your plugins, though. Easiest way is to distribute this via a WorkShop AddOn.
This plugin automatically creates a readable JSON configuration file. This configuration file can be found in /addons/counterstrikesharp/configs/plugins/PanoramaVoteManager/PanoramaVoteManager.json.
{
"enabled": true,
"debug": false,
"cooldown": 5,
"server_enable_voting": true,
"server_disable_vote_options": true,
"ConfigVersion": 1
}Whether or not the plug-in is enabled.
Cooldown in seconds after one vote was finished and before the next vote starts. Should be 5+ seconds to allow the voting window to close properly.
Whether or not after map start this plug-in should automatically execute the necessary server-side commands to allow voting.
Whether or not all native cs2 votings should be disabled (only effective if server_enable_voting is enabled). This will execute all necessary server commands to disable the other native votings. Hint: if you disable this you can use the cs2 voting options like kick, ban, map change etc. but: this plug-in cannot see whether or not a native vote is currently running and this will create conflicts! You should know what you do if you disable this!
Reloads the configuration.
Tests the panorama vote manager functionality. Will spawn a new vote.
Clone the project:
git clone https://github.com/Kandru/cs2-panorama-vote-manager.gitGo to the project directory
cd cs2-panorama-vote-managerInstall dependencies
dotnet restoreBuild debug files (to use on a development game server)
dotnet buildBuild release files (to use on a production game server)
dotnet publishTODO
