Difference between revisions of "Playervotes Plugin"

From Vertigo Gaming Wiki
Jump to: navigation, search
Line 14: Line 14:
 
To install the plugin, simply download the files, unzip them, and then copy the addons folder into your game server's main directory. This will add ALL of the files into your game's "addons/sourcemod"  directories. If asked to merge folders, click yes. If asked to overwrite, click yes. The playersvotes.cfg file is located in "addons/sourcemod/configs". The plugin does not automatically generate this file, so a copy of the config file has been provided. Playervotes also integrates with Sourcebans, so any votebans that succeed will be listed on the Sourcebans webpage. Because basevotes does interfere with this plugin, it is highly recommended that it is removed/disabled before using playervotes. Once installed, you may need to restart your server in order to make sure it takes effect. This plugin was tested for ZPS, but can work in other Source-based games that support Sourcemod.
 
To install the plugin, simply download the files, unzip them, and then copy the addons folder into your game server's main directory. This will add ALL of the files into your game's "addons/sourcemod"  directories. If asked to merge folders, click yes. If asked to overwrite, click yes. The playersvotes.cfg file is located in "addons/sourcemod/configs". The plugin does not automatically generate this file, so a copy of the config file has been provided. Playervotes also integrates with Sourcebans, so any votebans that succeed will be listed on the Sourcebans webpage. Because basevotes does interfere with this plugin, it is highly recommended that it is removed/disabled before using playervotes. Once installed, you may need to restart your server in order to make sure it takes effect. This plugin was tested for ZPS, but can work in other Source-based games that support Sourcemod.
  
The playersvotes.cfg file has all the configuration details that the plugin and each chat command uses and can enable/disable chat triggers. You can dictate the player ratio that is required for the vote to succeed (which is basically the total amount of players needed for a vote to be successful) and the minimum options is for how many people can be on the server for a vote to take place. When giving admins immunity to the plugin, you can either use immunity or immunegroups (or both) to specify which admins are not affected by the votes system. By default, immunity is set to 0 (meaning all admins are unaffected) and the immunegroups specifies which groups found in "admin_groups.cfg" (which is located in the "addons/sourcemod/configs" directory). There is no config cvar that exempts specific people or admins from being affected by the playervote plugin.
+
The playersvotes.cfg file has all the configuration details that the plugin and each chat command uses and can enable/disable chat triggers. You can dictate the player ratio that is required for the vote to succeed (which is basically the total amount of players needed for a vote to be successful) and the minimum options is for how many people can be on the server for a vote to take place. When giving admins immunity to the plugin, you can either use immunity or immunegroups (or both) to specify which admins are not affected by the votes system. By default, immunity is set to 0 (meaning all admins are unaffected) and the immunegroups specifies which groups found in "admin_groups.cfg" (which is located in the "addons/sourcemod/configs" directory). There is no config cvar that exempts specific people or admins from being affected by the playervote plugin. The following is the player votes config file:
 +
 
 +
<nowiki>
 +
"playersvotes"
 +
{
 +
"chattriggers" "1" // Are chat triggers enabled? (ex: votemute, votemap)
 +
"immunity" "0" // Admins with equal or higher immunity level will not be affected by votekick, ban, or mute (0 = Immunize all admins -1 = Ignore)
 +
"immunegroups" "Leader; Server Head Admins; Server Admins;" // Example Groups. Admins that are members of these groups will not be affected by votekick, ban, or mute (ex: "Full Admins; Clan Members; etc"
 +
"kick" // Kick votes (votekick)
 +
{
 +
"enabled" "1" // Are votes enabled?
 +
"ratio" "0.6" // Ratio required for successful vote
 +
"minimum" "4" // Minimum votes required for successful vote
 +
"delay" "0" // Time in seconds before vote is allowed after map start
 +
"limit" "0" // Number of votes allowed per player, per map (0 = No limit)
 +
"interval" "60" // Interval in seconds between another vote cast
 +
"team" "0" // Are votes restricted to teams (Affects ratios)
 +
}
 +
"ban"
 +
{
 +
"enabled" "1" // Are votes enabled?
 +
"ratio" "0.7" // Ratio required for successful vote
 +
"minimum" "4" // Minimum votes required for successful vote
 +
"delay" "0" // Time in seconds before vote is allowed after map start
 +
"limit" "0" // Number of votes allowed per player, per map (0 = No limit)
 +
"interval" "60" // Interval in seconds between another vote cast
 +
"team" "0" // Are votes restricted to teams (Affects ratios)
 +
"time" "30" // Ban time in minutes (0 = Permanently)
 +
"reasons" "Hacking;Spamming;Griefing;" // Semi-colon delimited list of ban reasons (ex: "Hacking; Spamming;Griefing")
 +
}
 +
"mute"
 +
{
 +
"enabled" "1" // Are votes enabled?
 +
"ratio" "0.6" // Ratio required for successful vote
 +
"minimum" "4" // Minimum votes required for successful vote
 +
"delay" "0" // Time in seconds before vote is allowed after map start
 +
"limit" "0" // Number of votes allowed per player, per map (0 = No limit)
 +
"interval" "60" // Interval in seconds between another vote cast
 +
"team" "0" // Are votes restricted to teams (Affects ratios)
 +
}
 +
  "gag"
 +
{
 +
"enabled" "1" // Are votes enabled?
 +
"ratio" "0.6" // Ratio required for successful vote
 +
"minimum" "4" // Minimum votes required for successful vote
 +
"delay" "0" // Time in seconds before vote is allowed after map start
 +
"limit" "0" // Number of votes allowed per player, per map (0 = No limit)
 +
"interval" "60" // Interval in seconds between another vote cast
 +
"team" "0" // Are votes restricted to teams (Affects ratios)
 +
}
 +
    "silence"
 +
{
 +
"enabled" "1" // Are votes enabled?
 +
"ratio" "0.6" // Ratio required for successful vote
 +
"minimum" "4" // Minimum votes required for successful vote
 +
"delay" "0" // Time in seconds before vote is allowed after map start
 +
"limit" "0" // Number of votes allowed per player, per map (0 = No limit)
 +
"interval" "60" // Interval in seconds between another vote cast
 +
"team" "0" // Are votes restricted to teams (Affects ratios)
 +
}
 +
}
 +
</nowiki>
  
 
You might notice a plugin called "adminvotes.smx" in the downloaded files. This plugin's function is to re-add the sm_vote ability that the basevotes.smx file has in it. If you do not know what that is, it is basically the ability to go into console and create a custom vote that users can vote on, but not have any direct effect on any systems (ie: You can make silly votes such as "Do you like Vanilla IceCream?" and create multiple answers for it when using sm_vote in console). This plugin is completely optional and can be disabled. Of course, if you are using this plugin, be sure to disable the basevotes.smx plugin as both of these plugins also interfere with each other. The code file was supplied just in case you wanted to compile it yourself.
 
You might notice a plugin called "adminvotes.smx" in the downloaded files. This plugin's function is to re-add the sm_vote ability that the basevotes.smx file has in it. If you do not know what that is, it is basically the ability to go into console and create a custom vote that users can vote on, but not have any direct effect on any systems (ie: You can make silly votes such as "Do you like Vanilla IceCream?" and create multiple answers for it when using sm_vote in console). This plugin is completely optional and can be disabled. Of course, if you are using this plugin, be sure to disable the basevotes.smx plugin as both of these plugins also interfere with each other. The code file was supplied just in case you wanted to compile it yourself.
  
== Setup ==
+
This guide also assumes you are using Sourcemod/Metamod, so if you haven't installed those, do so before adding the plugin files to your server! This version of the plugin was compiled on SM 1.7.3, so it should work for Sourcemod 1.7.3 or later. If you need this for an older/specialized version of Sourcemod, you may want to compile the plugin (script files are included) for your version of Sourcemod.
This plugin does not require any special configs or setup to use (outside of Sourcemod/Metamod of course). Simply move the plugin files to the correct folders into "~/addons/sourcemod/" of your ZPS game directory and it should start working automatically.
 
 
 
This version of the plugin was compiled on SM 1.7.3, so it should work for Sourcemod 1.7.3 or later. If you need this for an older/specialized version of Sourcemod, you may want to compile the plugin (script files are included) for your version of Sourcemod.
 
  
 
All of this is provided "as is". While this plugin should not cause harm, any harm caused by the plugin, user handling, or anything else Vertigo Gaming and all associated coders are not responsible for it. Use at your own risk!
 
All of this is provided "as is". While this plugin should not cause harm, any harm caused by the plugin, user handling, or anything else Vertigo Gaming and all associated coders are not responsible for it. Use at your own risk!

Revision as of 14:43, 1 April 2017

This plugin is an administrative plugin that works for not only ZPS but other games as well! Its based off the playervotes redux plugin that is based off the original playervotes plugin, but with all the leaks and issues mostly fixed. It also has the ability to track users that try to circumvent votebans, so they cannot merely disconnect and reconnect to get rid of it! The plugin supports the staple features (kick, ban, mute) and introduces gag and silence (mute+gag).

While the custom votes plugin does work, this version of the plugin only focuses on administrative votes that players can cast to help admin servers and is less complex/complicated to get working.

How It Works

The plugin uses the following chat triggers to activate an administrative vote against players: votekick, voteban, votemute, votegag, and votesilence. This plugin only supports those vote types, so it is purely administrative. The number of players and whether each is available to the player or not can be configured in the playersvotes.cfg file found in the "addons/sourcemod/configs" directory. To make use of the chat triggers without interference, please disable the basevotes plugin as it will attempt to block some of the chat triggers, causing some confusion.

Code and Plugin Download

Below is the download link and code for the plugin:

How To Install Plugin

To install the plugin, simply download the files, unzip them, and then copy the addons folder into your game server's main directory. This will add ALL of the files into your game's "addons/sourcemod" directories. If asked to merge folders, click yes. If asked to overwrite, click yes. The playersvotes.cfg file is located in "addons/sourcemod/configs". The plugin does not automatically generate this file, so a copy of the config file has been provided. Playervotes also integrates with Sourcebans, so any votebans that succeed will be listed on the Sourcebans webpage. Because basevotes does interfere with this plugin, it is highly recommended that it is removed/disabled before using playervotes. Once installed, you may need to restart your server in order to make sure it takes effect. This plugin was tested for ZPS, but can work in other Source-based games that support Sourcemod.

The playersvotes.cfg file has all the configuration details that the plugin and each chat command uses and can enable/disable chat triggers. You can dictate the player ratio that is required for the vote to succeed (which is basically the total amount of players needed for a vote to be successful) and the minimum options is for how many people can be on the server for a vote to take place. When giving admins immunity to the plugin, you can either use immunity or immunegroups (or both) to specify which admins are not affected by the votes system. By default, immunity is set to 0 (meaning all admins are unaffected) and the immunegroups specifies which groups found in "admin_groups.cfg" (which is located in the "addons/sourcemod/configs" directory). There is no config cvar that exempts specific people or admins from being affected by the playervote plugin. The following is the player votes config file:

"playersvotes"
{
	"chattriggers"			"1" // Are chat triggers enabled? (ex: votemute, votemap)
	"immunity"				"0" // Admins with equal or higher immunity level will not be affected by votekick, ban, or mute (0 = Immunize all admins -1 = Ignore)
	"immunegroups"			"Leader; Server Head Admins; Server Admins;" // Example Groups. Admins that are members of these groups will not be affected by votekick, ban, or mute (ex: "Full Admins; Clan Members; etc"
	"kick" // Kick votes (votekick)
	{
		"enabled"			"1" // Are votes enabled?
		"ratio"				"0.6" // Ratio required for successful vote
		"minimum"			"4" // Minimum votes required for successful vote
		"delay"				"0" // Time in seconds before vote is allowed after map start
		"limit"				"0" // Number of votes allowed per player, per map (0 = No limit)
		"interval"			"60" // Interval in seconds between another vote cast
		"team"				"0" // Are votes restricted to teams (Affects ratios)
	}
	"ban"
	{
		"enabled"			"1" // Are votes enabled?
		"ratio"				"0.7" // Ratio required for successful vote
		"minimum"			"4" // Minimum votes required for successful vote
		"delay"				"0" // Time in seconds before vote is allowed after map start
		"limit"				"0" // Number of votes allowed per player, per map (0 = No limit)
		"interval"			"60" // Interval in seconds between another vote cast
		"team"				"0" // Are votes restricted to teams (Affects ratios)
		"time"				"30" // Ban time in minutes (0 = Permanently)
		"reasons"			"Hacking;Spamming;Griefing;" // Semi-colon delimited list of ban reasons (ex: "Hacking; Spamming;Griefing")
	}
	"mute"
	{
		"enabled"			"1" // Are votes enabled?
		"ratio"				"0.6" // Ratio required for successful vote
		"minimum"			"4" // Minimum votes required for successful vote
		"delay"				"0" // Time in seconds before vote is allowed after map start
		"limit"				"0" // Number of votes allowed per player, per map (0 = No limit)
		"interval"			"60" // Interval in seconds between another vote cast
		"team"				"0" // Are votes restricted to teams (Affects ratios)
	}
   "gag"
	{
		"enabled"			"1" // Are votes enabled?
		"ratio"				"0.6" // Ratio required for successful vote
		"minimum"			"4" // Minimum votes required for successful vote
		"delay"				"0" // Time in seconds before vote is allowed after map start
		"limit"				"0" // Number of votes allowed per player, per map (0 = No limit)
		"interval"			"60" // Interval in seconds between another vote cast
		"team"				"0" // Are votes restricted to teams (Affects ratios)
	}
    "silence"
	{
		"enabled"			"1" // Are votes enabled?
		"ratio"				"0.6" // Ratio required for successful vote
		"minimum"			"4" // Minimum votes required for successful vote
		"delay"				"0" // Time in seconds before vote is allowed after map start
		"limit"				"0" // Number of votes allowed per player, per map (0 = No limit)
		"interval"			"60" // Interval in seconds between another vote cast
		"team"				"0" // Are votes restricted to teams (Affects ratios)
	}
}
 

You might notice a plugin called "adminvotes.smx" in the downloaded files. This plugin's function is to re-add the sm_vote ability that the basevotes.smx file has in it. If you do not know what that is, it is basically the ability to go into console and create a custom vote that users can vote on, but not have any direct effect on any systems (ie: You can make silly votes such as "Do you like Vanilla IceCream?" and create multiple answers for it when using sm_vote in console). This plugin is completely optional and can be disabled. Of course, if you are using this plugin, be sure to disable the basevotes.smx plugin as both of these plugins also interfere with each other. The code file was supplied just in case you wanted to compile it yourself.

This guide also assumes you are using Sourcemod/Metamod, so if you haven't installed those, do so before adding the plugin files to your server! This version of the plugin was compiled on SM 1.7.3, so it should work for Sourcemod 1.7.3 or later. If you need this for an older/specialized version of Sourcemod, you may want to compile the plugin (script files are included) for your version of Sourcemod.

All of this is provided "as is". While this plugin should not cause harm, any harm caused by the plugin, user handling, or anything else Vertigo Gaming and all associated coders are not responsible for it. Use at your own risk!