MikeHawke
Most customizable vote plugin for Rust servers

Supported Games
GameServerKingsGameServerKings

Easy Vote is the most advanced vote plugin available. Everything can be customized without knowing anything about coding.

Please Note updating from v2.0.35 to v2.0.43 you will need to delete your oxide/lang/en/EasyVote.json and oxide/config/EasyVote.json to clear any ligering color codes

Video

EasyVote Configuration

Features

  • Closest reward feature, please see FAQ where i try explain this feature to you all!
  • Players receive a reward every time they vote successfully. You can edit the available rewards in the configuration file.
  • You can make more reward variables by adding new line in Commands json. Commands are just console commands, so this way EasyVote support every oxidemod plugins which have console commands.
  • Add custom reward based how many time player has voted. You can add many as you like custom rewards, there is no limits.
  • Supports Rust-Servers.net, Rust-Servers.info and BestServers.com but you can add other voting API sites by editing config file.
  • Global Announcement - Alert to every player in server. Who and how many time player has voted.
  • And much more!

Reward Variables

These are called "Commands" in config file!!!Also note that these are just CONSOLE COMMANDS, so you can make more by just add new line! Rename variable name and use it in Rewards.

Note: If you make new "Commands", you have to add same named line in lang/EasyVote.json lang file. You can see existing commands there as well.

  • item.name: <amount> -- You get item list from Oxide itemlist
  • addgroup: <group>-<time> -- Add a player to a group for a specific time (Request: Timed Permissions)
  • grantperm: <permission>-<time> -- Give a player a permission for a specific time (Request: Timed Permissions)
  • money: <amount> -- How much gave money per vote (Request: Economics)
  • oxidegrantgroup: <group name> -- Add player to group
  • oxidegrantperm: <permission name> -- Grant permission to player
  • oxiderevokegroup: <permission name> -- Remove player from group
  • oxiderevokeperm: <group name> -- Revoke permission to player
  • rp: <amount> -- Add points to players profile (Request: ServerRewards)
  • zlvl-wc: <amount> -- How much add Woodcutting level per vote (Request: ZLevels)
  • zlvl-m: <amount> -- How much add Mining level per vote (Request: ZLevels)
  • zlvl-s: <amount> -- How much add Skinning level per vote (Request: ZLevels)
  • zlvl-c: <amount> -- How much add Crafting level per vote (Request: ZLevels)
  • zlvl-*: <amount> -- How much add ALL level per vote (Request: ZLevels)

Variables

