Nevermind used sql querys instead of hashmap..
Thanks for those who helped
Another question,
How would I be able to use say c.getPlayer.gaineventpoints(1); with this sql query, because you cant add eventpoints through an sql query because it just gets rolled back to the users current value when @save.
So pretty much this query gives me the winner but i need to work out how to use gaineventpoints or something similar to give the winner event points
Is it possible to use this somewhere in that firstpvpwinner but without the findchannel stuff, an easier method? I cant remember, because this isnt working for me atmPHP Code:public void firstpvpwinner() {
try {
String name = "";
Connection con = DatabaseConnection.getConnection();
PreparedStatement ps = con.prepareStatement("SELECT eventpvpkills, name FROM characters ORDER BY eventpvpkills desc LIMIT 1");
ResultSet rs = ps.executeQuery();
while(rs.next())
{
name = rs.getString("name");
int pvpkills = rs.getInt("eventpvpkills");
// WorldServer.Broadcast.broadcastMessage(null, MaplePacketCreator.serverNotice(6, "[Event] Player "+name+" - Kills " + pvpkills + ".").getBytes());
WorldServer.Broadcast.broadcastMessage(null, MaplePacketCreator.serverNotice(6, "[Event] Congratulations to "+name+" for winning the Auto PVP Event with " + pvpkills + " Kills.").getBytes());
//tried updating ep in this line but yeah..
//PreparedStatement ps1 = con.prepareStatement("UPDATE characters SET eventpoints=3 ORDER BY eventpvpkills DESC LIMIT 1");
// ps1.executeUpdate();
// ps1.close();
}
}catch (Exception ex) {
}
}
PHP Code:int winnerID = rs.getInt("id");
int ch = ChannelServer.findChannel(winnerID);
MapleCharacter winner = ChannelServer.getInstance(ch).getPlayerStorage().getCharacterById(winnerID);
winner.gaineventpoints(1);
And I want eventpvpkills to be set to 0 after relog. Is there a better way to do this instead of this line in playerloggedinhandler? Thanks
PHP Code:if(player.getEventPvpKills() >= 0){
player.setEventPvpKills(0);
}



Reply With Quote

halp plz

