callvote-revived

#20 - published 2 years ago

CallVote Revived

Originally made by CryReaper, now revived!

Build #15: Added console support & minimum player requirement option
Build #17: Several fixes for finishing vote too early; percent display shows kind of vote
Build #18: Added events to use with other plugins

 

The plugin allows players to start a vote.

 

Current votes:

  • Day
  • Night
  • Rain (start/stop)
  • Airdrop (random on map)
  • AirdropAll (random but at every player’s spot)
  • HealAll (heal everyone)
  • VehicleAll (random vanilla vehicle for everyone)
  • ItemAll (Itemid) (give everyone an item)
  • MaxSkills
  • Unlock (unlock every vehicle)
  • Kick (Player) (kick someone)
  • Mute (Player) (mute someone for a set amount of minutes decided in config)
  • Spy (Player) (anonymously vote to spy someone; on success everyone besides the suspect will know who got spied and will have access to the spy screenshot)
  • Custom (Text) (does nothing)

 

 

Configuration:

  • Color: the color for the messages; can be a hex value or Unity color name
  • FinishVoteEarly: setting this to true will finish the vote if the required percent has been met before the timer ends
  • NotifyCooldownOver: whether to announce when the vote cooldown is over
  • AutoVoteCaller: immediately make the starter of the vote count in with the percent
  • VoteTimer: how long the vote should be going on (in seconds)
  • VoteCooldown: time between each vote (in seconds)
  • RequiredPercent: the percent of the present players required to agree with the vote
  • MuteTime: if the mute vote is enabled, this will be the time (in minutes) to mute the player
  • MinimumPlayers: whether to restrict voting to a set amount of minimum players present

 

All votes can be enabled/disabled and require the permission cvote and cvote.[vote name]

The aliases of the votes can be changed or used as alternative/translated names.

 

Any suggestions?

 

If you appreciate my work you can always donate to me here

Default configuration


<?xml version="1.0" encoding="utf-8"?>
<Config xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Color>yellow</Color>
  <FinishVoteEarly>true</FinishVoteEarly>
  <NotifyCooldownOver>false</NotifyCooldownOver>
  <AutoVoteCaller>true</AutoVoteCaller>
  <VoteTimer>60</VoteTimer>
  <VoteCooldown>300</VoteCooldown>
  <RequiredPercent>60</RequiredPercent>
  <MuteTime>5</MuteTime>
  <MinimumPlayers>0</MinimumPlayers>
  <Votes>
    <Vote Name="Day" Alias="d" Enabled="true" />
    <Vote Name="Night" Alias="n" Enabled="true" />
    <Vote Name="Rain" Alias="r" Enabled="true" />
    <Vote Name="Airdrop" Alias="a" Enabled="true" />
    <Vote Name="AirdropAll" Alias="aall" Enabled="true" />
    <Vote Name="HealAll" Alias="h" Enabled="true" />
    <Vote Name="VehicleAll" Alias="v" Enabled="true" />
    <Vote Name="ItemAll" Alias="i" Enabled="true" />
    <Vote Name="Unlock" Alias="u" Enabled="true" />
    <Vote Name="Kick" Alias="k" Enabled="true" />
    <Vote Name="Mute" Alias="m" Enabled="true" />
    <Vote Name="Spy" Alias="s" Enabled="true" />
    <Vote Name="Custom" Alias="c" Enabled="true" />
    <Vote Name="MaxSkills" Alias="ms" Enabled="true" />
  </Votes>
</Config>

Default english translation


