PDA

View Full Version : [ 317 ] How to add a new ::players command [317]



__вoɴĸαz__
July 31st, 2010, 23:27
Difficulty : 1/10

Open up client.java

and add this instead of your other players command


if (command.equalsIgnoreCase("players")) {
sM("There are currently " + PlayerHandler.getPlayerCount()
+ " players!");
sendQuest("@red@StealthzScape - Online Players", 8144);
clearQuestInterface();
sendQuest("@red@Online players(" + PlayerHandler.getPlayerCount()
+ "):", 8145);
int line = 8146;
for (int i = 1; i < PlayerHandler.maxPlayers; i++) {
client playa = getClient(i);
if (!validClient(i))
continue;
if (playa.playerName != null) {
String title = "";
if (playa.playerRights == 1) {
title = "Mod, ";
} else if (playa.playerRights == 2) {
title = "Admin, ";
}
title += "level-" + playa.combatLevel;
String extra = "";
if (playerRights > 0) {
extra = "(" + playa.playerId + ") ";
}
sendQuest("@whi@" + extra + playa.playerName + "@whi@ ("
+ title + ") is at " + playa.absX + ", "
+ playa.absY, line);
line++;
}
}
sendQuestSomething(8143);
showInterface(8134);
flushOutStream();
}

Picture:
Only the registered members can see the link.

Compile && Run and it should work perfect

If you get any errors post them below,

works 100%

I know other people know this but, some people dont,

Shayde
August 2nd, 2010, 01:34
Thanks :) My current one disconnects me wen i try using it after half an hour

__вoɴĸαz__
August 4th, 2010, 15:58
No problem :)

Fenway`
August 4th, 2010, 16:03
nice job bankaz :)

Malik
August 4th, 2010, 16:05
Good job but, can you explain how it is better?Or at least give a picture of what happens when you use the command?

__вoɴĸαz__
August 4th, 2010, 19:16
Adding a piccy now :)

fffrunegod
August 5th, 2010, 07:10
if (command.equalsIgnoreCase("players")) {
sM("There are currently " + PlayerHandler.getPlayerCount()
+ " players!");
sendQuest("@red@StealthzScape - Online Players", 8144);
clearQuestInterface();
sendQuest("@red@Online players(" + PlayerHandler.getPlayerCount()
+ "):", 8145);
int line = 8147;
for (int i = 1; i < PlayerHandler.maxPlayers; i++) {
client playa = getClient(i);
if (!validClient(i))
continue;
if (playa.playerName != null) {
String title = "";
if (playa.playerRights == 1) {
title = "Mod, ";
} else if (playa.playerRights == 2) {
title = "Admin, ";
}
title += "level-" + playa.combatLevel;
String extra = "";
if (playerRights > 0) {
extra = "(" + playa.playerId + ") ";
}
sendQuest("@whi@" + extra + playa.playerName + "@whi@ ("
+ title + ") is at " + playa.absX + ", "
+ playa.absY, line);
line++;
}
}
sendQuestSomething(8143);
showInterface(8134);
flushOutStream();
}



Use this Code as the other one makes it so the first player isn't seen as in pic its starts at the 2nd online player!

Magic™
August 5th, 2010, 07:11
Whats so l33t bout this one?

__вoɴĸαz__
August 12th, 2010, 15:21
No one said it was l33t... its just a normal ::players command :L