PDA

View Full Version : Xteletome, jail, etc.



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!

Emperor
June 21st, 2010, 18:05
Any errors on compiling?

Mort
June 21st, 2010, 19:51
Nope, everything seems fine, it just doesn't work. I can't think of anything I haven't already tried.

my pker pure
June 21st, 2010, 20:00
I don't see any errors on either of those sets of code unless your tele coords are wrong?

If not try seeking someone with very very good coding skill.


Both of these are correct

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..");
}
}


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..");
}
}



BTW love the avatar XD

`Deviant
June 21st, 2010, 20:17
What's your source? RS2HD, Delta, iClarity, Devolution, etc.

Mort
June 21st, 2010, 20:51
BTW love the avatar XD
Thanks :P



What's your source? RS2HD, Delta, iClarity, Devolution, etc.

I'm using a Delta source-FLAME SHIELDS UP!
It's not much like Delta anymore though.

Avoid
June 21st, 2010, 21:23
Thanks :P



I'm using a Delta source-FLAME SHIELDS UP!
It's not much like Delta anymore though.

Sorry, but I doubt that.

Mort
June 21st, 2010, 21:25
Sorry, but I doubt that.

Alright, doubt all you want. Of course, it's still like it but it's not like it's leeched or anything. Wow that sounds dumb but I can't think of a better way to say it.

Pixelated
July 30th, 2010, 21:34
I have the same problem, except with the ::unjail command. When I try to unjail, it keeps telling me the name doesn't exist.