Custom Votes v0.5.6 (1/07)
3 Attachment(s)
Custom Votes v0.5.6 (1/07)
Custom votes allows you to initiate votes defined in a configuration file, without requiring any additional plugin coding. Votes will execute server actions depending on the result. The intent is to easily allow other plugin authors to add custom votes just by dropping a config file in the customvotes configuration directory. What Custom Admin Menus (formerly dynamicmenu/Super Menu) does for menus, Custom Votes does for voting. Quick Install: Unzip customvotes.zip into your server root. Vote configurations are stored in configs/customvotes, and show up in the "Voting Commands" admin menu.Included Vote Configurations: Normal Votes:This is all you need to get started. For changes since the last version, see the change log at the bottom of this post. Continue reading for more comprehensive usage documentation.changelevel - Vote to change the map immediately.Chat Votes (replaces PlayersVotes, do not use both together without disabling these votes in configs/customvotes/playervotes.vote.cfg): Detailed Usage Documentation CVars: All cvars have sane defaults, and most admins will not need a separate configuration file for this plugin.Admin Commands:sm_cvote_version - Plugin version.Custom Votes also uses the value of sm_vote_delay (from basevotes) as a minimum delay between votes. sm_cvote <votename> <params>Console Commands:Initiates the named vote. If no name is specified, a menu of valid votes will be presented. Extra parameters can be passed from the console if the vote requires it (see "Parameters" below), but if omitted the player will be prompted for them via menus. This can also be launched from chat with "/cvote <votename> <params>".sm_cvote_reload sm_votemenuConfiguration:Displays a menu of votes the player is allowed to initiate. !votemenu in chat. Custom Votes loads every configuration file it finds in configs/customvotes. For example, if you wanted to add a gravity vote, you could add "gravity.vote.cfg" to addons/sourcemod/configs/customvotes/. The section name should be a unique name that is used to identify the vote. See the "Configuration Examples" section below for samples, or look at the included vote configurations in the attached customvotes.zip.Vote Types: onoff - Displays a simple "On" or "Off" vote, which returns the values "1" or "0" as the result parameter.Chat Triggers: If sm_cvote_triggers is on, you can specify chat keywords to launch a vote. Triggers are significantly different in 0.5 from 0.4, in that they have separate vote percent/vote count minimums from the vote itself. As a result if a "trigger" section exists, it ignores the "admin" parameter when deciding who can use the trigger in order to enable PlayersVotes-style chat voting. If you want your admins to directly launch votes from chat, they must now use the "/cvote <votename>" method. See the configuration examples section below. If a vote requires additional parameters, they can also be passed in chat (i.e. "votenextmap cp_badlands".)Parameters: Vote titles, vote commands, trigger notices, option keys and option values can all use parameter replacements. The actual vote result will always be the last parameter. Similar to Custom Admin Menus, parameters take the format #1, #2, #3, etc. (or @1, @2, @3 to display parameters unquoted.)Expressions: In addition to parameter replacement, Custom Votes has a handy expression replacement feature, which allows you to insert CVar values. Vote titles, vote commands, trigger notices, option keys and option values can all contain expressions.Configuration Examples: Vote parameters:Integration With Admin Menu:Chat Vote: Custom votes will automatically show up in the "Voting Commands" admin menu. Votes will prompt the user for any extra parameters they require. For sorting purposes (with adminmenu_sorting.txt), menus have the identifier of "cvote_<votename>", where <votename> is the section name defining the vote - so for example, for the first example in the Configuration Examples section above, the menu identifier would be "cvote_changelevel".Installing: customvotes.smx -> addons/sourcemod/plugins/Changelog: 0.1 - Initial releaseCredits: Developed by chundo. |
Re: Custom Votes v0.1 (6/2)
I want to make it for players on my server can call a vote to turn alltalk on and off, and also turn friendly fire on and off, when no admin is present... that way it's a democracy and the majority can get what they want for most people are happy, even when an admin is not on the server.
can I do that with this plugin, if so, how? I want it for when a player types vote_ff in the chat, it will call a vote to turn friendly fire on and off. Also vote_alltalk to turn alltalk on and off. Also I want to make it for a vote for each one can only be called once every 5 minutes. |
Re: Custom Votes v0.1 (6/2)
Yes, it's just a console command so anyone can run it - it does its own permission checking based on the "admin" attribute of the vote. If you omit that attribute, any user can initiate it.
For example, just setup an alltalk vote like in example2.vote.cfg but omit the "admin" attribute, and users will be able to launch it with "/cvote alltalk" in chat. I'm considering adding a chat alias option to the config as well that would allow you to launch votes with a simple chat keyword - "votealltalk", "voteff", etc. Right now I use the global vote delay (controlled by the sm_vote_delay CVar). I will look into adding a longer delay for user votes though. Do you mean one vote period per five minutes, or one vote of each TYPE per five minutes? |
Re: Custom Votes v0.1 (6/2)
Perfect.
Otto n00bsalad.net |
Re: Custom Votes v0.1 (6/2)
Quote:
Quote:
Maybe we could configure it for the delay is per type of vote in the config file, like alltalk vote could only be called every 5 minutes, friendly fire vote can only be called every 10 minutes, mapchange vote can only be called every 30 minutes, etc. |
Re: Custom Votes v0.1 (6/2)
I want that players write something in chat and trigger vote for something...
For example: DEATHMATCH... But when admins are not on server. I started with this but I dont know what they must write in chat to trigger this voting... Code:
"Votes" |
Re: Custom Votes v0.1 (6/2)
As chundo said, it's currently not yet possible to trigger a vote through chat. This will be added in 0.2 (as the first post says).
@chundo: awesome plugin, I was actually thinking of doing this myself but couldn't figure out what the best way would be to do it. I hope this will become part of the SM core so we can do away with the stock voting plugins, and can easily make custom votes too. Idea: make a timeleft option to run a vote x minutes before the map ends. Would make it possible to replace rtv :) |
Re: Custom Votes v0.1 (6/2)
bakaideda -
If you remove the "admin" parameter in the vote, it makes it so anyone can launch it. And although you can't specify a user-friendly chat keyword (yet), you can launch it from chat with the standard SourceMod method, i.e.: /cvote "DM VOTING" (Assuming the space in the name doesn't throw it off, haven't tested that.) Thanks DJ Tsunami. I've added the chat keywords (and a few other features) to the Todo list for v0.2, which will be out this week yet. Closer custom admin menu integration is planned for 0.3 (allowing cvote to prompt the user for required parameters via menus when none are given). |
Re: Custom Votes v0.2 (6/5)
Ok, chat triggers and vote delays are added in v0.2.
|
Re: Custom Votes v0.2 (6/5)
thx so much chundo you are our hero.
can anyone make me a sample cfg for votekick and voteban that anyone can call with exactly those keywords? i already made the voteff and votealltalk which is awesome but i cant figure how to get the votekick and voteban working, oh and votemap |
Re: Custom Votes v0.2 (6/5)
Quote:
These functions are built in to the plugin |
Re: Custom Votes v0.2 (6/5)
Quote:
Code:
"Votes" 1) The vote initiator must specify the target in the command (i.e. "voteban chundo"). v0.3 (almost done, hooray for days off) solves this by prompting for missing parameters via menus. 2) When passing a user as a parameter, I don't check for immunity (yet), so a regular user can start a voteban on an admin. This is mitigated in the above example by requiring an admin to approve the vote result. This will also be resolved in v0.3. Of course, if you have PlayersVotes installed, the above trigger (voteban) will conflict with it. With v0.3, I'll also include a "stock votes" configuration file, which so far includes: alltalk crits gravity setnextmap ban changelevel extend kick ban scrambleteams |
Re: Custom Votes v0.2 (6/5)
Quote:
|
Re: Custom Votes v0.3 (6/6)
Went quicker than I thought - 0.3 is out. With this release I think it pretty much has all the functionality needed to duplicate basevotes and funvotes voting behavior.
Here is a voteban example using 0.3: Code:
"Votes" |
Re: Custom Votes v0.3 (6/6)
should i use the .smx attached to post "get plugin", or the one in the .zip which is attached. They are different size.
thx |
Re: Custom Votes v0.3 (6/6)
It's probably because I'm compiling against a slightly different snapshot than the forum server - they're both based on the same source though. They should both work the same, but the best idea is probably always to compile it yourself against the SM version you're using.
|
Re: Custom Votes v0.4 (6/6)
v0.4 is released. Added automatic integration with admin "Voting Commands" menu.
I don't have any other features planned for this plugin, so if you have any suggestions or requests, let me know. And as always, let me know if you run across any bugs. |
Re: Custom Votes v0.4 (6/6)
hmm not working, i get this when i load plugin
L 06/09/2008 - 02:43:30: [SM] Plugin encountered error 4: Invalid parameter or parameter type L 06/09/2008 - 02:43:30: [SM] Native "LogError" reported: Language phrase "Configuration error" not found L 06/09/2008 - 02:43:30: [SM] Debug mode is not enabled for "customvotes.smx" L 06/09/2008 - 02:43:30: [SM] To enable debug mode, edit plugin_settings.cfg, or type: sm plugins debug 52 on L 06/09/2008 - 02:43:30: [customvotes.smx] Errors were encountered while loading configuration. The plugin may not work as expected. |
Re: Custom Votes v0.4 (6/6)
here my cfg file, it's called tfc.vote.cfg
Code:
"Votes" |
Re: Custom Votes v0.4 (6/6)
1 Attachment(s)
Your config file parses fine for me. I've made the parsing errors more descriptive in the attached version, try it and let me know what it says.
|
Re: Custom Votes v0.4 (6/6)
In my case one player triggers the vote... He chooses YES or NO and that's all... Then starts command from vote... I want that every player can vote...
|
Re: Custom Votes v0.4 (6/6)
Quote:
|
Re: Custom Votes v0.4 (6/6)
alright i got my problem working, i had to changed the encoding of the cfg file from UNICODE to ANSI
|
Re: Custom Votes v0.4 (6/6)
now I'm having the same problem that guy is having, the vote ends after only 1 vote, doesn't matter who votes, as soon as the vote gets 1 person vote, it takes effect to what ever they voted for
|
Re: Custom Votes v0.4 (6/6)
Does the vote show up to all users, or just the one voter? And is this just for confirm-type votes, or all votes?
|
Re: Custom Votes v0.4 (6/6)
Ha. I was being so clever using pretty menu panels to display vote results that I didn't remember to only display it to those who already voted - so when the panel showed up, the vote menu died, and the plugin viewed that as "no response" from all the other clients. :| I've confirmed this does not happen if you use sm_cvote_showstatus of anything but 1.
Will have a new version soon. Thanks for the report. |
Re: Custom Votes v0.4.1 (6/9)
Updated to 0.4.1. Let me know if this fixes the issue (in my limited testing it seems to.)
|
Re: Custom Votes v0.4.1 (6/9)
I'm pretty intersted with this plug in, but i was wondering if it was possible to do a vote scramble in the same way the votemap work (for example 10 people have to enter "scramble" in order to launch the vote scramble).
|
Re: Custom Votes v0.4.1 (6/9)
No, good idea though. It will go well with chat triggers, I'll add it.
|
Re: Custom Votes v0.4.1 (6/9)
sweet, thx
|
Re: Custom Votes v0.4.1 (6/9)
Actually, how would you see this working? After 10 (or 70%, or whatever) people type "scramble" the vote launches, or it just scrambles automatically?
|
Re: Custom Votes v0.4.1 (6/9)
I was thinking of a rtv like, when xx people (defined by a cvar, let's say 10 for exemple) type scramble then the vote is launched.
I was also thinking (since some of my vote are made for the public) maybe you can add a specified number of vote allowed for each player. |
Re: Custom Votes v0.4.1 (6/9)
Just try to mimic something like sm_rtv_minplayers and sm_rtv_needed, where a vote can only be started if x people are in the server, and where a vote can only be started if x people type the chat trigger.
|
Re: Custom Votes v0.4.1 (6/9)
I was just thinking about how "voteban" works on some servers (not sure how PlayersVotes handles it), where having X% of users typing "voteban [user]" IS the vote - so once a certain percentage threshold is reached the action is just taken automatically rather than launching the "official" menu-style vote.
We can probably support both though. It's approaching "replacing PlayersVotes" territory now, so I'm trying to decide whether it makes more sense to 1) ask The Resident expand the functionality of PlayersVotes to be a more generic "chat vote" system that just runs commands after a certain threshold of triggers are received (one of which could be an sm_cvote vote), or 2) merge the PlayersVotes system into Custom Votes, rendering it obsolete. I'm leaning towards #2 now just because it seems like there would be a lot of duplicated effort otherwise, since a generic chat-vote system would also need to have configurable parameter types (the user to ban, etc.) that the user is prompted for via menus. |
Re: Custom Votes v0.4.1 (6/9)
#2 sounds awesome, as I've said before I'd love to see this integrated into SM core, so the more features it has, the better.
|
Re: Custom Votes v0.4.1 (6/9)
Quote:
The trick is that voteban/kick/map can have weird hidden requirements that make them a little less generic or straightforward to implement. For example, one of the trickiest things is actually the most recent bug report- Manni noted that voteban is easily circumvented if the targeted client just disconnects/reconnects. (It pretty much requires a total overhaul of how ban votes are managed in PlayersVotes. Bans would have to be by Steam ID or, if the client never authenticates, by IP addr.) There's a number of hidden little specialized "gotchas" in there that make a good generic implementation of voteban/kick/map kinda hard to do without sacrificing some other functionality. Anyway, FYI, PlayersVotes is a sessionless voting system. It has no concept of a vote having been started because it's always running. Once the required votes for an action has been reached, the action is taken. The key restrictions are that players may not cast multiple votes to kick/ban one person (although they may have multiple votes for kick/banning different people). A player can also have only one "active" map vote at any time (although they are allowed to CHANGE their vote after it has been made). I've also considered adding a generic vote capability to PlayersVotes. It could definitely be done, but that idea's just kind of on the back-burner at the moment. I haven't looked too hard at Custom Votes (yet), but I suspect that CV could take the place of PV by selectively importing some of PV's more specialized capabilities...? I'll take a closer look at CV and see which of #1 or #2 would work best for me. |
Re: Custom Votes v0.4.1 (6/9)
If we do add this stuff into CV, the main thing would be the sessionless tracking that you have in PV (who triggered what, with what parameters, is their vote expired, clear their vote if they disconnect, etc.)
I'll dig around the PV code a bit too and see what's going on in there. If you can think of any of the other gotchas you ran across, let me know. As long as you're planning to overhaul a big chunk of PV's internals, it might make sense to just join forces. |
Re: Custom Votes v0.4.1 (6/9)
This mod doesn’t allow anyone who isn’t an admin to player params for votekick/voteban. Is this correct?
|
Re: Custom Votes v0.4.1 (6/9)
No, that's what Player Votes is for. As you can see in the posts above you they might be merged together.
|
Re: Custom Votes v0.4.1 (6/9)
I'm not sure if I made the commands right I wanted to create a votemute
so I coded it like so Code:
"mute" |
All times are GMT -4. The time now is 10:31. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.