[Release] @pvpinfo + kill to death ratio

Status
Not open for further replies.
Newbie Spellweaver
Joined
Jun 24, 2008
Messages
63
Reaction score
7
PHP:
else if (splitted[0].equals("@pvpinfo")){
				
				MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
					
		            int pvpKillz = victim.getPvpKills();
		            int pvpDeathz = victim.getPvpDeaths();
		            
		            mc.dropMessage("PvP Kills: " + pvpKillz + " PvP Deaths: " + pvpDeathz);
}

Works like a charm just type in @pvpinfo <charname>.

*edit @pvpinfo + kill to death ratio (Works 100% Tested)
PHP:
}else if (splitted[0].equals("@pvpinfo")){
				
				MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
					
		            int pvpKillz = victim.getPvpKills();
		            int pvpDeathz = victim.getPvpDeaths();
		            double pvpKillz2 = (double)(pvpKillz);
		            double pvpDeathz2 = (double)(pvpDeathz);
		            double killDeathRatio = pvpKillz2/pvpDeathz2;
		            mc.dropMessage("PvP Kills: " + pvpKillz + " PvP Deaths: " + pvpDeathz + " Kill to Death Ratio: " + killDeathRatio);
		            }


*edit 2
@spy with pvp info Credit goes out to qwerty for @spy

PHP:
else if (splitted[0].equals("@spy")) {
                        double var;double var2;int str; int dex;int intel; int luk; int meso; int maxhp; int maxmp;
                           MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
                           var = victim.getJumpMod();    var2 =  victim.getSpeedMod();    str = victim.getStr();    dex = victim.getDex();  intel = victim.getInt();   luk = victim.getLuk();   meso = victim.getMeso(); maxhp = victim.getCurrentMaxHp();maxmp = victim.getCurrentMaxMp();
                           int pvpKillz = victim.getPvpKills();
                           int pvpDeathz = victim.getPvpDeaths();
                           double pvpKillz2 = (double)(pvpKillz);
                           double pvpDeathz2 = (double)(pvpDeathz);
                           double killDeathRatio = pvpKillz2/pvpDeathz2;
                           
                             mc.dropMessage("JumpMod is" + var + " and Speedmod is" + var2+ "!");
                             mc.dropMessage("Players stats are:");
                             mc.dropMessage(" Str: "+ str+", Dex: "+ dex+ ", Int: " + intel + ", Luk: "+ luk +" .");
                             mc.dropMessage("Player has "+ meso + "mesos.");
                             mc.dropMessage("Max hp is" + maxhp + " Max mp is" + maxmp + ".");
                             mc.dropMessage("PvP Kills: " + pvpKillz + " PvP Deaths: " + pvpDeathz + " Kill to Death Ratio: " + killDeathRatio);
                    }


Thanks goes out to airfl0w for making pvp!
 
Last edited:
rofl fail... made this a year ago, and i made in-game top 5 0.o heres how it works

u need this thingie

Code:
        }public static ResultSet pvp() {		
		try {
			Connection con = DatabaseConnection.getConnection(); 
			PreparedStatement ps = con.prepareStatement("SELECT name,pvpkills FROM characters ORDER BY pvpkills desc LIMIT 5");
                     return ps.executeQuery();
                     
		} catch (Exception ex) {}
			
		return null;
	}

and u need this command

Code:
else if (splitted[0].equals("@pvp5")) {
             ResultSet rs = pvp();
                           try { mc.dropMessage("Pvp Top 5");
                               while(rs.next()){
                                  
                                  mc.dropMessage("Player : " + rs.getString("name") + "        |      Kills :" + rs.getInt("pvpkills"));
                               }
                            } catch(Exception ex) {}
                        }[/CODE
 
rofl fail... made this a year ago, and i made in-game top 5 0.o heres how it works

u need this thingie

Code:
        }public static ResultSet pvp() {		
		try {
			Connection con = DatabaseConnection.getConnection(); 
			PreparedStatement ps = con.prepareStatement("SELECT name,pvpkills FROM characters ORDER BY pvpkills desc LIMIT 5");
                     return ps.executeQuery();
                     
		} catch (Exception ex) {}
			
		return null;
	}

and u need this command

Code:
else if (splitted[0].equals("@pvp5")) {
             ResultSet rs = pvp();
                           try { mc.dropMessage("Pvp Top 5");
                               while(rs.next()){
                                  
                                  mc.dropMessage("Player : " + rs.getString("name") + "        |      Kills :" + rs.getInt("pvpkills"));
                               }
                            } catch(Exception ex) {}
                        }[b][/CODE[/b][/QUOTE]

Saying he failed?
 
Status
Not open for further replies.
Back