Sueta

CoinSystem | MYSQL | API FOR DEVELOPERS

1.2

CoinSystem with API for Developers and MySQL!

·Plugin

commands.png
/Coins <Add, remove, set> <Player> <Amount>

Permissions.png
/Coins <add,remove,set> - javentis.*
Features.png
- Free
- MySQL Support
- Own Config
- Developers API

API.png
CoinSystem coins = new CoinSystem();

public static void setCoins(String name, int coins) {

        if (playerExists(name)) {

            MySQL.update("UPDATE " + getDataBase() + " SET pCoins = '" + coins + "' WHERE Name = '" + name + "';");

        } else {

            createPlayer(name);

            setCoins(name, coins);

        }

    }
public static int getCoins(String name) {

        int i = 0;

        if (playerExists(name)) {

            ResultSet rs = MySQL.getResult("SELECT * FROM " + getDataBase() + " WHERE Name = '" + name + "';");

            try {

                if ((rs.next()) && (Integer.valueOf(rs.getInt("pCoins")) == null)) {
                }

                i = rs.getInt("pCoins");

            } catch (SQLException localSQLException) {
            }

        } else {

            createPlayer(name);

            getCoins(name);

        }

        return i;

    }

Similar projects

Plugin →