Solved How to Hook Into MoneySQL?

Discussion in 'Plugin Development' started by AppleBabies, Jan 10, 2016.

Thread Status:
Not open for further replies.
  1. Offline

    AppleBabies

    Whoever wrote MoneySQL made it impossible, and I mean IMPOSSIBLE, to hook into. I can't do the most simple thing - reading how much money a user has. So, what SQL line could I use to access the following data?

    For example:
    (id) (UUID) (last_known_name) (money)
    1 UUID AppleBabies 1000

    I've tried simply doing:
    Code:
    PreparedStatement sql= connection.prepareStatement("SELECT money FROM `moneysql` WHERE UUID=?, last_known_name=?;");
    sql.setString(1, e.getPlayer().getUniqueId().toString());
    sql.setString(2, e.getPlayer().getName());
    ResultSet result = sql.executeQuery();
    result.next();
    money= result.getInt("money");
    But that does not work...shouldn't it?
     
  2. Offline

    Go Hard

  3. Offline

    AppleBabies

    @Go Hard
    Meaning, yes, I did. But it is VERY outdated. Everything put in there is no longer usable in any way. All I get are errors, even BEFORE exporting.
     
  4. Offline

    Go Hard

    I just tired this in my code and i'm not getting any errors in eclipse...
    Code:
    public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
    Player player = (Player) sender;
    
     if(cmd.getName().equalsIgnoreCase("money")) {
    Methods.getPlayerMoney(player);
    }
    
    return false;
    }
    
     
  5. Offline

    AppleBabies

    @Go Hard I can try again...

    @Go Hard Wow. That didn't work a couple months back...thanks!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jan 10, 2016
Thread Status:
Not open for further replies.

Share This Page