AbilityTrader
About
AbilityTrader allows your players to buy and rent commands and permissions using an economy or experience points.
This plugin was created because the server I run has a particular problem with a few players having significantly more money than the rest, so having this plugin allows them to get a few more features and reduces their balance accordingly.
Setup
Copy AbilityTrader.jar into your plugins directory. The first time it runs, a configuration file will be created in AbilityTrader/config.yml. You should edit this to add abilities that you want to sell or rent to players.
Permissions
abilitytrader.use- Allow players to use AbilityTrader (default: true)abilitytrader.showhidden- Allow players to see hidden abilities in the list (default: op)abilitytrader.admin.reload- Reload the configuration (default: op)abilitytrader.admin.players- See a list of players and abilities they have (default: op)abilitytrader.admin.add- Add abilities to players (default: op)abilitytrader.admin.remove- Remove abilities from players (default: op)abilitytrader.admin.*- Provides showhidden, reload, players, add and remove permissions (default: op)
Commands
There are very few commands for AbilityTrader - type /ability help for a short list. All of these work (with the exception of info, rent and buy) on the console as well as in-game.
For administrators, you can view a list of players with abilities by typing /ability players - this will show all players with abilities, along with their expiry times if applicable. You can also reload the configuration file with /ability reload if you make any changes to the file itself.
Administrators are also able to remove player abilities without having to manually edit the file. To do this, type /ability remove <player> <ability>. You will see error messages if something goes wrong.
Administrators can also give abilities to players by typing /ability add <player> <rent/buy> <ability> <true/false>. The true/false at the end determines whether AbilityTrader should charge the player for the ability (it won't charge the administrator).
Alternatively, you can use /ab, /at or /abt as a shortcut to /ability.
Configuration
The default configuration is as follows:
log: false
page_results: 10
global:
commands:
add: []
remove: []
abilities:
workbench:
description: No need for real workbenches any more!
permissions:
- essentials.workbench
commands:
add: []
remove:
- msg {0} Removing workbench ability
rent_cost: 100
duration: 300
me:
description: Say stuff third-person style
permissions:
- essentials.me
commands:
add: []
remove: []
buy_cost: 5000
rent_cost: 15
duration: 60
hat:
description: Look dapper in your choice of hat
groups:
add: Fashionable
remove: PREVIOUS_GROUP
permissions:
- essentials.hat
buy_cost: 1000
players: []
You should add abilities that you want to buy or rent under the abilities section. Keep the ability name short and meaningful. You can expand on what the ability provides with the description.
Each ability can assign zero or more permissions to players. If you don't want to give any permissions, just set this to permissions: [].
Each ability can also execute commands when abilities are added and removed (when players buy/rent, and when they expire, if rented). Again, this can be one or more commands, or none at all. You can use the placeholder {0} to pass the player's name to the command. This is useful if you want to message them when the ability is removed, etc. The commands should not have a slash (/) at the start, and will be run automatically when a player buys or rents an ability, and run automatically when abilities expire or admins remove them from players, if any remove commands have been specified. You can also use additional placeholders for commands - {1} is the ability name, {2} is the price of the ability (if they rented, it'll be the rent price - if they bought, it'll be the buy price), and {3} is the same as {2} except it includes currency formatting (i.e. adding $ to the amount, or however you have your economy setup. If you're using experience, it will suffix the cost with 'exp'). Global commands can be run as well as or instead of individual ability commands. The special placeholders work here too.
You can specify a rent price and buy price with money or experience, either individually or together. If renting, simply call this rent_cost. For buying, it's buy_cost, and if you want to allow buying and renting of the ability, just specify both options. If you prefer to use experience points rather than an economy system, use buy_exp and rent_exp.
The duration specifies (in seconds) how long a player will have the ability for. After this time, the ability will be removed and any remove commands will be executed. The duration only applies to rentable abilities.
Each ability can optionally move players to and from groups when adding or removing the ability. You can only specify one group when adding or removing (multiple groups wouldn't make sense). An example can be seen for the hat ability above. This example uses the special keyword _PREVIOUSGROUP - if that's specified for the 'remove' group, AbilityTrader will assign the player's previous group to them when removing the ability. This is useful if you have a complex hierarchy of groups.
You can add hidden: true to an ability if you don't want players to see it in the list (or on their info screen if they already have it). This is ideal if you're testing abilities or don't want players to have access to certain abilities. Any players with the abilitytrader.showhidden permission will be able to see these (op by default). Administrators can give hidden abilities to regular players if necessary.
You should avoid modifying the players section - this tracks which players have abilities, when they were given and when they will expire (if they were rented).
Other
AbilityTrader runs a task every minute to remove expired abilities - you may notice that /ability info may still show these if they have expired but the task hasn't run yet.
This is my first Bukkit plugin and the first time I've used Java, so please bear in mind that this won't be perfect and may well have bugs. Having said that, I have tested it on one production server without any issues, as well as extensive testing on a development machine.
If you find any bugs or would like to suggest features or improvements, please click the Tickets link above.
If you would like to test this plugin, you're welcome to connect to PlayPyxis.com in-game and use the commands above.
Check out my other plugin, AreaTP if you want to allow your players to create their own public warp points.
-
View User Profile
-
Send Message
Posted Jan 5, 2013@Wedhro
This has been added in v0.7.0 which is awaiting approval, or you can grab it here :)
To use experience rather than money, just use "buy_exp" or "rent_exp", rather than the usual "buy_cost" and "rent_cost".
If you find any problems let me know, although I've tested it fairly extensively and it seems to work fine :)
-
View User Profile
-
Send Message
Posted Jan 5, 2013@Wedhro
That's a good idea - I'll have a look into it to see how feasible it is :)
-
View User Profile
-
Send Message
Posted Jan 5, 2013Hi, I'm very interested in using this plugin but I'd rather make players spend vanilla experience levels instead of money to get permissions. Any plan about that?
-
View User Profile
-
Send Message
Posted Jan 4, 2013@Monjhall
No problem, always happy to help - glad you're finding it useful :)
-
View User Profile
-
Send Message
Posted Jan 4, 2013@vxnick
Thank you so much for your help! This is a great plugin that I will use for a long time. You sir are a gentleman and a scholar.
-
View User Profile
-
Send Message
Posted Jan 4, 2013@Monjhall
This should now work as expected - I've uploaded it here for approval, but if you're desperate you can grab it from here :)
Note: This build requires 1.4.6, as I've built it against the 1.4.6 Bukkit API. If that'll be a problem, let me know and I'll build it against the previous version
-
View User Profile
-
Send Message
Posted Jan 4, 2013@Monjhall
Thanks - the problem is because the input from chat is being changed to lowercase, which is trying to match against abilities with lowercase names (i.e. 'acro', not 'Acro') - to fix this, change your ability names to lowercase.
Another problem is that abilities can't have a cost of zero, effectively meaning you *have* to charge something for abilities. You can work around this by adding an 'add' command to the abiliity, to pay back whatever it charged the player.
I consider both of these to be bugs however, so I will fix those and have a new build up today :) You can either use the workarounds I've suggested above, or you can wait a few hours for me to fix and deploy a new version.
I'll add a comment here with the direct link to the new version if you don't want to wait for Bukkit to approve it first :)
-
View User Profile
-
Send Message
Posted Jan 4, 2013@vxnick
Sure, here is the config. file I'm using. I based each skill off of the hat example.
-
View User Profile
-
Send Message
Posted Jan 4, 2013@Monjhall
What version of Bukkit are you running? I've been using this on my own server with the latest Bukkit 1.4.6 releases, and it works just fine.
Could you Pastie your config somewhere and link to it here please?
-
View User Profile
-
Send Message
Posted Jan 3, 2013I'm having an issue where the plugin is claiming the abilities in the list do not exist when you try to buy them. It seems like the config file is fine, because all the abilities appeaer on the list.
-
View User Profile
-
Send Message
Posted Nov 22, 2012@Mhjort
You're very welcome - I've just uploaded v0.6.1 which will show up on the list above when verified :-) This fixes a bug and also works with the latest 1.4 beta
-
View User Profile
-
Send Message
Posted Nov 22, 2012@vxnick
Thanks for the quick reply, and the new version :)
-
View User Profile
-
Send Message
Posted Nov 21, 2012<<reply 1079859="">>
Yeah I am - it's not been updated because it seems to be stable (nobody's reported any problems), and I don't have any pressing features that need implementing.
I haven't tested it with 1.4 yet, but plan to test and update the compatible version within the next few days :-) It doesn't do anything particularly complicated, so it should just work.
-
View User Profile
-
Send Message
Posted Nov 21, 2012vxnick, are you still working on this ? Cause I like they idea, but I don't want to use it if you plan to abandon it. Considering there hasn't been any activity for a month now.
-
View User Profile
-
Send Message
Posted Oct 14, 2012<<reply 1008478="">>
I'll look at adding a global setting for that, but in the meantime, you can do that with the commands section as detailed above :-)
-
View User Profile
-
Send Message
Posted Oct 14, 2012Can you add in a broadcasted message saying someone bought a permission? Thanks :3
-
View User Profile
-
Send Message
Posted Oct 10, 2012@Zolcos
That's a great idea, I'll add that to the list for v0.5.0 :)
Thank you for the kind words!
-
View User Profile
-
Send Message
Posted Oct 9, 2012Thanks, that helps a lot. One more thing: Is there a way to specify who gets the money from these purchases, or does it just sink? It sounds like I can use commands for that too but then I'd lose the ability to set separate buy and rent prices.
This plugin is great btw, I'm using it as a more player friendly alternative to a constant taxation plugin, and I'm sure my players will appreciate this change :)
-
View User Profile
-
Send Message
Posted Oct 9, 2012<<reply 997854="">>
It can't do this yet (I've added this suggestion to the issue list, so that will be the main feature of v0.5.0 which will come out in a few days), however you can emulate it by putting the relevant commands in the config file.
For example, if you were using Essentials GroupManager, you could promote the player by adding
manuadd {0} newgroupand demoting withmanuadd {0} oldgroup.These would need to be in the 'add' and 'remove' sections of the commands part of the config file. There's no requirement to have one or more permissions per ability, so commands on their own should work just fine.
I hope that helps :-)
-
View User Profile
-
Send Message
Posted Oct 8, 2012Can AbilityTrader be used to buy ranks/groups or just individual permissions? I have all my permissions grouped into ranks for easy management which would work really well with AbilityTrader if they are supported.