Use the below replacement variables when you make own commands.

  • {playername} -- player's display name
  • {playerid} -- player's Steam ID
  • {value} -- the reward list
  • {value2}** the reward list split with - character; example: addgroup: GroupName-30d`

Permissions

  • easyvote.use -- Allows player to use the available chat commands

Chat Commands

  • /vote -- Show vote link(s)
  • /claim -- Claim vote reward(s)
  • /rewardlist -- Display what reward(s) can get

Configuration

{
  "Commands": {
    "money": "deposit {playerid} {value}",
    "oxidegrantgroup": "oxide.usergroup add {playerid} {value}",
    "oxidegrantperm": "oxide.grant user {playerid} {value}",
    "oxiderevokegroup": "oxide.usergroup remove {playerid} {value}",
    "oxiderevokeperm": "oxide.revoke user {playerid} {value}",
    "rp": "sr add {playerid} {value}",
    "tempaddgroup": "addgroup {playerid} {value} {value2}",
    "tempgrantperm": "grantperm {playerid} {value} {value2}",
    "zlvl-*": "zl.lvl {playerid} *  {value}",
    "zlvl-c": "zl.lvl {playerid} C  {value}",
    "zlvl-m": "zl.lvl {playerid} M  {value}",
    "zlvl-s": "zl.lvl {playerid} S  {value}",
    "zlvl-wc": "zl.lvl {playerid} WC  {value}"
  },
  "Discord": {
    "Discord webhook (URL)": "",
    "DiscordMessage Enabled (true / false)": "false",
    "Enable @here alert (true / false)": "false",
    "Title": "Vote"
  },
  "Rewards": {
    "@": [
      "supply.signal: 1",
      "zlvl-*: 1"
    ],
    "first": [
      "oxidegrantperm: kits.starterkit"
    ],
    "vote10": [
      "money: 1000",
      "rp: 50",
      "tempgrantperm: fauxadmin.allowed-5m"
    ],
    "vote3": [
      "oxidegrantgroup: member"
    ],
    "vote6": [
      "money: 500",
      "tempaddgroup: vip-1d1h1m"
    ]
  },
  "Servers": {
    "ServerName1": {
      "Rust-Servers.net": "ID:KEY"
    },
    "ServerName2": {
      "Rust-Servers.info": "ID:KEY"
    },
    "ServerName3":{
      "BestServers.com" :"ID:KEY"
      },
  },
  "Settings": {
    "Enable logging => oxide/logs/EasyVote (true / false)": "true",
    "Globally announcment in chat when player voted (true / false)": "true",
    "Prefix": "<color=#00ffff>[EasyVote]</color>",
    "Send thank you message to player who voted (true / false)": "true",
    "Vote rewards cumulative (true / false)": "false"
  },
  "VoteSitesAPI": {
    "Rust-Servers.info": {
      "API Claim Reward (GET URL)": "https://api.rust-servers.info/votesclime/?key={0}&steamid={1}",
      "API Vote status (GET URL)": "https://api.rust-servers.info/votescheckclime/?key={0}&steamid={1}",
      "Vote link (URL)": "http://rust-servers.info/server/id-{0}.html"
    },
    "Rust-Servers.net": {
      "API Claim Reward (GET URL)": "http://rust-servers.net/api/?action=custom&object=plugin&element=reward&key={0}&steamid={1}",
      "API Vote status (GET URL)": "http://rust-servers.net/api/?object=votes&element=claim&key={0}&steamid={1}",
      "Vote link (URL)": "http://rust-servers.net/server/{0}"
    },
    "BestServers.com": {
      "API Claim Reward (GET URL)": "https://bestservers.com/api/vote.php?action=claim&key={0}&steamid={1}",
      "API Vote status (GET URL)": "https://bestservers.com/api/vote.php?action=status&key={0}&steamid={1}",
      "Vote link (URL)": "https://bestservers.com/server/{0}"
    }
  }
}

Localization

{
  "NoPermission": "You do not have permission to use this command!",
  "ClaimStatus": "<color=#00fff7>[{0}]</color> Checked {1}, Status: {2}",
  "ClaimError": "Something went wrong! Player <color=#ff0000>{0} got an error</color> from <color=#fffb00>{1}</color>. Please try again later!",
  "ClaimReward": "You just received your vote reward(s). Enjoy!",
  "ClaimPleaseWait": "Checking the voting websites. Please wait...",
  "VoteList": "You have voted <color=#fffb00>{1}</color> time(s)!\n Leave another vote on these websites:\n{0}",
  "EarnReward": "When you have voted, type <color=#fffb00>/claim</color> to claim your reward(s)!",
  "RewardListFirstTime": "<color=#00fff7>Reward for voting for the first time.</color>",
  "RewardListEverytime": "<color=#00fff7>Reward, which player will receive everytime they vote.</color>",
  "RewardList": "<color=#00fff7>Reward for voting</color> <color=#FFA500>{0}</color> <color=#00fff7>time(s).</color>",
  "Received": "You have received {0}x {1}",
  "ThankYou": "Thank you for voting! You have voted <color=#fffb00>{0}</color> time(s) Here is your reward for..\n{1}",
  "NoRewards": "You do not have any new rewards available\n Please type <color=#fffb00>/vote</color> and go to one of the websites to vote and receive your reward",
  "RemeberClaim": "You haven't claimed your reward from voting for the server yet! Use <color=#fffb00>/claim</color> to claim your reward!\n You have to claim your reward within <color=#fffb00>24h</color>! Otherwise it will be gone!",
  "GlobalChatAnnouncments": "<color=#fffb00>{0}</color><color=#00fff7> has voted </color><color=#fffb00>{1}</color><color=#00fff7> time(s) and just received their rewards. Find out where you can vote by typing</color><color=#fffb00> /vote</color>\n<color=#00fff7>To see a list of avaliable rewards type</color><color=#fffb00> /rewardlist</color>",
  "money": "<color=#fffb00>{0}$</color> has been desposited into your account",
  "rp": "You have gained <color=#fffb00>{0}</color> reward points",
  "tempaddgroup": "You have been temporality added to <color=#fffb00>{0}</color> group (Expire in {1})",
  "tempgrantperm": "You have temporality granted <color=#fffb00>{0}</color> permission (Expire in {1})",
  "zlvl-wc": "You have gained <color=#fffb00>{0}</color> woodcrafting level(s)",
  "zlvl-m": "You have gained <color=#fffb00>{0}</color> mining level(s)",
  "zlvl-s": "You have gained <color=#fffb00>{0}</color> skinning level(s)",
  "zlvl-c": "You have gained <color=#fffb00>{0}</color> crafting level(s)",
  "zlvl-*": "You have gained <color=#fffb00>{0}</color> in all level(s)",
  "oxidegrantperm": "You have been granted <color=#fffb00>{0}</color> permission",
  "oxiderevokeperm": "Your permission <color=#fffb00>{0}</color> has been revoked",
  "oxidegrantgroup": "You have been added to <color=#fffb00>{0}</color> group",
  "oxiderevokegroup": "You have been removed from <color=#fffb00>{0}</color> group"
}

For Developers

API Calls

string getHighestvoter()
string getLastvoter()
void resetPlayerVotedData(string steamID, bool displayMessage = true)
void resetData(bool backup = true)

Hooks

void onUserReceiveReward(BasePlayer player, int voted)

FAQ

How to install EasyVote

Drag and drop (when server is running or not) EasyVote.cs to plugins folder. Locate you self to config folder. Open EasyVote.json file.

Let me walk throw all lines from top to down...

"Commands": These are the variables what you can use when making rewards. All these are just console commands, what server will run in server console. (Format. "anyName": "console command") (Example. "imcommand": "say hello_in_chat")

"Discord": Config settings for DiscordMessages plugin. It will send embed to your channel when someone vote. Example: https://i.imgur.com/8GsavoK.png

"Rewards": Here you can modify rewards what player will got when they vote your server(s). More about this section right below.

"Servers": Here you add your vote site ID and APIKEY (aka. secret key) "ServerName1" can be changed anything what you liked (like "RustVoided x2" or "RustVoided Vanilla") More information, how to found ID and KEY below.

"Settings": Basic true/false settings for EasyVote.

"VoteSitesAPI": This is the section for more advanced server owners. You don not need to modify anything in this area.

First I recommend to add vote site (servers). Add your server to Rust-Server.net, Rust-Server.info, or BestServers.com, or all.

You can find the id from the last part of the voting site's URL for your server.in Rust-Server.info id is right here https://rust-servers.info/server/id-123.html <- in this case, is 123In Rust-Servers.net, id is right here http://rust-servers.net/server/123 <- in this case, is 123In BestServers.com, id is right here http://BestServers.com/server/123 <- in this case, is 123

Key is secret key what you should not share any one. Key is hided in vote site dashboard. Login your account and navigate to modify your server, somewhere there should be your apikey, key, secret token, etc.

Note that you can add all your servers in this config and let player vote all your server. It also let players claim reward in any server. Here is example how it could look after you finished to found your ID and KEY.

  "Servers": {
  "My Server x10": {
    "Rust-Servers.info": "12345:gsvdwsdsdsfddfgsfdg21342uJTRA9oOPIASCNDJK12343b",
    "Rust-Servers.net": "12345:gsvdwsdsdsfddfgsfdg21342uJTRA9oOPIASCNDJK12343b",
    "BestServers.com" : "12345:gsvdwsdsdsfddfgsfdg21342uJTRA9oOPIASCNDJK12343b"
  },
  "My Second server x10000": {
    "Rust-Servers.info": "12345:gsvdwsdsdsfddfgsfdg21342uJTRA9oOPIASCNDJK12343b",
    "Rust-Servers.net": "12345:gsvdwsdsdsfddfgsfdg21342uJTRA9oOPIASCNDJK12343b",
    "BestServers.com" : "12345:gsvdwsdsdsfddfgsfdg21342uJTRA9oOPIASCNDJK12343b"
  }
},

After that trouble, feel free test that everything is working. Run reload command in server console: oxide.reload EasyVote. If you found out that you do not get any reward after voting server or /vote chat command not showing any server what you just added. Then open logs (oxide/logs/EasyVote) and there you can see what cause the error. If everythings work just fine. Feel free start modify settings, rewards and other how you liked it. Remember take backups :)

What is Closest reward feature?

Here is an example configuration:

"Rewards": {
        "first": [
            "oxidegrantperm: kits.starterkit"
        ],
        "@": [
            "supply.signal: 1"
        ],
        "vote1": [
            "money: 10"
        ],
        "vote5": [
            "money: 50"
        ]
    },

Plugin will always give the last/closest reward based of their votes.

"@" means all the time reward, "first" means once time reward.

[Voted 1th] -> Vote1 reward   first & @ reward
[Voted 2th] -> Vote1 reward   @ reward
[Voted 3th] -> Vote1 reward   @ reward
[Voted 4th] -> Vote1 reward   @ reward
[Voted 5th] -> Vote5 reward   @ reward
[Voted 6th] -> Vote5 reward   @ reward

If "Vote rewards cumulative" is enabled from config. Player will got all past reward(s), like so..

[Voted 1th] -> Vote1 reward   first & @ reward
[Voted 2th] -> Vote1 reward   @ reward
[Voted 3th] -> Vote1 reward   @ reward
[Voted 4th] -> Vote1 reward   @ reward
[Voted 5th] -> Vote1 & Vote5 reward   @ reward
[Voted 6th] -> Vote1 & Vote5 reward   @ reward

How can I make a new command for my rewards?

All "Commands" are just console commands. Make new line under last line in "Commands". Also remember add , char in above line example

"zlvl-wc": "zl.lvl {playername} WC  {value}",
"hello": "say {value}"

Now you can add "hello" in rewards, like this:

"Rewards": {
    "@": [
      "supply.signal: 1",
      "hello: Kappa",
      "zlvl-*: 1"
    ]
}

Save all and oxide.reload EasyVote

Changes

  • Color tags updated to Hex Code.
  • Removal of Beancan API as votes are no longer approved.
  • Inclusion of Pavel Neelers' API for rust-servers.info
  • Updated to api requirements for DiscordMessages
  • Inclusion of Luz1fers' API For BestServers.com

Credits

  • Exel80, for his work so far.
  • Calytic, for adding beancan.io support helping with the config reading
  • MJSU, for their custom Easy Vote plugin and all the effort done so far
  • Wulf, for helping hotfix plugin; he is awesome!

MIT License


Copyright (c) 2021 MikeHawke


Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:


The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.


THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.