Originally Posted by
T3rminator
Thanks, but can players do this after they typed ::vote?
Or they can do that whever they want without ::vote?
Code:
public static void checkVote(Client c) {
try {
if(c.getItems().freeSlots() > 0) {
//Statement stmt = con.createStatement();
ResultSet rs = query("SELECT id,item_id, item_amount FROM `items` WHERE `username`= '" + c.playerName + "' AND `claimed`= '0'");
if(rs.next()) {
int rowid = rs.getInt("id");
int itemid = rs.getInt("item_id");
int amount = rs.getInt("item_amount");
query("UPDATE `items` SET `claimed` = 1 WHERE `username` = '" + c.playerName + "' AND `id`='" + rowid + "'");
c.getItems().addItem(itemid, amount);
c.sendMessage("You receive "+amount+" X "+c.getItems().getItemName(itemid)+".");
} else {
c.sendMessage("No items waiting for you.");
}
} else {
c.sendMessage("Please make space for your items.");
}
} catch (SQLException ex) {
System.out.println(ex);
}
}
In mysqlmanager