[INACTIVE][ECON/FUN] BuyAbilities v0.8.9 - Purchase Abilities [740]

Discussion in 'Inactive/Unsupported Plugins' started by rcjrrjcr, Mar 31, 2011.

  1. Offline



    BuyAbilities - Purchase Abilities:
    Version: v0.8.9

    BuyPermissions is a plugin that allows your players to purchase abilities or permissions with iConomy/EssentialsEco/BOSEconomy money! This way, players can finally have a long-term investment for their virtual money, instead of spending it on items. Also, the time-based and use-based rent systems allow temporary access to permissions.

    Abilities are groups of related permission nodes, which are granted to the player upon purchase. Abilities are also grouped into categories, which the server admins can deny or allow access to via permissions.

    Original Suggestion Thread
    Purchasable Permissions/Abilities

    • Rent abilities for a specified duration
    • Purchase uses of an ability and its associated commands
    • Purchase abilities permanently and retain its benefits forever (theoretically:p)


    Source Code

    • An economy plugin (iConomy 4, EssentialsEco, BOSEconomy)
    • A permissions plugin (Permissions 2.7, GroupManager)
    Usage Instructions:

    • Plugin commands are "/bab" and "/buyab". Each can be used instead of the other.
    • From player's chat:
      • "/bab categories" returns all accessible categories.
      • "/bab category <categoryname>" returns all abilities in the category.
      • "/bab page" lists all accessible abilities.
      • "/bab current" lists all active abilities.
      • "/bab buy <abilityname>" buys an ability.
      • "/bab rent <abilityname>" rents an ability for a period of time.
      • "/bab rentuse <abilityname>" purchases uses of an ability.
      • "/bab info <abilityname>" returns information about that ability.
      • "/bab help <abilityname>" returns the help text about that ability.
    • From server console:
      • "/bab listall" prints out a list of all active abilities for all players.
      • "/bab status" prints out the current status of the hooks into the permissions and economy plugins.
    • For admins:
      • To allow usage of the /bab command, grant the permission "buyabilities.use".
      • To allow access to a category, grant the permission "buyabilities.abilities.<categoryname>" where <categoryname> is the name of the category, with periods replacing spaces.
      • NOTE: A user can access an ability if he can access any single one of its categories. It does not matter if he can access its other categories, just one.
    • NOTE: If an ability or category name is misspelled, this plugin will provide suggestions for the correct spelling of the name.
    Version 0.8.9
    • Fixes ability removal bug. Iterators finally get a use.
    Show Spoiler
    Show Spoiler

    Version 0.8.8
    • Update for CB 740.
    Version 0.8.7
    • ?
    Version 0.8.6
    • Fixed regex matching whole string bug
    Version 0.8.5

    • Fixed bugs because of Permissions caching old permissions.
    Version 0.8.4

    • Fixed NPE when saving player data
    • Fixed permissions bug
    • Added BOSEconomy support.
    Version 0.8.3

    • Fixed data.yml not being created.
    Version 0.8.2

    • Removed interfering code from another git branch.
    Version 0.8.1

    • Fixed cost data not loading.
    Version 0.8

    • Auto-loading and auto-saving of player data during join/quit events.
    Version 0.7.3

    • General fixes.
    Version 0.7.2

    • Recompile for CB 617.
    Version 0.7.1

    • Recompile for CB 602.
    Version 0.7

    • Added suggestions for ability/category names in case it is misspelled.
    Version 0.6

    • Added usage counters.
    Version 0.5.6

    • Changed package names to conform to Java's naming conventions.
    Version 0.5.5

    • Minor optimisations.
    Version 0.5.4

    • Abilities can belong to multiple categories.
    Version 0.5.3

    • Fixed another NPE due to FakePermissions confusing the plugin.
    • Added permissions to use /bab.
    • Changed category permission format.
    Version 0.5.2

    • Fixed actual cause behind NPE.
    Version 0.5.1

    • Fixed NPE bug when hooking into economy.
    Version 0.5

    • First release. Permissions unsupported though.
    Version 0.01

    • First announced version. Not working yet.

    2. Better and easier implementation of ranks
      • Add requirements for rank advances
    3. Graphical editor for costs.yml
    4. Scripts for activation/deactivation.
    Suggestions and ideas are welcome!


    I would like to credit the people whose code I used:

    Report bugs by enclosing the exception's stack trace, your costs.yml and data.yml in spoilers.
  2. Offline


    Would it be possible to group abilities, and only allow them to know one group at once?

    I want to use this plugin with MagicSpells, but I want to make the users choose which to buy - offensive spells, or defensive/support spells - and allow them to purchase the other group, erasing their abilities for the previous group.
  3. Offline


    I installed buyabilities. It is a very interesting plugin but he does not work for the those who are not admins. My players have the permissions:

    - 'buyabilities.use'
    - 'buyabilities.abilities.some.random.category'
    - 'buyabilities.abilities'

    But can reach no command. They do not see the categories, cannot buy, rent...
  4. Offline


    Heres what ive got.
    name: 'Gatekeeper'
    description: 'Allows the use of the stargates'
    help: 'Type /dial xxx to go to another world'
    - 'wormhole.use'
    - 'wormhole.use.dialer'
    - 'wormhole.use.sign'
    - 'basic'
    cost: 1000
    I can buy the ability and use it, but when i relog or the server restarts it says i dont have permission to open the gate. So i try to buy the ability again, and it says i already have it. Let me know what im doing wrong.
  5. Offline


    REQUEST: Could you make an option for abilities to cost items and/or iconomy cash as well? I want to use this for a team fortress style pvp game using the Fight plugin, players will be given a certain number of items with their class specific inventory, those items are then used with BuyAbilities to buy specific abilities for their class. .... please! This would make our game nights even better!

    EDIT: ok I read a few pages back ... how far off do you think (if ever) is an item cost? ... thanks!

    QUESTION: I haven't totally setup my files yet, so I was wondering before I let it loose on the server ... does the plugin attempt to end the abilities (ie god, fly) when the time runs out? perhaps another setting in the config file for a command that the plugin should run as the buyer to end the power ... so people could put something like:
    endcommand: '/ungod'
    endcommand: '/fly'
  6. Offline


    wow, i was looking for a plugin like these :)

    one question: if a user is buying a permission, but then he switches the permissions-group which doesnt have the permissions to buy this permission, is he still able to use it?

    and what is if i grant a player to buy permissions ins world1 but not in world2 ?
  7. Offline


    How goes the iConomy 5 support for this? Been managing all my player licenses manually so far, just taking the money and adding the permission nodes, but as we get more and more nodes, it's becoming a little crazy!
  8. Offline


    it just tells me, it have not the permissions for creating the data.yml
    does it work with CB766?

    > 17:36:50 [INFO] plugins/BuyAbilities/data.yml not found.
    > 17:36:50 [INFO] Creating plugins/BuyAbilities/data.yml...
    > 17:36:50 [SEVERE] java.io.IOException: Permission denied

    full error:
    Show Spoiler
    > 17:36:50 [INFO] Done (1.174s)! For help, type "help" or "?"
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:260)
    at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:145)
    at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:205)
    at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:218)
    at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:109)
    at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:131)
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:249)
    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:676)
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:127)
    at com.rcjrrjcr.bukkitplugins.buyabilitiesplugin.BuyAbilities.onEnable(BuyAbilities.java:93)
    > 17:36:50 [SEVERE] null loading BuyAbilities v0.8.9 (Is it up to date?)
    > 17:36:50 [SEVERE] at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
    > 17:36:50 [SEVERE] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:260)
    > 17:36:50 [SEVERE] at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:145)
    > 17:36:50 [SEVERE] at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:205)
    > 17:36:50 [SEVERE] at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:218)
    > 17:36:50 [SEVERE] at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:109)
    > 17:36:50 [SEVERE] at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:131)
    > 17:36:50 [SEVERE] at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:249)
    > 17:36:50 [SEVERE] at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:676)
    > 17:36:50 [SEVERE] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:127)
    > 17:36:50 [SEVERE] at com.rcjrrjcr.bukkitplugins.buyabilitiesplugin.BuyAbilities.onEnable(BuyAbilities.java:86)
    > 17:36:50 [SEVERE] at com.rcjrrjcr.bukkitplugins.buyabilitiesplugin.BuyAbilities.hook(BuyAbilities.java:204)
    > 17:36:50 [SEVERE] at com.rcjrrjcr.bukkitplugins.buyabilitiesplugin.storage.StorageFactory.getInstance(StorageFactory.java:11)
    > 17:36:50 [SEVERE] at com.rcjrrjcr.bukkitplugins.buyabilitiesplugin.storage.StorageYaml.(StorageYaml.java:31)
    > 17:36:50 [SEVERE] at java.io.File.createNewFile(File.java:900)
    > 17:36:50 [SEVERE] at java.io.UnixFileSystem.createFileExclusively(Native Method)
    > 17:36:50 [SEVERE] java.io.IOException: Permission denied
    > 17:36:50 [INFO] Creating plugins/BuyAbilities/data.yml...
    > 17:36:50 [INFO] plugins/BuyAbilities/data.yml not found.

    [email protected]: now it works - dont understand that

    REQ: A player can only have X permissions of a category at the same time. That way he have to choose. If he buy (buy, not rent/use) he will not be able to loose this permission, so he have left only x-1 options
  9. Offline


    hello @rcjrrjcr, are u still developing this plugin? :)
  10. Offline


    Hope to see an update soon :)
  11. Offline


    Well I was thinking of tackling the iConomy5 update for this myself, using @Nijikokun 's awesome Register module:

    But it turns out that @rcjrrjcr already has similar functionality built into some utility methods for this plugin (but his don't support iConomy5 yet), so it's not as simple as just plugging in Register like I'd hoped. I may still take a cut at it, but before I spend my time doing what will be some serious rip&replace of the economy sections of this pluggin, posting in hopes that maybe @rcjrrjcr has an iConomy5 update right around the corner?
  12. Offline


    @rcjrrjcr I see the latest checked in version for GIT is v0.8.4 and then the development HEAD. It looks like the HEAD branch is mid-dev and not suitable for just doing a few mods to support iConomy5. Any chance you could just check in the latest working v0.8.9 release to GIT so I could take a cut at modifying that to support iConomy5 without having to pick up mid-dev against the work you were doing on HEAD?

  13. Offline


    What do you do for something like god mode? For example, if someone rent's the ability '/god' and they use it: the permission will go for only 30 min (so it will stop working after they log out and back in), but the ability won't actually stop working till the player executes /god again.
  14. Offline


    This mod is abandoned.
  15. Offline


    @superzanti : in theory, the mod should offer an "off" command, such that when the command finishes, it can automatically turn an ability (like god mode) off.

    @tassox33: I agree. I'd love to pick it back up, but the latest "stable" source never got checked in. There's only an old version and the latest dev work, which doesn't appear to have ever worked. If original author could login long enough to check in the latest (2.2.8) stable source, I'd get iConomy5 working and post an update somewhere. :/
  16. Offline



    > 02:49:32 [INFO] Ending world save
    > 02:49:31 [INFO] Ending world backup
    > 02:49:31 [INFO] at java.lang.Thread.run(Thread.java:636)
    > 02:49:31 [INFO] at org.bukkit.craftbukkit.scheduler.CraftWorker.run(CraftWorker.java:34)
    > 02:49:31 [INFO] at org.desmin88.simplesave.SimpleSave$BackupMethod.run(SimpleSave.java:137)
    > 02:49:31 [INFO] at org.desmin88.simplesave.Backup.backup(Backup.java:41)
    > 02:49:31 [INFO] at org.desmin88.simplesave.FileUtils.copyDirectory(FileUtils.java:125)
    > 02:49:31 [INFO] at org.desmin88.simplesave.FileUtils.copyDirectory(FileUtils.java:156)
    > 02:49:31 [INFO] at org.desmin88.simplesave.FileUtils.copyDirectory(FileUtils.java:230)
    > 02:49:31 [INFO] at org.desmin88.simplesave.FileUtils.doCopyDirectory(FileUtils.java:263)
    > 02:49:31 [INFO] at org.desmin88.simplesave.FileUtils.doCopyDirectory(FileUtils.java:265)
    > 02:49:31 [INFO] at org.desmin88.simplesave.FileUtils.doCopyFile(FileUtils.java:290)
    > 02:49:31 [INFO] at java.io.FileInputStream.(FileInputStream.java:137)
    > 02:49:31 [INFO] at java.io.FileInputStream.open(Native Method)
    > 02:49:31 [INFO] java.io.FileNotFoundException: world1/players/_tmp_.dat (No such file or directory)
    > 02:49:31 [INFO] BuyAbilities: Player "Tara"'s data saved.
    > 02:49:31 [INFO] Beginning world save
    > 02:49:31 [INFO] Unloading player "Tara"'s data!
    > 02:49:31 [INFO] Player "Tara" quitted!
    > 02:49:31 [INFO] Beginning world backup 
    i have CB766 and BuyAbilites 0.8.9
    at time nothing more i can say about the error :(

    i would be glad if u could do that...
  17. Offline


    I'm working on it and I have it running on a local server with iConomy5 and have it mostly working. There are still a few bugs to iron out, such as purchased abilities not saving/restoring 100% of the time across server reboots. I'll try to get some more bugs ironed out and then figure out how to share it with you all.

    Thanks to @rcjrrjcr for responding to my plea to post the most current v0.8.9 source - he did so and it was a big help to getting things working again!
  18. Offline


    You can put it on git hub or if you need some web space to store the file I can help with that.
  19. Offline


    @rcjrrjcr I have this working now with iConomy5 (using @Nijikokun 's Register) and implemented the Bukkit DB storage stuff (StorageEBeans) so that's all working now. Also did some cleanup in the RcjrUtil for Essentials 2.2.18+ and better direct support for GroupManager (which I use for now, will switch to Perms v3.0 in the future). It all seems to be working well in my tests and I'm getting ready to install it on my server and set it loose on my players for more testing. :)

    Would you prefer I post it in my own github or do you want to give me write access to yours so I can just keep updating the existing locations? Maybe I can figure out how to publish a merge request to you, I'll look into it.
  20. Offline


    Sir I love you give him a day or post now the sooner the better
  21. Offline


    Alright I've tested my release enough that I'm willing to put it out there as 0.9.0. You can get the file here:


    Source repository is here: git://github.com/morganm/BuyAbilities.git (I've sent a pull request to @rcjrrjcr in case he wants to pull it into his repository and continue to maintain)

    Show Spoiler

    v0.9.0 - morganm
    * integrated Nijikokun's Register module (iConomy5 support)
    * bukkit ebean support for serializing user data
    * fixes to support Essentials 2.2.18+
    * other bug fixes
    * debug messages cleanup (converted to Logger log.fine())

    Feel free to test and let me know if you run into issues. I've only done some local testing so no promises about it working, but would love any feedback if things break!

    OK I have my 0.90 release running on my real server now (iConomy5), and I just gotta thank @rcjrrjcr once again for making this great plugin in the first place. I love it, my players love it - it rocks! I'm happy to have done some small part to get it working again. Please let me know if anyone else has issues, but hopefully the mod is back in good working shape again!

    ps. @rcjrrjcr if you want to update the thread title, I'm running on [803] so it's confirmed working there.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 13, 2016
    Taranis01 likes this.
  22. Offline


    It doubles Players and Permissions.

    It prevents me (OP) from using many Commands from different Plugins.


            group: Admins
            group: Spieler
            permissions: []
                - 'essentials.top'
                - 'essentials.jump'
                - 'essentials.top'
                - 'essentials.jump'
  23. Offline


    Any additional details? I assume you're using latest 0.9 version? You should see something like this in the log: 'BuyAbilities version 0.9.0' It also looks like you're using essentials? It would be great if you could pastebin your startup messages from server.log, most mods report their versions there, as well as a pastebin of your permissions or GroupManager config.

    Though I didn't write the mod originally, from the code I see for both GroupManager and Permissions, the mod just uses an API to set the permissions, so it's not doing anything with your files and shouldn't be causing "duplicates" that the API's themselves wouldn't allow. It does seem suspicious that you have both upper and lower case names in the same file, but I won't know until I see the rest. I've been unable to replicate any duplicate permissions issue in the bit of testing I've done.
  24. Offline


    Seems to work, thank you very much :)
  25. Offline


    From now on, @morganm will be maintaining this plugin. I might come back and help a little, but for now, I have enough on my hands with Permissions 3.0.
  26. Offline


  27. Offline


    Hi , i love this Plugin :D , i have one thing,
    I use your Plugin on my server and want to Build it in, in my Quest system! can u add a command that removes a permanetly buyed permission from bab ? > like /bab remove Jump, with an permission for /bab remove < i want this sooo much x)

    it would be verry nice when this is possible

    what you think can/ will you do it ?

  28. Offline


    lol, the spoiler :)

Share This Page