Evolution Server
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Evolution Server

This is the official site of Evolution!!!
 
HomeHome  PortalPortal  SearchSearch  Latest imagesLatest images  RegisterRegister  Log inLog in  

 

 Tele to commands!!

Go down 
AuthorMessage
nightleaf
Admin
Admin
nightleaf


Posts : 112
Join date : 2007-08-05
Age : 31
Location : In Evolution

Members
Nightscape 2: = Dead! Evolution Server!!!

Tele to commands!! Empty
PostSubject: Tele to commands!!   Tele to commands!! Icon_minitimeTue 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.."); }

   }
Back to top Go down
https://evolutionserver.forumotion.com
 
Tele to commands!!
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Evolution Server :: Server Coding-
Jump to: