Closed mavproductions closed 5 months ago
Hey @mavproductions, thank you for pointing this out. I was trying to recover some lost changes and ended up having to merge and purge all other branches, which resulted in an incomplete build. I will be making a commit right after this post with some final touches.
Once again, these changes haven't been tested yet on my server, but they compile and I will be doing some testing tomorrow and then making a release if all goes well. However, keep a lookout for these changes in the new build:
Niiice this all looks really interesting. Love how you made gamemode alias votes native to the plugin. If a single player is in the server, and types !awp for example, will it skip the vote and just run it?
Yeah, I believe so. I adapted the same configuration that @kus used in his JSON, as it's coincidentally an integration of the same plugin, but through shared libraries. So for this reason, I am hoping the behavior is identical.
Great work @nickj609, that was going to be my one question that @mavproductions asked, based on the above Votes no longer succeed when only 1 person votes
. If it is only 1 person in the server, it would be good if it did change.
@kus, that makes complete sense! I must have gotten my wires crossed because now that I am reviewing the changes it looks like I had a 51% requirement and changing it to 50% was what I believe I had to change when reviewing your configuration.
51% should still work if it is only 1 player as if they vote it's 100% of players voted yes?
@kus , you are correct. The confusion stems from my end. The way you reference that value using the shared library is slightly different from the JSON. In the snippet below, I originally had 51 where the -1 value is. However, the example provided by the plugin owner uses a value of -1 to represent 50%.
Plugin.CustomVotesApi.Get()?.AddCustomVote(
"gamemode", // Command to trigger the vote
new List<string> {"gm", "changemode", "changegame"}, // aliases for the command (optional)
"Vote to change game mode.", // Description
"No",
30, // Time to vote
_modeOptions,
"center", // Menu style - "center" or "chat"
-1 // Minimum percentage of votes required (-1 behaves like 50%)
);
I am not quite sure what 51 represented percentage-wise without doing a deeper dive, but I have a strong feeling it will fix it and if not I will investigate further.
@nickj609 in his code he has if (Vote.MinVotePercentage < 0 || winningOption.Value.Count >= totalVotes * Vote.MinVotePercentage / 100)
So -1
will make the vote change no matter what.
So you should be able to use 51
to make it change if 51% of people vote for it. He uses 50
in his example https://github.com/imi-tat0r/CS2-CustomVotes/blob/master/CS2-CustomVotes/PluginConfig.cs#L37
Hey Nick!
Don't mean to bother you as I imagine you're still busy and enjoying the season. Hope you've been well.
I'm having issues building your recent commit. Getting a lot of gameloop and vproperty errors.
I tried building as is and using "Microsoft.NET.UpgradeAssistant" to go to .net V8 and had no luck.
Any pointers?
As always I appreciate the work you've done so far with this repo. Really works nice 🙂🙂