Skip to content

Top Pvp aCis

Featured Replies

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);
        }      
    }
    

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.