Hello, I'm trying to put the top pvp to be announced when entering however my code only announces the players that have pvp.
private static void announceTopPvp(Player activeChar)
{
String name = null;
try (Connection con = L2DatabaseFactory.getInstance().getConnection())
{
PreparedStatement statement = con.prepareStatement("SELECT char_name, pvpkills FROM characters WHERE accesslevel=0 ORDER BY pvpkills DESC LIMIT 1");
ResultSet rset = statement.executeQuery();
while (rset.next())
{
int pvpKills = rset.getInt("pvpkills");
name = rset.getString("char_name");
if (activeChar.getName().equals(name))
Broadcast.announceToOnlinePlayers(name +" Top PVP Is Now Online with " + pvpKills+ ".");
}
rset.close();
statement.close();
}
catch (Exception e)
{
_log.log(Level.WARNING,"Erro Top Player Pvp!",e);
}
}
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
@Hitcher I agree 100%! Are you running a live server using MyExt64 or just experimenting? I'm currently creating my IDA db's so i can start adding more stuff into the extender.
I don't understand why you are so offended and aggressive, who allowed you to disrespect me or call me in any way? Did I insulted you? You act like a angry kid, grow up boy.
@Maxtor@Celestino
The administrators of this forum can access everything I've sent...
Your move won't work on me. Hahahaha!
Getting into the parameters and editing the HTMLs of websites and claiming it's real used to be really cool among true friends.
@jtos So, is this also true? 🤣😂🤣😂🤣😂🤣
Your joke still hasn't been better than mine. Hahahah!
Question
l2jkain
Hello, I'm trying to put the top pvp to be announced when entering however my code only announces the players that have pvp.
private static void announceTopPvp(Player activeChar)
{
String name = null;
try (Connection con = L2DatabaseFactory.getInstance().getConnection())
{
PreparedStatement statement = con.prepareStatement("SELECT char_name, pvpkills FROM characters WHERE accesslevel=0 ORDER BY pvpkills DESC LIMIT 1");
ResultSet rset = statement.executeQuery();
while (rset.next())
{
int pvpKills = rset.getInt("pvpkills");
name = rset.getString("char_name");
if (activeChar.getName().equals(name))
Broadcast.announceToOnlinePlayers(name +" Top PVP Is Now Online with " + pvpKills+ ".");
}
rset.close();
statement.close();
}
catch (Exception e)
{
_log.log(Level.WARNING,"Erro Top Player Pvp!",e);
}
}
0 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.