Skip to content
1Achmed1 edited this page Sep 28, 2013 · 7 revisions

SQLEconomy Wiki

Installing SQLEconomy

Installing SQLEcon is in some ways hard, and in some ways tricky.

  1. Download the latest release of SQLEcon in the Releases tab. If you are downloading a pre-release, make sure it's a working build. Other wise download the latest full release.
  2. In the downloaded .zip file, you should see a .jar file, a README file, and a folder titled SQLEconomy. Drag and drop everything except the README into your plugins folder.
  3. Now, in the folder called "SQLEconomy", open the config.yml file and edit all of the fields. Lines starting with "#" are NOT to be changed.
  4. Run the plugin. It shouldn't return any errors.

Trouble Shooting

Q: I get an error when I run the plugin.
A: This could be one of 2 things: a) Your configuration file has incorrect information OR b) there is an issue in the plugin. Please contact me if it IS an issue in the plugin.

Q: Why do I need to drag and drop the SQLEconomy folder?
A: Since the default config has dummy information, it will return an error, disable the plugin, and the config will never load. If you have the file on hand, however, and it has REAL information, the plugin should load correctly.

Q: I couldn't find my issue here, what should I do?
A: Don't panic. You can always contact me either here or on http://bukkit.org/.

Developing with SQLEconomy

Using the SQLEconomy money operations

Implementing SQLEconomy into your plugin isn't hard at all.

Getting Money

To get a players money is extremely easy. Just do the following:

In the area that you want to get your balance in add this code:
getBalance(player)
Here's a real-world implementation with the code above:
public boolean onCommand(CommandSender sender, Command cmd) {
if (cmd.getName().equalsIgnoreCase("money")) {
sender.sendMessage("" + getBalance(sender));
}
}

Please refer to the class files for more information.

Using the built-in SQL API

SQLEconomy is not just an Economy plugin. It also has a built in API. The API was built by -_Husky_- on the Bukkit Forums. You can see more information on using it here: http://forums.bukkit.org/threads/tutorial-using-mysql-in-your-plugins.132309/