<?xml version="1.0" encoding="utf-8"?>
<Translations xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Translation Id="" Value="==============================[Help]==============================" />
  <Translation Id="vote_help" Value="The votes you can call are: {0}. You can start one with /cvote &lt;vote name|alias&gt;" />
  <Translation Id="" Value="=============================[Events]=============================" />
  <Translation Id="vote_started" Value="{0} has called a {1} second vote to {2}." />
  <Translation Id="vote_ongoing" Value="[{2} Vote]: {0}%. Required: {1}%. Type /cv to vote." />
  <Translation Id="vote_success" Value="The vote was successful." />
  <Translation Id="vote_failed" Value="The vote was unsuccessful." />
  <Translation Id="" Value="===========================[Rejections]===========================" />
  <Translation Id="already_voted" Value="You have already voted!" />
  <Translation Id="no_ongoing_votes" Value="There are no votes currently active." />
  <Translation Id="not_enough_players" Value="At least {0} players are required to start a vote!" />
  <Translation Id="vote_cooldown" Value="A vote may only be called every {0} seconds." />
  <Translation Id="vote_disabled" Value="This type of vote is disabled on the server." />
  <Translation Id="vote_no_permission" Value="This type of vote is not permitted for you." />
  <Translation Id="vote_error" Value="Only one vote may be called at a time." />
  <Translation Id="" Value="==============================[Misc]==============================" />
  <Translation Id="kick_reason" Value="The majority decided so." />
  <Translation Id="mute_reason" Value="The majority decided to mute you. Wait {0} minutes." />
  <Translation Id="check_ready" Value="The spy screenshot is ready for {0}. Press ESC to check it out." />
  <Translation Id="airdropall_message" Value="An airdrop is coming right to your spot, {0}!" />
  <Translation Id="vehicleall_message" Value="You received a {0}!" />
  <Translation Id="itemall_message" Value="You received a {0}!" />
  <Translation Id="mute_message" Value="You have been muted for {0} minutes." />
  <Translation Id="cooldown_over" Value="The vote cooldown is over. You can start another vote if desired." />
  <Translation Id="" Value="===========================[Vote types]===========================" />
  <Translation Id="Day" Value="make it Day" />
  <Translation Id="Night" Value="make it Night" />
  <Translation Id="Rain" Value="start/stop Rain" />
  <Translation Id="Airdrop" Value="summon an Airdrop" />
  <Translation Id="AirdropAll" Value="summon an Airdrop for everyone" />
  <Translation Id="HealAll" Value="Heal everyone" />
  <Translation Id="VehicleAll" Value="give everyone a random Vehicle" />
  <Translation Id="ItemAll" Value="give everyone a {0}" />
  <Translation Id="MaxSkills" Value="Max everyone's skills" />
  <Translation Id="Unlock" Value="Unlock every Vehicle" />
  <Translation Id="Kick" Value="Kick {0}" />
  <Translation Id="Mute" Value="Mute {0} for {1} minutes" />
  <Translation Id="Spy" Value="Spy someone together" />
  <Translation Id="Custom" Value="{0}" />
</Translations>

Commands and permissions


/cvote <vote name|alias>

Permissions: cvote

Start a vote to make something happen or simply vote for an ongoing vote


Git changelog


5f1ea3f3f863666 2017-04-01 18:30:02

