CommandpacketListener.java
code should be like this to move the player to a coord
player.moveTo(new Position(X coords, Y coords));
|
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.
CommandpacketListener.java
code should be like this to move the player to a coord
player.moveTo(new Position(X coords, Y coords));
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.
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:if (command[0].equalsIgnoreCase("home")) { TeleportHandler.teleportPlayer(player, new Position(2331, 3678), player.getSpellbook().getTeleportType()); }
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()); }
This
Is pretty much the same thing as thisCode: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()); }
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); }
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |