Resource icon

VOTING PLUGIN (BY DANGER89) 2.2

Voting system, including votemap, votemaprotate, votemapgametype and more!


The code is tested mainly with Call of Duty 4, however this plugin should also works with other games.
Note: This plugin is a repost from the now closed B3 forum. It comes as is and support may not be available.



Fixed / new features:
  • Fixed to accept the vote the total count of yes must be higher or equal to the minimum vote setting.
  • Bug fixed votemap.
  • Fixed minium vote for each vote type.
  • Added !votemapgametype and !votemaprotate
  • Fixed default values for more security. And level 1 instead of level 2 group in config file.
  • Both kick & tempban commands have as reason description "Voted out" and saves the caller in admin field of the database, this allows you to search to all the kick/tempban votes and to find the caller again.
  • Extended / fixed configuration file
  • New configuration options
  • Added !votegametype
  • Fixed some small bugs
  • The exact full map and gametype name is only allowed. The server (CoD4) hangs for example at !vm killhouse instead of !vm mp_killhouse
  • Fixed bug: "A vote is already in progress"


Installation of Votekick for B3 by danger89

  • Place plugins/voting.py in plugins/ and conf/voting.xml, conf/maplist.txt and conf/gametypelist.txt in conf/ map
  • In your b3.xml config, add in the plugin section (choose the correct priority):
    <plugin name="voting" priority="14" config="@b3/conf/voting.xml"/>
  • Adjust the minimal level for each command and set the values in voting.xml
  • Set all the maps you wish to allow to be voted in the server in maplist.txt
  • Set all the gametypes you wish to allow to be voted in the server in gamelist.txt
  • Ready to go!


New Functionality Provided & Bugs Fixed


Fixed minium vote for all vote types.

Fixed default values and added try/except for security if the config file didn't load properly.

!votemapgametype
With this command you can vote for a gametype and also directly vote for a map.

!votemaprotate
This will skip the current map and rotate to the next map in of the map rotation.

Configuration file vote_interval is changed to vote_interval_failed
It's the time in minutes after a failed vote and re-vote

Configuration file vote_interval_announcements added
It's the time in minutes between each announcement

Configuration file tempban_interval changed to tempban_duration
To make it clear.

Added comment in the configuration file.

!votekick and !votetempban commands have same reason "Voted out"
This allows you to search to all the kick/tempban votes.

!votekick and !votetempban commands saves the caller in the admin field
This allows you to find the caller again.

!votegametype or !vg
Initate a votemap for a gametype.
If the gametype is in gametypelist.txt, a vote will be carried out. Players need to write the full gametype abbreviation. See the list in gametypelist.txt

!gametypelist or !gamel
Lists all the available gametypes on the server. (It reads the maplist.txt file)

!votekick or !vk
Initiate a votekick against a player.
The votes can only be initated by players above configured level. Admins can't be voted out.
If more than tempban_minvotes players vote, and more than tempban_percent of them are "yes", the player will be tempbanned for tempban_interval.

!votemap or !vm
Initate a votemap for a map.
If the map is in maplist.txt, a vote will be carried out. Players only need to write the full map's name. For example, if they wish to vote "Shipment", they can type "!vm mp_shipment" (assuming no other map has that string in their name).

!maplist or !mapl
Lists all the available maps on the server. (It reads the maplist.txt file)

!voteyes or !vy
!voteno or !vn
Vote yes or no in the current vote.

!voteveto or !vveto
Veto the current vote

Configurable Variables

min_level_*
Set the minimal level for the command.

vote_times
Number of times the bot tells how the vote is going and asks for votes. When the times are up, the vote ends.

vote_interval_announcements
Time in minutes between each announcement.

vote_interval_failed
Time in minutes between failed votes.

tempban_minvotes
Minimum necessary votes in order to pass the vote.

tempban_percent
If more than tempban_minvotes players vote, and more than tempban_percent of them are "yes", the player will be tempbanned for tempban_interval.

tempban_duration
Tempban duration in minutes.

mapfile
File to read the allowed maps for voting.

gametypefile
File to read the allowed gametypes for voting.

-Melroy van den Berg
« Last Edit: March 21, 2016, 04:47:41 PM by danger89 »
  • Like
Reactions: x7Razor-ZA
Author
PeterG
Downloads
342
Views
858
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from PeterG