Reverted MaxSkills method

    28859470536184e 2017-03-04 21:21:01

    Rework

      35de0cce84f5bea 2017-03-02 10:06:51

      Update to latest build & maxskills method

        333519dc43690db 2017-02-26 22:14:55

        Added events to use with other plugins

          5fc6c8001e6931e 2017-02-23 18:48:17

          Several fixes

            7e7c03d0ee60d05 2017-02-21 17:46:32

            ...

              68e5912fc05e771 2017-02-21 17:39:28

              ...

                8ac2cbbc247ba64 2017-02-20 02:56:08

                ...

                  91373e79d719b2d 2017-02-20 02:35:45

                  ...

                    e97a44e5a4e01a4 2017-02-17 16:02:16

                    Update libs & optimise

                      67cb0bf635c5386 2017-02-16 19:53:13

                      Added console support

                      • Added a minimum player requirement
                      • Fixed potential reloading issue

                      a5a1d1d64a6e165 2017-01-25 18:15:44

                      Fix Rain vote

                        bc356bb4c2b699b 2017-01-22 03:56:43

                        Added MaxSkills vote

                          a128271ebdfd2c4 2017-01-22 03:27:49

                          ...

                            7829f81d1054212 2017-01-22 03:06:43

                            ...

                              2abaa7eef7d979f 2017-01-22 02:51:43

                              Revert "Revert "...""

                              • This reverts commit 557a04d3218e6052b20e89cdcecba1881cf762b7.

                              557a04d3218e605 2017-01-22 02:47:25

                              Revert "..."

                              • This reverts commit b1347a8a14f7ae3a1a8bef37e00cee52956d3ea3.

                              b1347a8a14f7ae3 2017-01-22 02:38:16

                              ...

                                41991ac707487fb 2017-01-22 02:10:48

                                Huge rework

                                • Added /cv as alias for /cvote
                                • Added Mute (player) vote (with default minutes in config)
                                • Added ItemAll (itemid) vote
                                • Added Configurable aliases (could also be used as an alternative or translated name to use instead) and enabling for votes
                                • Reworked the help text to only display the votes the player has permission to and is enabled on the server (with their aliases)
                                • Changed /cvote yes to just /cvote or /cv
                                • Added some notification messages for votes
                                • Added an option to include the caller as a voter instead of having to vote too
                                • Fixed broadcast issue when vote cooldown was set lower than timer
                                • Added notification when caller has no permission to the vote or when the vote is disabled
                                • Made AirdropAll random airdrop id for every player (apparently it was same id for everyone)
                                • Note: This update requires a regenerated translation and configuration file

                                fc9565c0fdac77a 2017-01-20 19:50:47

                                Real percent and spy fix

                                  1dffe1a70fe01f5 2017-01-20 16:50:43

                                  Fix percent

                                    6b6103f48b760db 2017-01-20 16:10:50

                                    Added unlock vehicles vote

                                      a0c499481c1bc04 2017-01-20 15:18:18

                                      ...

                                        15402750ca23a23 2017-01-20 14:08:27

                                        Added Spy vote

                                          1553b8e68c823ce 2017-01-20 14:07:16

                                          Update README.md

                                            2592628c3a71cfa 2017-01-20 13:31:30

                                            Add files via upload

                                              de0aac0736fec07 2017-01-20 13:27:50

                                              Minor fix

                                                870ee6be7b97d79 2017-01-20 12:46:57

                                                Update README.md

                                                  acf63f1bef038ec 2017-01-20 12:46:07

                                                  Update README.md

                                                    bff534afad9b785 2017-01-20 12:45:29

                                                    Update README.md

                                                      e9675522cd53908 2017-01-20 12:40:04

                                                      Update

                                                      • • Optimised plugin
                                                      • • Code cleanup
                                                      • • Added option to finish vote when the required percent has been met
                                                      • • Added more voting commands: Airdropall, Healall (h), Vehicleall (v), Kick (k) <playername>, Custom (c) <Text>
                                                      • • Fixed mistakes
                                                      • • Added permission for each vote
                                                      • • Added option to notify when cooldown is over
                                                      • Note:
                                                      • • The AirdropAll vote gives every player an airdrop right at their very spot with a random airdrop id from the map
                                                      • • The VehicleAll vote only gives Vanilla vehicles
                                                      • • You need to regenerate the config and translation file for this update!

                                                      de12974b6c67a2e 2016-11-28 22:14:33

                                                      Added aliases, command info and minor fix

                                                        3f3ffd41fe811d5 2016-11-28 19:16:04

                                                        Fixed translations

                                                          0783fd1ab31c6e9 2016-11-19 16:02:54

                                                          Update README.md

                                                            7a10e11638eba62 2016-11-19 15:58:47

                                                            Update README.md

                                                              358165a7bd1a14a 2016-11-19 15:55:01

                                                              Added planned features

                                                              • - Vote for night/(stop)rain/airdrop
                                                              • - Config to enable/disable the votes
                                                              • - Config to change message color
                                                              • - Translations

                                                              464c000a76bfab1 2016-11-19 11:44:06

                                                              Update README.md

                                                                89aa4030b913433 2016-11-19 11:43:11

                                                                Update README.md

                                                                  5546c215c61b905 2016-11-19 11:37:56

                                                                  Update README.md

                                                                    cf5fd69dd615379 2016-11-19 01:05:19

                                                                    Add files via upload

                                                                      5fe27d29d91e4f5 2016-11-19 00:57:16

                                                                      Add files via upload

                                                                        Download

                                                                        Build #20
                                                                        By downloading this file, you agree to our license terms.

                                                                        Repository

                                                                        github.com

                                                                        License

                                                                        MIT

                                                                        Author

                                                                        Arechi