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


    @Kevin Forte Just to let you know, you need to be able to see the 2 latest versions without a spoiler in the changelog (or just the latest one, ask Plague).
  3. Offline

    Kevin Forte

    Thanks for the heads up :)
  4. Offline


    Could you please add BOSEconomy?
  5. Offline

    Kevin Forte

    I knew someone would ask xP I'll see what I can do.
  6. Offline


  7. Immense will try this out later, have been looking for something like this. Hope its compatible with everything.
  8. Offline


    While I use iConomy, I know that you'll make many many people happy if you use Register to have support for more economy plugins ;)

    Also, looks like a great plugin, will try it out!
  9. Offline

    Kevin Forte

    Thanks :) And hmm, I've seen register. I'll look into it, because at this point in time I have no idea what it is/does x)
  10. Offline


    We're currently looking to set up something like this for our server. However I have a question. Would it be possible to have these vouchers rent or purchase a fixed use of access to certain permissions? For example, we have the commandbook plug-in which has the /thor ability. What we'd like to do is allow players to purchase a fixed number of uses for the /thor command and then, once they have used all of their turns, have it turn off again.

    Put simply, can you link this plug-in to other plug-in's abilities or are we restricted to just the abilities offered here?
  11. Offline

    Kevin Forte

    If you'll notice when you run the plugin the first time, it writes a config file that simply says 'Config: Coming Soon!'. What I plan on doing is allowing players to add in their own types and then link that type to a specific command, but I'm not positive about how to do that yet so it is on my wishlist at the moment.
  12. Offline


    Kevin, the functionality Tal is asking for exists in BuyAbilities plugin (originally by @rcjrrjcr). I recently revived it to work with iCo5 and some other bug fixes. It doesn't have the cool sign-based capabilities you have here, so if you'd be interested to add that to BuyAbilities, I'd be grateful for the help. :) Would love to have another maintainer on the project just to make sure it continues to stay active going forward.
  13. Offline

    Kevin Forte

    Very cool :) I'll definitely look into it, is BuyAbilities open source?
  14. Offline


    Yes, original author made it GPL3. It's posted in github. Would love to have the help, feel free to download it and have a look!
  15. Offline


    This is why I love coding communities. Get a few smart heads together and they make something awesome :) Hopefully you two will consider merging vouchers and buy abilities together and produce something truely robust and well supported!
  16. Offline


    Too bad, I use BOSEconomy...
  17. Offline


    Yeah same here. We don't have the tech knowledge to set up a MySQL server at the moment.
  18. Offline


    Can you make it so that you need the permissions node to buy a voucher in order to use it as well? I have a world where I don't want them to use vouchers, but with the way these permissions are set up, they can just buy them in one world where they are allowed, and then go use them in the other where they arn't allowed.
  19. Offline

    Kevin Forte

    Oh, man I didn't think of that. I always forget about multiworld... I can definitely do that for you really soon :)
  20. Offline


    Alright, thanks
  21. Offline

    Kevin Forte

    Updated to v1.1, Command-based Voucher Types and a Universal Use Permission added.
  22. Offline


    Can you add a function that allows you if some1 buys it he can use it only 5 times and not 4ever?
  23. Offline

    Kevin Forte

    That's the whole point of this plugin, you have to buy every individual use. :)
  24. Offline


    Cool idea, it would be awesome if there was an option to exchange gold ignots and diamonds for vouchers. Im trying to stay away from iConomy...
  25. Offline

    Kevin Forte

    I'll add it to the to do list :p
    Jacko! likes this.
  26. Offline


    I second this but only the gold ingots part. Diamonds are for tools.

    maybe the format should be like 1000:10 so you can buy 10 for 1000 but items first :D

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

    Kevin Forte

    I think that would be the format, yeah :p I'll probably make the item needed to pay configurable.
  28. Offline


    I am attempting to use the commands feature with commands generated using the commandhelper plugin. the voucher creates the sign, but gives an error when you type /vcheckcom It does not allow you to buy the commands.
  29. Offline

    Kevin Forte

    I honestly have no idea what CommandHelper is. What is the error?
  30. Offline


    Command helper:

    The plugin allows you to script your own commands and have them available in game. Its very useful for me to be able to create my own command using the scripts and I wanted to be able to allow the players to use them via vouchers. I edited the config file, and created the voucher sign without issue. when I right click on it, nothing happens. When I right click on the sign I get the following error in the console.
    2011-06-07 22:20:08 [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(
    I type /vcheckcom and it gives the error "An internal error occured while attempting to perform this command." I also get the following error in the console
    2011-06-07 22:21:15 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'vcheckcom' in plugin Vouchers v1.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

Share This Page