Hello!
I'm using moopledev rev120, where all the skills should work!
I'm not sure why but when someone uses the skill battleship he gets disconnected from the game with no error and im not even getting a log of the error so I really don't know what to do.
In addition to that problem I there is a problem where monsters (like the blue mobs that zakum spawns)
don't die even after reaching 0 HP.
I will be still trying to fix thsese problems as I'm waiting for clues x;
- update -
and if anyone could tell me whats the problem here i'll love him forever -_- trying to make it so u dont need to log off to vote, basically adding a command that will claim it.
PHP Code:public void claimVote() {
MapleCharacter ty = new MapleCharacter();
int claimvote = 0;
try { // recieving the data
PreparedStatement ps = DatabaseConnection.getConnection().prepareStatement("SELECT claimvote FROM accounts WHERE id = ?");
ps.setInt(1, ty.accountid);
ResultSet rs = ps.executeQuery();
if (rs.next()) {
claimvote = rs.getInt("claimvote");
}
rs.close();
ps.close();
} catch (Exception e) {
System.out.print(name + " has recieved an error while trying to claim a vote.");
}
if (claimvote > 0) { // positive number claim rewards, negative don't do anything
gainVotePoints(1);
claimvote -= 1;
getCashShop().getCash(5000);
dropMessage("You have recieved 1 vote point and 5000 nx.");
} else {
dropMessage("You don't have vote points to be claimed.");
}
Connection con = DatabaseConnection.getConnection();
try { // sending back the new data
con.setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);
con.setAutoCommit(false);
PreparedStatement ps;
ps = con.prepareStatement("UPDATE accounts SET `claimvote` = ? WHERE id = ?");
ps.setInt(1, claimvote);
ps.setInt(2, client.getAccID());
ps.executeUpdate();
ps.close();
} catch (SQLException se) {
System.out.print(name + " has recieved an error while trying to claim a vote.");
}
}


Reply With Quote


