mrkirby153

Untitled

Dec 27th, 2013
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. try {
  2. ResultSet rs = sql.executeQuery("SELECT * FROM `cs_bought` WHERE `boughtBy` = '" + player.getName() + "'");
  3. int count = 0;
  4. if (rs == null)
  5. return;
  6. while (rs.next()) {
  7. int productId = rs.getInt("productId");
  8. ItemConstructor.redeemItem(player, productId);
  9. count++;
  10. }
  11. ChatHelper.sendToPlayer(player, ChatColor.GREEN + "Redeemed " + count + " items!");
  12. } catch (SQLException e) {
  13. ChatHelper.sendToPlayer(player, ChatColor.LIGHT_PURPLE + "There was a problem redeeming your items. " +
  14. "Please contact an administrator for help. " + ChatColor.GOLD + e.getMessage());
  15. e.printStackTrace();
  16. }
Advertisement
Add Comment
Please, Sign In to add comment