diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpall.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpall.java new file mode 100644 index 000000000..5793b7978 --- /dev/null +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpall.java @@ -0,0 +1,45 @@ +package com.earth2me.essentials.commands; + +import org.bukkit.Server; +import com.earth2me.essentials.Essentials; +import com.earth2me.essentials.User; +import org.bukkit.entity.Player; + + +public class Commandtpall extends EssentialsCommand +{ + public Commandtpall() + { + super("tpall"); + } + + @Override + public void run(Server server, Essentials parent, User user, String commandLabel, String[] args) throws Exception + { + if (args.length < 1) + { + user.charge(this); + user.sendMessage("§7Teleporting..."); + for (Player player : server.getOnlinePlayers()) { + User p = User.get(player); + if (p == user) { + continue; + } + p.teleportToNow(user); + } + } + else + { + User p = getPlayer(server, args, 0); + user.charge(this); + user.sendMessage("§7Teleporting..."); + for (Player player : server.getOnlinePlayers()) { + User u = User.get(player); + if (p == u) { + continue; + } + u.teleportToNow(p); + } + } + } +} diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml index e91caeb65..8bd096375 100644 --- a/Essentials/src/plugin.yml +++ b/Essentials/src/plugin.yml @@ -207,6 +207,9 @@ commands: tpahere: description: Request that the specified player teleport to you. usage: / + tpall: + desctiption: Teleport all online players to another player. + usage: / tpdeny: description: Reject a teleport request. usage: /