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.

    EXAMPLE:
    [​IMG]

    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:
    Code:
    Hooked Commands:
        MoneyCheck:
            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.

    Commands:
    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!

    To-Do:
    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.

    Permissions:
    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
    • Vouchers.free.(type in all lowercase) ~ Allows a player to use a Voucher command without needing the actual voucher.
    • Vouchers.buy ~ 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.

    Changelog:
    v2.2.1
    • Quick Bug Fix.
    v2.2
    • 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

    v2.1.1
    • Plugin will disable itself if an economy plugin is not found.
    v2.1
    • Thunderpunch Voucher added.
    • Voucher descriptions added.
    • /vhelp [voucher type/sign] command added.
    • Bug fix.
    v2.0.2
    • MAJOR Bug Fix. Consider this the recommended build of Vouchers.
    v2.0.1
    • 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.
    v2.0
    • 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.
    v1.5.1
    • Fixed more potential NPEs. Damn things always sneak up on me.
    v1.5
    • All data is now handled with the config.yml in the plugins/Vouchers folder.
    • 'Vouchers.world' permission removed due to redundancy.
    • 'Vouchers.free.[type]' re-added.
    • 'Vouchers.buy' permission added.
    • NPE problem REALLY solved. Seriously.
    v1.4.4
    • NPE problem (when using command vouchers) Finally solved.
    v1.4.3
    • All players are now notified when one uses a Timeshift voucher.
    • Command aliases have been added.
    v1.4.2
    • 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.
    v1.4.1
    • Vouchers.world 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.
    v1.4

    • Removed the Vouchers.free.(type) 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.
    v1.3

    • Times that /vtime sets the world to changed for longer days/nights.
    • PERMISSION NODES CHANGED: BE SURE TO UPDATE YOUR WORLD.YML
    • Players must be holding shift (sneaking) for a Resurrect voucher to be used.
    • (Hopefully) Fixed the issue with command voucher arguments.
    v1.2.2

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

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

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

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

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

    Asianator

    Yeah basically, or if I could get the voucher to work with having the player enter in the argument, cause I just need something to put in the vouchers to sell commands with names in them.
     
  3. Offline

    Kevin Forte

    Hm, I would say put in the command and argument into commands.txt. So if it's /money pay blah 5, just use Payment:money pay
     
  4. Offline

    Asianator

    The problem is, is that if I do that then they only need a voucher for the command /money pay, and not for the command /money pay <NAME> 5 if they typed in /money pay <NAME> 5 they could use it as many times as they wanted
     
  5. Offline

    Kevin Forte

    You may be right. To be honest, I haven't done extensive testing of the command things; I'm going to fix it up soon though.
     
  6. Aww no fix for the Resurrection issue yet? :(
     
  7. Offline

    Kevin Forte

    Damn, forgot about that! What was that issue again?
     
  8. When fall damage is disabled in WorldGuard, and you drop from height, it takes a Resurrect voucher :/
     
  9. Offline

    Kevin Forte

    Oh! I think I attempted to fix that, did it not work? I tried to have it check if the event was cancelled first before it used a Voucher.
     
  10. Yes and I posted that it didn't fix the issue :p
     
  11. Offline

    Forecaster

    I would like essentials economy support!
     
  12. Offline

    King Rat

    Just updated, great work on the Sunshine voucher!
     
  13. Offline

    Kevin Forte

    Damn xD
    Ehh, maybe I'll look into it soon.
    Cool, and thanks :)
     
  14. Offline

    Forecaster

    "Ehh maybe"? D:

    Why not include support for essentials economy?

    I'd really prefer not having to use iConomy when I already have a functioning economy system in essentials.

    I'd really appreciate it if you added it!
     
  15. Offline

    Kevin Forte

    Okay, so I tried to say 'no' for once to a request, but now I feel all bad xP I'll look into it by the end of the day for you, because I have a few other things to do :p
     
  16. Offline

    TorchedBlack

    I added two custom vouchers a home and a set home set up like this in the commands.txt

    Code:
    SetHome:sethome
    Home:home
    
    I created the sign shops just fine, but when anyone on the server, including myself goes to buy the voucher nothing happens. This is what shows up on the console

    Code:
    10:19:31 [SEVERE] Could not pass event PLAYER_INTERACT to Vouchers
    java.lang.NullPointerException
            at kforte318.Vouchers.VouchPL.onPlayerInteract(VouchPL.java:207)
            at org.bukkit.plugin.java.JavaPluginLoader$10.execute(JavaPluginLoader.java:307)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:321)
            at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:168)
            at net.minecraft.server.ItemInWorldManager.interact(ItemInWorldManager.java:213)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:563)
            at net.minecraft.server.Packet15Place.a(SourceFile:57)
            at net.minecraft.server.NetworkManager.b(NetworkManager.java:223)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:451)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    
    I am running bukkit 935
     
  17. Offline

    Kevin Forte

    Are you using the most recent version of the plugin? Line 207 of the code in the Player Listener is currently '}'.
     
  18. I get this error on latest:

    Code:
    2011-06-29 10:06:09 [SEVERE] Could not pass event ENTITY_DAMAGE to Vouchers
    java.lang.NullPointerException
            at kforte318.Vouchers.VouchEL.onEntityDamage(VouchEL.java:23)
            at org.bukkit.plugin.java.JavaPluginLoader$55.execute(JavaPluginLoader.java:628)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:321)
            at net.minecraft.server.EntityLiving.a(EntityLiving.java:503)
            at net.minecraft.server.EntityHuman.a(EntityHuman.java:876)
            at net.minecraft.server.Entity.a(Entity.java:656)
            at net.minecraft.server.EntityPlayer.b(EntityPlayer.java:360)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:368)
            at net.minecraft.server.Packet10Flying.a(SourceFile:126)
            at net.minecraft.server.NetworkManager.b(NetworkManager.java:223)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:451)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    
     
  19. Offline

    Kevin Forte

    Well, I have absolutely no idea how that could possibly return null. Do me a favor; Re-download the JAR and try it again?
     
  20. Offline

    Forecaster

    Thank you for considering essentials economy support!

    Now for something completely different!

    I'm unsure how the plugin operates.
    I read in a previous post that a user must have permission to use a command via a voucher.
    It also seems it prevents use by anyone even if you have the permission, unless you have a voucher.
    Is this so?

    If so wouldn't it be better to do something like command signs?
    They have a fake user with special permissions. You can tell a sign to elevate the activators permissions to those of the fake user to enable use of the command. But if they try to use it without the sign they wont have access.

    It would be neat if a command activated through a voucher would elevate the users permissions so they can use it that time. But using the command without a voucher would be prevented unless you have permission (as an admin would).

    Unfortunately I know nothing of java, so I can't tell you how command signs does it :p
     
  21. Offline

    Kevin Forte

    I have absolutely no idea what you mean, but no worries; I'm going to have Voucher bypass nodes in the next update.
     
  22. Offline

    frotlops

    I Love this PLUGIN! So Awesome :p Thank you Kevin!
     
  23. Offline

    Kevin Forte

    Thanks, glad you like it! :D
     
  24. Offline

    Emmett97

    All the vouchers work except for /vtp which gives me the following error:

    2011-07-01 14:39:57 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'vtp' in plugin Vouchers v1.2.2
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37)
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:129)
    at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:298)
    at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:711)
    at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:676)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:669)
    at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:33)
    at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:84)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:451)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    Caused by: java.lang.NullPointerException
    at kforte318.Vouchers.Vouchers.onCommand(Vouchers.java:525)
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
    ... 12 more
     
  25. Offline

    Kevin Forte

    Did you put a player's name or x y z location after /vtp? That would be the only reason I can think of that would cause this to happen (incorrect command syntax).
     
  26. Offline

    Emmett97

    I just did /vtp test to see if it would what it would do, I thought it just wouldnt teleport you, didnt think it would also error.
     
  27. Offline

    Kevin Forte

    It probably did that because it couldn't find the player. Sometimes I forget to account for things like that. Try it with an actual player and let me know what happens.
     
  28. Offline

    redworld2

    So I downloaded the jar and the folder came up all was good and I was just trying out to see if the signs worked. I did one of the examples that you have but when i put it in the [Vouchers] does not change blue and the bottom line does not turn white. I was wondering if the plugin ColoredSigns was affecting this? Thanks
     
  29. Offline

    Kevin Forte

    Probably, I have read about someone having conflicting plugins here.
     
  30. Offline

    Tov

    You don't need to give permission to the actual power, only to this plugin.

    for example:
    You do not give the permission for essentials.time
    You give the permission for vouchers.enabled
    The players are not using normal commands to accomplish these things.

    As admin, I use /time day to change the time.
    Players must use /vtime day and it costs them a voucher. They still have no access to /time day.

    Hope that helps!
     
  31. Offline

    Kevin Forte

    I think what he means is for the command integration, where you Would be using the actual command. In that case, they do need the permission but like I said I am going to have a vouchers.bypass node soon for admins.
     

Share This Page