CouponCraft
CouponCraft
Introduction
CouponCraft is a simple Bukkit plugin, which allows you, to create coupon codes on your server. Each code can trigger different actions. Every action, which belongs to the same code, will be saved in an action stack. An Action could be one of the following:
- Give an item to a player.
- Give money to a player.
- Set the rank of a player.
- Teleport a player to a specified location.
- Run a custom command.
Requirements
- Vault plugin
- A MySQL database
Installation
Follow these steps, to install the plugin on your server:
- Upload the plugin JAR into your plugins directory.
- (Re)start your server or load the plugin.
- The plugin will create a config file. Edit the config file and enter your MySQL access data.
- Restart the server or reload the plugin.
- Done! Everything should work.
Creating a coupon code
Basically you can create a new code without any actions by using /code create
. This code will do nothing, when a player redeems it. You have to attach actions later. You can also use an optional parameter to automatically add the first action.
Adding a item action
You can create coupon codes, which gives items to a player. First you have to choose the block, which the player will gain by redeeming the code. Simply put it in your inventory and hold it in your hand.
Then you can create a new code with /code create i
or you can attach this action to an existing code with /code attach <id> i
. Use the parameter "i", which means "item".
Adding a money action
To create a code, which gives a specified amount of money to a player, you can use /code create m <amount>
. You can also add this action to an existing code with /code attach <id> m <amount>
. Use the parameter "m", which means "money".
Adding a rank action
Codes can also set the rank of an user. Simply use /code create r <rank>
to create a new coupon code or /code attach <id> r <rank>
to attach a rank action to an existing command. Use the parameter "r", which means "rank".
Adding a teleportation action
If you want to change the location of a player, when a coupon code was redeemed, you have to go to this location and look in the desired direction.
Then you can create a new coupon code with /code create t
or you can attach this action with /code attach <id> t
. Use the parameter "t", which means "teleportation".
Adding a command action
If there's nothing, which satisfies you, you can add an action, which executes a custom command. Therefor you have to use /code create c <command>
to create a new coupon code or /code attach <id> c <command>
to attach a command action to a existing code. Use the parameter "c", which means "command".
Commands
/code <code>
- Redeem a code./code create
- Create an empty coupon code./code createaction <id> <type> [parameters]
- Attach an action to a code./code info <id>
- Get information about coupon code./code delete <id>
- Delete an existing code./code deleteaction <id>
- Delete an existing action./code blacklist +/-<player>
- Add or remove a player from the blacklist./code whitelist +/-<player>
- Add or remove a player from the whitelist./code expire <timeframe>
- Set a expire timeframe.
Permissions
code.redeem
- Allows you, to redeem coupon codes.code.admin
- Allows you, to administrate CouponCraft.
Comments