Jump to content
  • 0

Top Pvp aCis


l2jkain

Question

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

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock