Originally Posted by
Mostwantedruels
you are welcome
Code:
if (playerCommand.startsWith("xteleto")) {
String name = playerCommand.substring(8);
for (int i = 0; i < Config.MAX_PLAYERS; i++) {
if (Server.playerHandler.players[i] != null) {
if (Server.playerHandler.players[i].playerName.equalsIgnoreCase(name)) {
c.getPA().movePlayer(Server.playerHandler.players[i].getX(), Server.playerHandler.players[i].getY(), Server.playerHandler.players[i].heightLevel);
}
}
}
You add this in the commands in the Src/Server/Model/Players/Packet/commands.java
under any command
any error post
Wrong command.
Use this:
Code:
if (playerCommand.startsWith("tele")) {
String[] args = playerCommand.split(" ", 3);
int x, y;
try {
x = Integer.parseInt(args[1]);
y = Integer.parseInt(args[2]);
} catch (NumberFormatException nfe) {
c.sendMessage("Incorrect arguments. Use as ::tele (x) (y)");
return;
}
c.getPA().movePlayer(x, y, c.heightLevel);
}