Re: [Release] Ingame Rankings
Re: [Release] Ingame Rankings
i added the npc one but i got this error when compile, i did add imports
Code:
symbol : class ResultSet
location: class net.sf.odinms.scripting.npc.NPCConversationManager
ResultSet rs = ps.executeQuery();
Re: [Release] Ingame Rankings
Re: [Release] Ingame Rankings
Quote:
Originally Posted by
shakar96
Here it is with all the characters
PHP Code:
} else if (splitted[0].equals("@ranking")) {
try {
int int1 = 0;
int int2 = 0;
Connection con = DatabaseConnection.getConnection();
PreparedStatement ps = con.prepareStatement("SELECT * FROM characters WHERE job >= ? AND job <= ? AND gm = 0 ORDER BY level");
if (splitted.length == 1) {
mc.dropMessage("@ranking <job>, as job = warrior/magician/bowman/thief/pirate/beginner/me");
return;
} else if (splitted[1].equals("warrior")) {
int1 = 100;
int2 = 132;
} else if (splitted[1].equals("magician")) {
int1 = 200;
int2 = 232;
} else if (splitted[1].equals("bowman")) {
int1 = 300;
int2 = 322;
} else if (splitted[1].equals("thief")) {
int1 = 400;
int2 = 422;
} else if (splitted[1].equals("pirate")) {
int1 = 500;
int2 = 522;
} else if (splitted[1].equals("beginner")) {
int1 = 0;
int2 = 0;
} else if (splitted[1].equals("all")) {
int1 = 0;
int2 = 522;
} else if (splitted[1].equals("me")) {
ps = con.prepareStatement("SELECT name FROM characters ORDER BY level DESC");
ResultSet rs = ps.executeQuery();
int i = 0;
int lol = 0;
while (rs.next()) {
i++;
if (rs.getString("name").equals(c.getPlayer().getName())) {
lol = i;
}
}
mc.dropMessage("You are currently ranked " + lol);
// mc.dropMessage("LOL NOOB YOU GOT OWNED !!! NOOOBBOOBOOBOBOB!");
// getPlayer().getMap().broadcastMessage(MaplePacketCreator.showEffect("quest/party/wrong_kor")); // ]:-> PQ Wrong
// getPlayer().getMap().broadcastMessage(MaplePacketCreator.showEffect("quest/carnival/lose")); // ]:-> MCPQ Lose
// getPlayer().getMap().broadcastMessage(MaplePacketCreator.showEffect("event/coconut/lose")); // ]:-> Coconut Loser
ps.close();
rs.close();
return;
} else {
mc.dropMessage("I don't recognize that job, make sure you use lower-case");
return;
}
ps.setInt(1, int1);
ps.setInt(2, int2);
ResultSet rs = ps.executeQuery();
int i = 0;
mc.dropMessage("These are the RageStory players:");
while (rs.next()) {
i++;
mc.dropMessage(i + ") " + rs.getString("name") + ", level " + rs.getInt("level"));
}
ps.close();
rs.close();
} catch (SQLException e) {
mc.dropMessage("Unknown error, please report this to Bassoe"); //Yeah, this shouldn't happen unless you are a noob
// mc.dropMessage("NOOB LEARN TO RUN A SERVER!!! ENJOY LIFE AND REPORT TO BASSOE SOMETHING");
}
BTW Bassoe you are missing a "}" (I didn't add it here) because noobs don't know that there is a } before the else if for example:
Code:
} else if (splitted[*].equals("*******")) {
ehh, that's in my script too (i added it 5 minutes after release)
lol at the comments btw
Quote:
Originally Posted by
shakar96
Also (sorry for double posting), you need to add (in case you dont have):
Code:
import com.mysql.jdbc.Connection;
import com.mysql.jdbc.PreparedStatement;
import net.sf.odinms.database.DatabaseConnection;
I think there are a few more.
And I think there are a few things wrong there, but NetBeans can probably fix that without knowig Java.
i think everyone has them, but if not
you can also use 'Control + Shift + i' to fix the imports
Re: [Release] Ingame Rankings
Quote:
Originally Posted by
kippieeej
ehh, that's in my script too (i added it 5 minutes after release)
lol at the comments btw
i think everyone has them, but if not
you can also use 'Control + Shift + i' to fix the imports
Thanks :)
Yeah it's super easy, just in case.
Re: [Release] Ingame Rankings
Any addons needed for this release?
Re: [Release] Ingame Rankings
i have an idea when it show ranking could you add the rebirth to it too?
like top 10 with the most rebirths?
Re: [Release] Ingame Rankings
change
PHP Code:
ORDER BY level DESC
to
PHP Code:
ORDER BY reborns DESC, level DESC
depends on what your reborn coluum call.
Re: [Release] Ingame Rankings
Quote:
Originally Posted by
kingpimptony
i have an idea when it show ranking could you add the rebirth to it too?
like top 10 with the most rebirths?
Code:
} else if (splitted[0].equals("@ranking")) {
try {
int int1 = 0;
int int2 = 0;
Connection con = DatabaseConnection.getConnection();
PreparedStatement ps = con.prepareStatement("SELECT * FROM characters WHERE job >= ? AND job <= ? AND gm = 0 ORDER BY reborns DESC, level DESC LIMIT 10");
if (splitted.length == 1) {
mc.dropMessage("@ranking <job>, as job = warrior/magician/bowman/thief/pirate/beginner/me");
return;
} else if (splitted[1].equals("warrior")) {
int1 = 100;
int2 = 132;
} else if (splitted[1].equals("magician")) {
int1 = 200;
int2 = 232;
} else if (splitted[1].equals("bowman")) {
int1 = 300;
int2 = 322;
} else if (splitted[1].equals("thief")) {
int1 = 400;
int2 = 422;
} else if (splitted[1].equals("pirate")) {
int1 = 500;
int2 = 522;
} else if (splitted[1].equals("beginner")) {
int1 = 0;
int2 = 0;
} else if (splitted[1].equals("all")) {
int1 = 0;
int2 = 522;
} else if (splitted[1].equals("me")) {
ps = con.prepareStatement("SELECT name FROM characters ORDER BY reborns DESC, level DESC");
ResultSet rs = ps.executeQuery();
int i = 0;
int lol = 0;
while (rs.next()) {
i++;
if (rs.getString("name").equals(c.getPlayer().getName())) {
lol = i;
}
}
mc.dropMessage("You are currently ranked " + lol);
ps.close();
rs.close();
return;
} else {
mc.dropMessage("I don't recognize that job, make sure you use lower-case");
return;
}
ps.setInt(1, int1);
ps.setInt(2, int2);
ResultSet rs = ps.executeQuery();
int i = 0;
mc.dropMessage("These are the top 10 RageStory players:");
while (rs.next()) {
i++;
mc.dropMessage(i + ") " + rs.getString("name") + ", reborns " + rs.getInt("reborns") + ", level " + rs.getInt("level"));
}
ps.close();
rs.close();
} catch (SQLException e) {
mc.dropMessage("Unknown error, please report this to Bassoe");
}
Re: [Release] Ingame Rankings
yea, isnt reborns an int though?
Re: [Release] Ingame Rankings
Re: [Release] Ingame Rankings
Quote:
Originally Posted by
kippieeej
yea, isnt reborns an int though?
yea it is :D
my bad sorry! P: fixed
Re: [Release] Ingame Rankings
Thanks Chicken Master!
I'll use that command! :D:
Re: [Release] Ingame Rankings
Quote:
Originally Posted by
Ehab
Thanks Chicken Master!
I'll use that command! :D:
Bassoe is not in ChickenMS anymore!
Bassoe is in RaGEStory!!!!!!!!!!!!!!!!!!!!!!!!!!!!(Which rules EgyptMS BTW)!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!