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

    Kevin Forte

    Do you have the latest version? I worked pretty hard on fixing that.
     
  3. Offline

    Domiiniic

    yes of course!
     
  4. Offline

    Kevin Forte

    Let me test a bit more.

    Version 1.4.3 released, all players are now notified when one uses a Timeshift voucher and you can now set aliases for the commands you tie to Vouchers.

    Can you please install the newest version (1.4.3) and test again? If it still doesn't work, please post the new error (since I edited the code the location of the error has changed since you last posted)

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

    Raycrash

    ok it seems signs are saved (1.4x) somewhat.
    Still vouchers are gone on server restart. ;(
     
  6. Offline

    Kevin Forte

    Alright, the most recent version is 1.4.4, try that and tell me if it's still wiped. Have you tried using the /vsave command? I really don't know why it's doing this to you, I have literally 0 problems with this on my own server.

    Nevermind! Problem solved in 1.4.4

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

    Pokey38

    I think I found a bug..My Members are reporting the Vouchers no permissions message popping up whenever they take fall damage, or fly using flymod, and there falldamage is being altered, if they fall and then use flymod to stop it, then still take damage. How Can I fix this bug? Its starting to annoy the members of my server.
     
  8. Good to see you're back Kevin, but did you forget about the buy-vouchers Permission nodes? You used to have them, but removed them :p
    Good to see you're back Kevin, but did you forget about the buy-vouchers Permission nodes? You used to have them, but removed them :p
     
  9. Offline

    Kevin Forte

    Update, it was fixed a couple versions ago :)

    I did forget, yes xD I'm going to remove the Vouchers.world and put the Vouchers.buy back. Next update :p
     
  10. Offline

    Raycrash

    Could you add a timer between uses of vouchers ? (timeshift especially)
     
  11. Offline

    Valiant

    K awesome! Just keep me posted on your progress! I am making a huge "economy" reveal on my server within the month, and I want this to be part of it :) Just has a few kinks to finish up ;)
     
  12. Offline

    Kevin Forte

    Very cool! I'm happy to have contributed :) I think I am going to re-add the .free though as opposed to changing the command, is that okay?

    It's possible.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 16, 2016
  13. Hey! I just found out about this plugin and this is pretty much what I need for my server. Though, theres one problem. The /vteleport is not exactly how I would like it to be, so I was wondering, is it possible to get the /vteleport to work with Warps? Basically, you can buy a teleport voucher to specific warp. For example, if I had a warp named warp1, I could right click a sign with /vtp warp1 to buy warps to that specific location?
     
  14. Offline

    Kevin Forte

    Hmm that sounds like a little much... If there is a command that you can use (with warps) that lets you teleport to a specific warp, you can set your own voucher type for that command. Say, if the command was /warp warp1, you'd specify the type as Warp1 and the command as warp warp1 and you'd be set.

    IMPORTANT: To anyone having issues with saving vouchers/shops, hold tight! In v1.5 (next update) the config.yml is handling everything, so you shouldn't have any more issues. It should be released by the end of the day.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 16, 2016
  15. Theres a plugin for warps which I would like to use with this. But since you said its possible, its all fine.
    Thanks.
     
  16. Offline

    Kevin Forte

    What I meant is that you can use that plugin and hook the commands associated with it so that you can, in fact, have Vouchers for all of your locations. :) (In case I didn't explain it well :p)
     
  17. I don't quite understand what you mean. I found out I can add vouchers for the /warp command, but can not specify it so there would be separate vouchers for each warp, so for example warp1 would have its own vouchers and warp2 would have its own vouchers. Guessing this is not possible though.
     
  18. Offline

    Kevin Forte

    Well it depends, how do you get to warp1? Is the command '/warp warp1'? In that case just set the command used to 'warp warp1' and it'll work.
     
  19. Offline

    Raycrash

    Great to hear that you found the bug now ;)

    Oh and it seem /vsave was also a good idea.


    And what about cooldown for voucher use ? (timeshift)

    And I got one more request there are plugins which are night dependet like mobhunt.
    Could you maybe look into it if theres a global flag which it sets or something so you can't change time and ruin the mobhunt ?
    If this is not included in mobhunt I will ask the dev to add it :p
     
  20. I tried adding this to the commands.txt
    Townwarp1:warp warp1
    Townwarp2:warp warp2

    Seems like I can now actually purchase Vouchers with name Townwarp1 and Townwarp2. Whatsoever, using the command /warp warp1 or /warp warp2 does not take any vouchers.
     
  21. Offline

    Bradley Hilton

    Saw your post about waiting for 1.5 and was curious as to when you expect it to come out as we're thinking and heavily considering using this plugin for our server.
     
  22. Offline

    Kevin Forte

    I can add a cool down, yes. Now that I am using the .config file, I can change add quite a few new things such as tweaking exact voucher settings and things like that. I do know what you mean, and it's possible I suppose if there are API hooks for it.
    Hmm, let me release the newest version and let me know if the problem persists.

    I expect it to come out right now. :)

    Updated to v1.5. You will have to delete the current config.yml file and let it recreate itself! If you would like to have your players' current vouchers saved, simply hold on to vouchers.txt and enter the values in manually after the config.yml is regenerated.

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

    Bradley Hilton

    You're the man! I'm going to probably add this tonight :)
     
  24. Offline

    Kevin Forte

    Good to hear! Let me know if you have any issues, questions, or suggestions. :)
     
  25. Offline

    Bradley Hilton

    Just a suggestion and curious, any way you should have a config or anything to charge people to create these? Maybe somehow set the price to make a shop. Cause right now the admins only create them, and mayors big towns want to create some for their residents. Any chance you could do this or have plans to?
     
  26. Offline

    Kevin Forte

    I could if you like, sure. I'll add a Vouchers.setupFree permission so that you can allow Admins to create them for free and a Shop Creation Cost line in the config.
     
  27. Code:
    2011-08-05 08:29:14 [SEVERE] Error occurred while enabling Vouchers v1.5 (Is it up to date?): null
    java.lang.NullPointerException
            at kforte318.Vouchers.Vouchers.loadHookedCommands(Vouchers.java:252)
            at kforte318.Vouchers.Vouchers.onEnable(Vouchers.java:299)
            at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:126)
            at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:878)
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:278)
            at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:162)
            at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:146)
            at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:284)
            at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:271)
            at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:148)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:335)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    
     
  28. Offline

    Bradley Hilton

    Sweet thanks!
     
  29. Offline

    Kevin Forte

    No problem :) I'll get on it right after I 1. figure out how to most cleanly do Voucher cool-down times and 2. fix NightClub xP

    Updated to v1.5.1, fixed more potential NPEs so an update is recommended.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 16, 2016
  30. Downloaded v1.5.1 and tried doing the same as I was trying before.
    Heres my config.
    Code:
    Shop Locations: ''
    Saved Vouchers: ''
    Hooked Commands:
        Townwarp1:
            Command: 'warp warp1'
            Alias: ''
        Townwarp2:
            Command: 'warp warp2'
            Alias: ''
    When I type /warp warp1 or /warp warp2, it does not give me a message that I don't have enough Vouchers nor even ask for them.

    The console gives this though.
    Code:
    [INFO] [Vouchers] ibab data does not exist for Townwarp2 vouchers.
    [INFO] [Vouchers] ibab given a starting value of 0 Townwarp2 vouchers.
    [INFO] [Vouchers] ibab data does not exist for Townwarp1 vouchers.
    [INFO] [Vouchers] ibab given a starting value or 0 Townwarp1 vouchers.
     
  31. Offline

    Bradley Hilton

    Question, how do I add my own vouchers while the game is going? Seems like every time I add them, they disappear when I reload..
     

Share This Page