Inactive [FUN/ECON] Vouchers v2.2.1 - Buy Vouchers for Features and Commands [1060]

Discussion in 'Inactive/Unsupported Plugins' started by Kevin Forte, May 29, 2011.

  1. Offline

    Kevin Forte

    Vouchers: Let Your Players Pay for Features and Commands (Now With Aliases!)
    ~Version: 2.2.1~
    Download: [JAR]

    I have been constantly searching for a reason for my players to want to have a Lot of iConomy money. I couldn't really find that reason, so I made one. Introducing Vouchers, a way to let your players pay their way to a God-like status.

    Current Voucher Types:
    • Protection ~ Lets a player place a block only they (or an admin) can destroy.
    • Teleport ~ Allows a player to teleport to another player or an x,y,z coordinate.
    • Heal ~ Allows a player to fully heal themselves.
    • Timeshift ~ Allows a player to set the world time.
    • Parachute ~ Allows a player to hold shift to negate fall damage once.
    • Resurrect ~ Heals a player to full health when they would otherwise die if they are holding shift.
    • Superpick ~ Allows a player to break one block instantly.
    • Sunshine ~ Allows a player to clear up storms.
    • Thunderpunch ~ Hitting a mob or player will strike them with lightning.
    • Specify your own types to coincide with any command and create aliases for those commands.
    Creating a Voucher Shop:
    Show Spoiler

    1. Place a sign. On the lines, write:
    • Line One: [Vouchers]
    • Line Two: Voucher Type for Sale.
    • Line Three: Price of Voucher. OR Price of Voucher:Amount of Vouchers Being Purchased. (Example: 50:3 <-- Purchasing 3 Vouchers for 50 gold.)
    • Line Four: Whatever you want (I personally write the commands associated with the voucher or its purpose).
    2. That's it! If done correctly, you will be sent a message and the "[Vouchers]" line will turn blue.


    Using Commands as Voucher Types:
    Show Spoiler

    As of 1.5, you'll notice a 'Hooked Commands' section has been added to the config. To add a command, format it like this:
    Hooked Commands:
            Starting Amount for New Players: 0
            Include Arguments: true
            Command: money
            Alias: showmethemoney
            Warm-Up Time: 0
            Cool-Down Time: 0
            Description: Check how much money you have.
    This will create a MoneyCheck voucher for the command /money, which can also be used with the command alias /showmethemoney. If you do not wish to use an alias for a command, simply leave the section blank. If 'Include Arguments' is true, '/money' and any following arguments will expend a MoneyCheck voucher. If 'Include Arguments' is false, the command used must match the defined command for the Voucher exactly or a Voucher won't be used. The description is what is displayed when a player types '/vhelp MoneyCheck'. See the sample config.yml for an explanation of Warm-Up Time, Cool-Down Time, and Starting Amount for New Players.

    Show Spoiler

    [] = Necessary Argument
    {} = Optional Argument
    ** = Requires Permissions
    • /vcheck ~ Shows a player how many vouchers they have of the basic types.
    • /vcheckcom ~ Shows a player how many vouchers they have of defined command types.
    • /vtp [player name]/[x] [y] [z] ~ Use a Teleport voucher. Arguments can either be another player's name or an x,y,z coordinate.
    • /vheal ~ Heals the player completely with a Heal voucher.
    • /vprotect ~ Toggles protected block placing mode. Any block placed in this mode will exhaust a Protection voucher and will only be breakable by that player or a player with the Vouchers.admin node.
    • /vtime [day/night] ~ Lets a player set the time via a Timeshift voucher.
    • /vgift [player's name] [amount] [type] ~ Lets a player send a voucher to another player.
    • /vgive [player's name] [amount] [type]
    • /vsun ~ Removes a storm if there is one.
    • /vsp ~ Toggles superpick mode.
    • /vthunder ~ Toggles thunderpunch mode.
    • /vsave ~ Saves the current Vouchers and Shop locations.
    • /vreload [commands/vouchers/settings/all] ~ Reloads config.yml data.
    • /vhelp [sign/vouchertype (case sensitive)] ~ In-game reference for setting up Voucher Shops ('/vhelp sign') or display the description of a voucher type in the config.

    Important Notice:
    This plugin requires both iConomy/BOSEconomy and Permissions! Also, before you post that you are having problems, please follow this checklist:
    • 1. Read this entire post.
    • 2. Try deleting your /plugins/Vouchers folder and letting it recreate itself.
    • 3. Make sure you have not entered invalid values into the config.yml.
    If you are still getting errors and/or having issues after that, let me know. I appreciate it!

    Show Spoiler

    • Flight Voucher
    • Superpick Voucher
    • Thunderpunch Voucher
    • Changing the sign formatting so that you can buy more than one voucher at once.
    • BOSEconomy support.
    • Item Exchange support.
    • Adding more configuration options for the current Vouchers.
    • Adding a cost to create Voucher shops.

    Show Spoiler

    • Vouchers.use.(type in all lowercase) ~ Allows a player to use a Voucher. (Example: Vouchers.use.superpick)
    • Vouchers.setup ~ Allows a player to create/remove Voucher shops
    • in all lowercase) ~ Allows a player to use a Voucher command without needing the actual voucher.
    • ~ Allows a player to use voucher shops.
    • Vouchers.admin ~ Allows a player to destroy other players' Protected Blocks, use the /vsave command, use the /vgive command, and use the /vreload command.

    • Quick Bug Fix.
    • Added a /vgive command.
    • Switched to Bukkit based permissions.
    • Removed a couple obnoxious permission error messages.
    • Delayed economy plugin check.
    • /vhelp now shows whether or not you have permissions to use the Voucher.
    Show Spoiler

    • Plugin will disable itself if an economy plugin is not found.
    • Thunderpunch Voucher added.
    • Voucher descriptions added.
    • /vhelp [voucher type/sign] command added.
    • Bug fix.
    • MAJOR Bug Fix. Consider this the recommended build of Vouchers.
    • Fixed a misplaced "You don't have permission" error message.
    • Fixed an error given if you try and use /vreload without an argument or with too many arguments.
    • Fixed a possible NPE if your config.yml is outdated.
    • Fixed /vtp not giving an error if you use an incorrect length of arguments.
    • Major Code Cleanup.
    • BOSEconomy Support.
    • Added a Ton of new config options for ALL vouchers.
    • You can now choose to include the arguments of hooked commands or not.
    • Protected blocks are now saved on server restart. Whoops!
    • /vreload command added.
    • 'Vouchers.admin' Permissions node added.
    • Fixed more potential NPEs. Damn things always sneak up on me.
    • All data is now handled with the config.yml in the plugins/Vouchers folder.
    • '' permission removed due to redundancy.
    • '[type]' re-added.
    • '' permission added.
    • NPE problem REALLY solved. Seriously.
    • NPE problem (when using command vouchers) Finally solved.
    • All players are now notified when one uses a Timeshift voucher.
    • Command aliases have been added.
    • Fixed a bug that allowed negative Voucher cost values.
    • Fixed a bug that sent players (without permissions to use Resurrect or Parachute vouchers) a message whenever they took fall damage or died, regardless of whether they tried to use the voucher or not.
    • permission added for Multiverse servers.
    • The method of setting up shops to purchase more than one Voucher from has changed.
    • /vsignhelp command added for in-game shop setup reference.

    • Removed the permissions. Will be fixed in an upcoming update.
    • Fixed command vouchers never being depleted.
    • Fixed command vouchers not being loaded correctly.
    • Added a /vsave command to try and combat the problem of losing Vouchers and shops.
    • Added the ability to create signs that allow a player to buy more than one Voucher at a time.

    • Times that /vtime sets the world to changed for longer days/nights.
    • Players must be holding shift (sneaking) for a Resurrect voucher to be used.
    • (Hopefully) Fixed the issue with command voucher arguments.

    • Players must be holding shift (sneaking) for a Parachute voucher to be used.
    • Sunshine Voucher added.

    • First attempt at making sure Resurrect vouchers aren't used for fall damage that is already cancelled by other plugins. Good catch @Joy

    • Added a Superpick Voucher.
    • Added the '/vgift' command to send other players Vouchers.

    • Added Command-Based Voucher Types.
    • Added a Permissions node required for players to use their Vouchers.

    • Original Release.
    Bradley Hilton and Mitsugaru like this.
  2. Offline


    I have a Voucher for Superpick but how I use it?
  3. Offline


    Yes that would be a move forward. But thinking about having the plugin change each command internally is a good idea for the future as it will help separate your plugin from everything else. Just easier to organize in the brain.
  4. Offline


    Ah, i found it out :> /vsp
    Time Godmode would be nice!
  5. Offline

    Kevin Forte

    To be honest, I'm not sure, my server is small enough to where I can simply request my players leave for a few seconds so I can drop it, add the Voucher types, and then start it up again. I'm not entirely sure how reloading a plugin works or what it does, so I'll have to look into it.
    I did add an alias option, so if you like you can set the alias for all of them to have a v in front. Just a thought.
    Are you the admin of your server? If so, do you have the '*' permission node?
    That would be cool xP I need to find a better way to time things than Runnables, and then I'll add in time related Vouchers.
  6. Offline

    Please! :D This is exactly the plugin I have been waiting for, except I use BOSE instead of iCon...

    Thanks in advance.
  7. Offline

    Bradley Hilton

    Okay. I haven't tried it yet, but if I have the Voucher folder and the config.yml in the plugins folder before I add the .jar would that work? If so, then I'll try this way and let ya know.. Cause I can't do that on my server, we average about 15 users nonstop all the time. High times we have around 25. I'll let ya know later how this goes.
  8. Offline

    Kevin Forte

    I honestly have no idea. I guess my best suggestion would be to sit down and make a list of all of the command types you want, put the server down for 5 minute maintenance, punch it all in, and put it back up and you're golden.

    I'll do my best, but why does anyone use BOSEconomy? Even just looking at the API iConomy is SO much better and easier.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 16, 2016
  9. I am Admin of the server and I've got '*' permissions. I am also an OP.
    I was able to purchase the vouchers, but when using the command /warp warp1 it just takes me to the warp.

    I also tried deopping myself and making myself a Member who has basically only access to the warp command and to purchase and use vouchers. I still could just teleport to the warp1 and warp2 without it requiring any vouchers. =s
  10. Offline

    Kevin Forte

    Originally I figured it was because you have the '*' permission, meaning that you would also have the node and that would make it so you wouldn't need it. I then thought about it more after you said it still didn't work after you de-oped, and looked at how Vouchers handles commands. It only checks for the first word, not the arguments, so I changed how that is handled in 1.6 which should be out at the end of the day.
    ibab likes this.
  11. How arguments are handled?
    I need to create ticket for command "/town new [town name] [mayor]"
    But I need to check this part only "/town new".
    I need this because obvious reasons. So is it possible?
  12. Still same error on loading :/
  13. Offline


    Has anyone noticed the SuperPick allows players to destroy blocks were they shouldnt be able to?

    I have a player that is an outsider (from town) than cannot build/destroy but when they enable SuperPick they can destroy blocks although it warns them outsiders cannot destroy here...

    Is it just me or is there a fix Ive missed?
  14. Offline

    Kevin Forte

    Hmm, at the moment it isn't, but I'm working on a Ton of stuff right now, so I can work on that as well.

    Which error?

    What plugin do you use to protect blocks in your town?
  15. Offline


    i dont know why but vouchers seems stop working for me since i updated o.0
    the voucher signs still exists and voucher commands work but it isnt possibvle to buy any. i gave my users the and Vouchers.use.* permission.... but if they rightclick nothing happens not even admins with * permissions can use them

    im using permissions 3.x worldguard and towny the area with the shops is a worldguard region. i dont think that it realy can take effect but people was able to use vouchers well all the time and now they arent.. :-\

    EDIT: ok if i make them new they work, until the next server restart or crash then they dont work again
  16. Offline

    Kevin Forte

    Delete your plugins/Vouchers folder and let the config.yml recreate itself.
  17. Offline


    i did but its still deleting the sign function after every restart :-\ i also tryed to use directly /save-all and /vsave to make sure its saved... the config file only contains information what voucher players have but not 1 part about the sign locations i am sure thats why it cant load them
  18. Offline

    Kevin Forte

    Are you sure that 1. you have the most recent version and 2. you let the config.yml regenerate itself after updating?
  19. Offline


    RE: Superpick allows people to break blocks they shouldnt:
    I use WorldGuard, Permissions, Essentials but would suggest that Towny Mod controls the permissions as its in a town thats been created.

    RE: Custom Command:
    I also tried to add tphere hooked command as players wanted to be able to teleport players to themselves. The sign changes blue etc. but when you try and buy one console error :

    [SEVERE] could not pass event PLAYER_INTERACT to vouchers

    How i set up the command :

    Hooked Commands:
    Command: 'tphere'
    Alias: 'vtph'

    Thanks for taking the time to reply, other than this, great plugin!
  20. Offline

    Kevin Forte

    Hmm, well that I will have to look into (the Superpick). Concerning the console error, can you post the entire thing?
  21. Offline


    [SEVERE] Could not pass event SIGN_CHANGE to iConomyChestShop
    [SEVERE] could not pass event PLAYER_INTERACT to vouchers

    Thats all it says, no other errors, warning, infos at all...
  22. Offline

    Kevin Forte

    Well The SIGN_CHANGE is iConomyChestShop, not Vouchers, and afterwards there should be a bunch of nonsense about the error, I need that nonsense to try and fix the issue :p

    Vouchers updated to v2.0, those of you who have BOSEconomy will be pleased, and there are a ton of other things that I added (I thought the 2.0 status was appropriate considering I also changed the way the plugin works internally almost entirely). Delete your /plugins/Vouchers folders and let them regenerate, it's important!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 16, 2016
  23. This:
    11:14:59 [SEVERE] Error occurred while enabling Vouchers v2.0 (Is it up to date?): null
            at kforte318.Vouchers.Vouchers.loadHookedCommands(
            at kforte318.Vouchers.Vouchers.onEnable(
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(
            at org.bukkit.craftbukkit.CraftServer.loadPlugin(
            at org.bukkit.craftbukkit.CraftServer.enablePlugins(
            at net.minecraft.server.MinecraftServer.e(
            at net.minecraft.server.MinecraftServer.a(
            at net.minecraft.server.MinecraftServer.init(
    In my experience with other plugins, this is an issue with building against CB or Bukkit, not sure about details.
  24. Offline


    i will do this now:
    1. i will delete the jar and the folder
    2. i will redownload the vouchers plugin from the website
    3. i will place only the vouchers.jar in my plugins dir
    4. i will edit here what happens

    EDIT; ok this time it seems like he also made the entrys for locations in the confi.
    but i was sure i have the latest version because it made an config entry and so on.
  25. Offline


    Hmmm I got up this morning and placed a sign to check the server log and it now works....go figure!

    EDIT: Broken again, tried /vtp name name in game and it didnt teleport, in addition it also broke vcheck and vcheckcom. I love this plugin but it seems pretty unstable at the moment.

    10:47:16 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'vcheckcom' in plugin Vouchers v1.5.1
        at org.bukkit.command.PluginCommand.execute(
        at org.bukkit.command.SimpleCommandMap.dispatch(
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(
        at net.minecraft.server.NetServerHandler.handleCommand(
        at net.minecraft.server.NetServerHandler.a(
        at net.minecraft.server.Packet3Chat.a(
        at net.minecraft.server.NetworkManager.b(
        at net.minecraft.server.NetServerHandler.a(
        at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
        at net.minecraft.server.MinecraftServer.h(
    Caused by: java.lang.NullPointerException
        at kforte318.Vouchers.Vouchers.onCommand(
        at org.bukkit.command.PluginCommand.execute(
        ... 12 more
  26. Offline


    I'm having a bunch of problems that appeared when I updated to 2.0 just now.

    I'm using bukkit 1000 and minecraft 1.7.3

    After I updated players got the "You don't have permission to buy vouchers" every time they clicked any block.

    This stopped when I gave them the new permission.

    When trying to buy a permission nothing happens and the console outputs this error:

    Error 1 (open)
    13:56:57 [SEVERE] Could not pass event PLAYER_INTERACT to Vouchers
    at kforte318.Vouchers.VouchPL.onPlayerInteract(
    at org.bukkit.plugin.RegisteredListener.callEvent(
    at org.bukkit.plugin.SimplePluginManager.callEvent(
    at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(
    at net.minecraft.server.ItemInWorldManager.interact(
    at net.minecraft.server.NetServerHandler.a(
    at net.minecraft.server.Packet15Place.a(SourceFile:57)
    at net.minecraft.server.NetworkManager.b(
    at net.minecraft.server.NetServerHandler.a(
    at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
    at net.minecraft.server.MinecraftServer.h(

    And lastly when I try to use the /vreload command it gives me the "An internal error" message in-game and the console gives me the following:

    Error 2 (open)
    13:59:34 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'vreload' in plugin Vouchers v2.0
    at org.bukkit.command.PluginCommand.execute(
    at org.bukkit.command.SimpleCommandMap.dispatch(
    at org.bukkit.craftbukkit.CraftServer.dispatchCommand(
    at net.minecraft.server.NetServerHandler.handleCommand(
    at net.minecraft.server.NetServerHandler.a(
    at net.minecraft.server.Packet3Chat.a(
    at net.minecraft.server.NetworkManager.b(
    at net.minecraft.server.NetServerHandler.a(
    at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
    at net.minecraft.server.MinecraftServer.h(
    Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
    at kforte318.Vouchers.Vouchers.onCommand(
    at org.bukkit.command.PluginCommand.execute(
    ... 12 more

    I have not edited the config file at all since deleting all the plugin data.

    I love this plugin and I want to get started adding my own vouchers!
  27. Offline

    Kevin Forte

    Man, I do not understand why I can test something for literally hours, have no problems, and then release it and instantly get flooded with errors xD I'll get to work.

    You are definitely not using the most recent version of the plugin, line 502 in kforte318.Vouchers.Vouchers isn't even in the onCommand method at the moment :p

    EDIT: Also, /vtp name name didn't work because you can only have either coordinates or one name, two doesn't work and I'll have to see why it didn't give you an invalid length of arguments error.

    Okay, so the message was my bad, I misplaced it in the code so it was displaying it at the wrong time. The /vreload is because you weren't using any arguments, and that was also my fault for not coding in more checks for that. Can you please repost the onPlayerInteract error after you update to 2.0.1? kforte318.Vouchers.VouchPL line 92 was "}", meaning I moved around some code while fixing the "You don't have permission to buy Vouchers" message and therefore am not sure what was causing the error.

    I'm pretty sure you need to delete your /plugins/Vouchers folder and let it re-create itself. It isn't finding any data in the "Hooked Commands" node in the config and that really shouldn't be the case if you have an updated version of the config.

    Updated to 2.0.1, a few issues fixed.

    Guys, I found a pretty big issue with this, so I don't suggest using it just yet.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 16, 2016
  28. Offline


    I'm assuming "this" is the latest bug fix version, and now I'm curious about that! :O

    I didn't update on the command list and as such didn't know that /vreload took arguments. I just assumed it was a straightforward reload command. If there's no arguments it should reload everything like the "all" argument.
  29. Offline

    Kevin Forte

    I'll release a fix right after I'm finished doing the 5 loads of laundry I'm in the middle of (getting ready to move away for college is a b!tch). That's a good idea, but I think I am going to leave it as is for a while.
  30. Offline


    still on 1.5 or something because you keep doing silly stuff :p

    So hopefully the next one works ;)
  31. Offline

    Kevin Forte

    I do keep doing very silly things, this one possibly the silliest xD

    Okay, updated to v2.0.2. CONSIDER THIS THE CURRENT RECOMMENDED BUILD OF THE PLUGIN. I apologize for all of the hectic releases lately, this one should be very stable.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 16, 2016

Share This Page