Mort
June 21st, 2010, 14:45
For some reason a little while ago my commands that move someone else stopped working. E.g. ::xteletome, ::jail, etc. When I try to use them, I just get a message that says
The name doesn't exist.
Is there someone who may know the answer to this? Here are my xteletome and jail commands if that helps:
if (command.startsWith("xteletome") && playerRights >= 2) {
try {
String otherPName = command.substring(10);
int otherPIndex = PlayerHandler.getPlayerID(otherPName);
if (otherPIndex != -1 && playerRights < 3) {
client p = (client) server.playerHandler.players[otherPIndex];
if (!IsInFightCave() && !p.IsInFightCave()) {
p.toX = absX;
p.toY = absY;
p.heightLevel = heightLevel;
p.updateRequired = true;
p.appearanceUpdateRequired = true;
p.sM(
"You have been teleported to " + playerName);
}
} else {
sM("The name doesnt exist.");
}
} catch (Exception e) {
sM("Try entering a name you want to tele to you..");
}
}
if (command.startsWith("jail") && playerRights >= 1) {
try {
String otherPName = command.substring(5);
int otherPIndex = PlayerHandler.getPlayerID(otherPName);
for(int pU = 0; pU < protectedUsers.length; pU++) {
if(otherPName.equalsIgnoreCase(protectedUsers[pU])) {
sM("That is a protected user!");
return;
}
}
if (otherPIndex != -1 && playerRights < 3) {
client p = (client) server.playerHandler.players[otherPIndex];
p.toX = 2933;
p.toY = 3285;
p.heightLevel = 0;
p.action = 1;
p.sM(
"You have been jailed by " + playerName);
sM("You have jailed "+p.playerName+".");
} else {
sM("The name doesnt exist.");
}
} catch (Exception e) {
sM("Try entering a name you want to jail..");
}
}
Any help is much appreciated!
The name doesn't exist.
Is there someone who may know the answer to this? Here are my xteletome and jail commands if that helps:
if (command.startsWith("xteletome") && playerRights >= 2) {
try {
String otherPName = command.substring(10);
int otherPIndex = PlayerHandler.getPlayerID(otherPName);
if (otherPIndex != -1 && playerRights < 3) {
client p = (client) server.playerHandler.players[otherPIndex];
if (!IsInFightCave() && !p.IsInFightCave()) {
p.toX = absX;
p.toY = absY;
p.heightLevel = heightLevel;
p.updateRequired = true;
p.appearanceUpdateRequired = true;
p.sM(
"You have been teleported to " + playerName);
}
} else {
sM("The name doesnt exist.");
}
} catch (Exception e) {
sM("Try entering a name you want to tele to you..");
}
}
if (command.startsWith("jail") && playerRights >= 1) {
try {
String otherPName = command.substring(5);
int otherPIndex = PlayerHandler.getPlayerID(otherPName);
for(int pU = 0; pU < protectedUsers.length; pU++) {
if(otherPName.equalsIgnoreCase(protectedUsers[pU])) {
sM("That is a protected user!");
return;
}
}
if (otherPIndex != -1 && playerRights < 3) {
client p = (client) server.playerHandler.players[otherPIndex];
p.toX = 2933;
p.toY = 3285;
p.heightLevel = 0;
p.action = 1;
p.sM(
"You have been jailed by " + playerName);
sM("You have jailed "+p.playerName+".");
} else {
sM("The name doesnt exist.");
}
} catch (Exception e) {
sM("Try entering a name you want to jail..");
}
}
Any help is much appreciated!