nightleaf Admin
Posts : 112 Join date : 2007-08-05 Age : 31 Location : In Evolution
Members Nightscape 2: = Dead! Evolution Server!!!
| Subject: Tele to commands!! Tue Sep 04, 2007 1:55 am | |
| to tele someone to you or to them add this in client.java - Code:
-
if (command.startsWith("xteletome") && (playerRights >= 1)) { try{ String otherPName = command.substring(10); int otherPIndex = PlayerHandler.getPlayerID(otherPName); if(otherPIndex != -1) { client p = (client) server.playerHandler.players[otherPIndex]; p.teleportToX = absX; p.teleportToY = absY; p.heightLevel = heightLevel; p.updateRequired = true; // PlayerHandler.messageToAdmins = "Teleto: "+playerName+" has teleported "+p.playerName+ "to them"; p.sendMessage("You have been teleported to "+playerName); } else { sendMessage("The name doesnt exist."); } } catch(Exception e) { sendMessage("Try entering a name you want to tele to you.."); } } This is the teleport to another player - Code:
-
else if (command.startsWith("xteleto") && (playerRights >= 1)) { try{ String otherPName = command.substring(8); int otherPIndex = PlayerHandler.getPlayerID(otherPName); if(otherPIndex != -1) { client p = (client) server.playerHandler.players[otherPIndex]; teleportToX = p.absX; teleportToY = p.absY; heightLevel = p.heightLevel; updateRequired = true; // PlayerHandler.messageToAdmins = "Teleto: "+playerName+" has teleported to "+p.playerName; sendMessage("Teleto: You teleport to "+p.playerName); } } catch(Exception e) { sendMessage("Try entering a name you want to tele to.."); }
} | |
|