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

    It's fine, and no, the players do need to have the permission for the command to use the voucher. :)

    This confuses me beyond giving you any sort of reasonable answer xP Maybe delete your Vouchers data folder and let it regenerate itself?

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

    King Rat

    Yeah, Ill do that :3 My server just kicked itself in the face, so I'll just install a bunch of plugins from scratch o.o
     
  4. Offline

    Kevin Forte

    Hahaha, alright. Let me know if it fixes itself, I'm really confused xD

    Updated to version 1.2,
    Superpick voucher added, and now you can gift vouchers to other players.

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

    mattekure

    It seems there is some kind of bug with choosing your own commands. I used the command /stack so that players can buy vouchers to use it. Once I added it to the list of vouchers, I (as admin) could no longer use it. The voucher system needs to let admins or those with permissions to the command use it even if they dont have a voucher, and only check the voucher if they dont have permissions to use it already. Hopefully that makes sense.
     
  6. Offline

    Nicolasgreen17

    This is the error I get. I updated to the newest release to see if the error would fix itself. Now I can purchase my commands but no other player can. This is the error I get:
    Code:
    2011-06-13 23:07:01 [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:306)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:310)
        at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:166)
        at net.minecraft.server.ItemInWorldManager.interact(ItemInWorldManager.java:212)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:550)
        at net.minecraft.server.Packet15Place.a(SourceFile:57)
        at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
        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:399)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:309)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
     
  7. Offline

    Kevin Forte

    It does make sense. I'll add a permission node for that, but (as an admin on my server) I try and stay as equally powerful as the players as possible for fairness, and therefore I don't want admins to have override by default. I'll work on some sort of exempt node. :)

    Apparently, it isn't giving a player a default value of 0 vouchers when they join. I'll look into that.

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

    jamyson7

    This may seem like a stupid question, but if we set up a home teleport command voucher
    With /home as the command
    HomeTele:home in the command.txt folder
    Do we enable or disable the essentials.home node for permissions?
    I cant seem to make my sign sell vouchers properly.
    Nor does my /vcheckcom work, if thats any help.
    Thanks
     
  9. Thanks!

    Request: permission node for /vgift ;)
     
  10. Offline

    Kevin Forte

    You would enable it, and gah, any console errors? I have no issues at all and everyone else seems to be having problems.

    Can do :p
     
  11. Bug:

    Made a sign for Resurrect, 1000 currency. I could purchase fine, but it did not cost anything.

    Tested a Protection and Parachute sign, that did charge properly. Perhaps only bugged in Resurrect?

    ===

    Timeshift also does not charge me.
     
  12. Offline

    redworld2

    Hi, I was looking at your plugin and it looks great! I downloaded it and put it into my Brohoster TCAdmin plugins folder. Everything went smoothly. I add as a test Home:home set to the commands.txt I then went onto my server a did [Vouchers]
    Home
    350
    /home set
    After I did that nothing had changed and it was just black letters. So, I tried one of the examples above (Heal). I finished and the same thing happened, so I clicked on it nothing happened. Then I tried /vheal and it said An internal error occurred while attempting to perform this command. Do you have any idea what is not working? Thank you

    EDIT: I do have Iconomy v5 and Permissions 2.7 (I think that is the version)
     
  13. Offline

    Kevin Forte

    Can you show me a screen shot of the signs?

    Can you show me the error that occurred? (I'm not familiar with Brohoster so I'm not sure how much control you have with that.)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 16, 2016
  14. Either I was blind, or it fixed itself with a full restart instead of reload...works now :<

    Now just the gift node :D (and ideally a node per voucher type)
     
  15. Offline

    redworld2

    Yeh that is the problem I never see my server get started up, only a sign the says it is active. Do you have a suggestiongs or should I redownload the jar file?
     
  16. Offline

    Kevin Forte

    I would just delete the data folder (if you can) and redownload the jar.

    I'll work on it :p

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

    redworld2

    By data folder you mean the Vouchers folder? (Includes commands.txt, shops.txt, config.yml, and vouchers.txt) Also, what does the shop.txt do?
     
  18. Offline

    Kevin Forte

    Yeah, and shops.txt stores the locations of the the shops.
     
  19. Offline

    redworld2

    But, how do you define an area as a shop?

    So I re downloaded it and deleted my old data folder. I went back on and gave it a little test. First, I put it in in the wrong format to see what if it would respond and it did saying it was the wrong format. So, I tried the proper way and nothing happened just black letters on a sign.... :(

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

    Kevin Forte

    It will automatically save if it is truly formatted correctly... can you take a screen shot of your "proper formatting"? I just tested the newest update of this to ensure that shop creation and persistence is functional and it is for me.
     
  21. Offline

    redworld2

     

    Attached Files:

  22. Offline

    Kevin Forte

    I honestly have no idea! That should work. Are you using any color codes or anything before the text? Any weird spacing?
     
  23. Offline

    redworld2

    I do have a sign coloring plugin but I did not use it for the Vouchers' signs. I don't think there is any weird spacing fro then it would say wrong format?
     
  24. Offline

    mattekure

    I posted in the CommandHelper forum to see if they had any insight. When you get a chance @wraithguard01 mentioned he'd work with you to get both plugins working together. Thanks much

    Code:
    from commandhelper thread:
    
    CommandHelper dynamically registers commands, other than the built in commands, such as /alias and others. The plugin itself doesn't define any other commands, so it would be up to the voucher plugin to work with CH. Having said that, if the voucher plugin author gets in touch with me, I will gladly see if we can work together to get both plugins cooperating.
     
  25. Offline

    Kevin Forte

    I am perplexed. xD Is anyone else having this problem?

    I'll get in touch with him when I have a chance, thanks though :p

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

    King Rat

    Like I said before, I was sure the ColorSign plugin was affecting it... the moment someone changed the colour, the sign stopped working.
     
  27. Bug:

    With Fall damage disabled, the resurrect voucher is used when someone falls, yet takes no damage.
     
  28. Offline

    Kevin Forte

    I'll take a stab at fixing that one.
     
  29. Offline

    aquacold

    what is the super pick cmd?

    lol fail nvm
     
  30. Offline

    Kevin Forte

    Lol /vsp ;)
     
  31. Offline

    aquacold

    hehe sorry man :)
     

Share This Page