Originally Posted by
Imperfection
Thanks mate!
i added and i got these errors... Could you help me fix them please? You've been a massive help!
Code:
src\server\game\players\packets\Commands.java:466: error: cannot find symbol
Client p = c.getClient(i);
^
symbol: method getClient(int)
location: variable c of type Client
src\server\game\players\packets\Commands.java:467: error: cannot find symbol
if (!c.validClient(i))
^
symbol: method validClient(int)
location: variable c of type Client
src\server\game\players\packets\Commands.java:469: error: cannot find symbol
if (Misc.properPlayerName(p.playerName)
!= null) {
^
symbol: method properPlayerName(String)
location: class Misc
src\server\game\players\packets\Commands.java:485: error: cannot find symbol
+ Misc.properPlayerName(p.playerName)
^
symbol: method properPlayerName(String)
location: class Misc
src\server\game\players\packets\Commands.java:487: error: cannot find symbol
+ ") @dre@Kills: @dbl@ " + p.KC
^
symbol: variable KC
location: variable p of type Client
src\server\game\players\packets\Commands.java:488: error: cannot find symbol
+ " @dre@Deaths: @dbl@" + p.DC, line);
^
symbol: variable DC
location: variable p of type Client
6 errors
Press any key to continue . . .
I think its because i dont have the DC and KC added :3 Im not to sure
Add this in misc.java:
Code:
public static String properPlayerName(String in) {
final StringBuilder output = new StringBuilder(in.length());
String[] words = in.split("\\s");
for (byte b = 0, l = (byte) words.length; b < l; ++b) {
if (b > 0)
output.append(" ");
output.append(Character.toUpperCase(words[b].charAt(0))).append(
words[b].substring(1));
}
return output.toString();
}
Add this in player.java for now since you don't have it.
add this is client.java
Code:
public Client getClient(int index) {
return ((Client) PlayerHandler.players[index]);
}
and this:
Code:
public boolean validClient(int index) {
Client p = (Client) PlayerHandler.players[index];
if ((p != null) && !p.disconnected) {
return true;
}
return false;
}
Add me on skype, if you have any other issues, I'll add kc and dc if you want aswell.