imi-tat0r / CS2-CustomVotes

A plugin for Counter-Strike 2 to create custom votes for settings.
MIT License
15 stars 4 forks source link

[Feature Request] Start Vote API Handler #7

Closed nickj609 closed 1 month ago

nickj609 commented 2 months ago

Hey there! I have a fork of your repository and was experimenting with the ability to create my own menus that will then trigger CS2-CustomVotes created via the Shared API. By adding the StartVote method to the Shared API I was able to accomplish this and thought it may be a good addition to your repository upon your approval.

For some context, I am currently using this in my GameModeManager plugin in an unofficial release. I generate a list of maps and game modes that I then create custom votes for. I have a command !game that all players can use to see a menu of player commands, many of which are commands generated by creating the custom votes via the Shared API. When users are presented with these menus they can enter the number !1 to select the option.

Before this implementation, it would respond with Say !<vote name> to start a vote. Now, as expected, it will trigger the vote.

imi-tat0r commented 1 month ago

Also, if you know how (or want to learn), I would appreciate if you could squash your recent commits because right now we have 6 commits for effectively 2 changes.