Thread: Adding teleports.

Results 1 to 7 of 7
  1. #1 Adding teleports. 
    Banned Adding teleports. Market Banned


    Join Date
    Feb 2018
    Posts
    824
    Thanks given
    9
    Thanks received
    236
    Rep Power
    0
    Using the eco version of Elvarg, I looked on YouTube and stuff first, but I can't find anywhere on how to add teleports, example "::home" and things like that. I can't find the right codes for it and there's no teleport commands to go by on this source at the moment.
    Reply With Quote  
     

  2. #2  
    Registered Member
    Remi's Avatar
    Join Date
    Jan 2015
    Posts
    628
    Thanks given
    572
    Thanks received
    212
    Rep Power
    574
    CommandpacketListener.java

    code should be like this to move the player to a coord
    player.moveTo(new Position(X coords, Y coords));
    Where the fuck is my cigarettes, I need my cancer. [C]44..
    Reply With Quote  
     

  3. #3  
    Banned Adding teleports. Market Banned


    Join Date
    Feb 2018
    Posts
    824
    Thanks given
    9
    Thanks received
    236
    Rep Power
    0
    Quote Originally Posted by Remi View Post
    CommandpacketListener.java

    code should be like this to move the player to a coord
    player.moveTo(new Position(X coords, Y coords));
    If I'm wanting to add the ::home or another teleport command?
    Reply With Quote  
     

  4. #4  
    nice


    Join Date
    Jul 2014
    Posts
    740
    Thanks given
    382
    Thanks received
    562
    Rep Power
    4239
    Quote Originally Posted by Og Smoke View Post
    If I'm wanting to add the ::home or another teleport command?
    Code:
     		if (command[0].equalsIgnoreCase("home")) {
    			TeleportHandler.teleportPlayer(player, new Position(2331, 3678), player.getSpellbook().getTeleportType());
    
    		}
    Should work fine, if not then its just simple naming changes at best
    Reply With Quote  
     

  5. #5  
    Banned Adding teleports. Market Banned


    Join Date
    Feb 2018
    Posts
    824
    Thanks given
    9
    Thanks received
    236
    Rep Power
    0
    Quote Originally Posted by Thesuic12 View Post
    Code:
     		if (command[0].equalsIgnoreCase("home")) {
    			TeleportHandler.teleportPlayer(player, new Position(2331, 3678), player.getSpellbook().getTeleportType());
    
    		}
    Should work fine, if not then its just simple naming changes at best

    Trying to use this, the command is wrong obviously and I'm looking at other commands to see what I can go by, but there's no teleport commands to even use as a guide.

    Code:
    if (command[0].equalsIgnoreCase("home")) {
    			TeleportHandler.teleportPlayer(player, new Position(2331, 3678), player.getSpellbook().getTeleportType());
    
    		}
    Here is the only teleport command I can even find but of course it's not going to be like this, as this is a command for staff to teleport to someone, or to a location.

    Code:
    private static void modCommands(Player player, String command, String[] parts) {
    		if(parts[0].equals("teleto")) {
    			Optional<Player> plr = World.getPlayerByName(command.substring(parts[0].length() + 1));
    			if(plr.isPresent()) {
    				player.moveTo(plr.get().getPosition().copy());
    			}
    Reply With Quote  
     

  6. #6  
    Extreme Donator


    Join Date
    Aug 2016
    Posts
    597
    Thanks given
    109
    Thanks received
    96
    Rep Power
    254
    This

    Code:
    if(parts[0].equals("teleto")) {
    	Optional<Player> plr = World.getPlayerByName(command.substring(parts[0].length() + 1));
    	if(plr.isPresent()) {
    	player.moveTo(plr.get().getPosition().copy());
    }
    Is pretty much the same thing as this

    Code:
    if(parts[0].equals("home")) {
    	player.moveTo(new Position(X_COORDINATE, Y_COORDINATE);
    }
    Reply With Quote  
     

  7. #7  
    Banned Adding teleports. Market Banned


    Join Date
    Feb 2018
    Posts
    824
    Thanks given
    9
    Thanks received
    236
    Rep Power
    0
    Quote Originally Posted by Goody View Post
    This

    Code:
    if(parts[0].equals("teleto")) {
    	Optional<Player> plr = World.getPlayerByName(command.substring(parts[0].length() + 1));
    	if(plr.isPresent()) {
    	player.moveTo(plr.get().getPosition().copy());
    }
    Is pretty much the same thing as this

    Code:
    if(parts[0].equals("home")) {
    	player.moveTo(new Position(X_COORDINATE, Y_COORDINATE);
    }


    Well, this is the correct teleport command for me, "Random1" being the teleport I added just for example. I got it figured out obviously, thanks though guys.

    Code:
    	public void execute(Player c, String input) {
    		if (Server.getMultiplayerSessionListener().inAnySession(c)) {
    			return;
    		}
    		if (c.inClanWars() || c.inClanWarsSafe()) {
    			c.sendMessage("@cr10@You can not teleport from here, speak to the doomsayer to leave.");
    			return;
    		}
    		if (c.inWild()) {
    			return;
    		}
    		c.getPA().spellTeleport(2979, 3597, 0, false);
    	}
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Adding teleport like on current EmpireScape
    By Homie Pimpson in forum Tutorials
    Replies: 39
    Last Post: 09-13-2009, 09:31 AM
  2. Replies: 9
    Last Post: 07-18-2009, 09:43 AM
  3. adding teleports on quest tab?
    By x firecape x in forum Help
    Replies: 4
    Last Post: 04-12-2009, 10:45 AM
  4. Adding teleport interphase
    By adamhelloman8 in forum Help
    Replies: 8
    Last Post: 02-01-2009, 12:04 AM
  5. [TUT] Adding Teleport Book [TUT]
    By WolvesSoulZ in forum Tutorials
    Replies: 5
    Last Post: 10-01-2007, 04:40 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •