summaryrefslogtreecommitdiffstats
path: root/Essentials/src/com/earth2me/essentials/commands/Commandpay.java
diff options
context:
space:
mode:
Diffstat (limited to 'Essentials/src/com/earth2me/essentials/commands/Commandpay.java')
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandpay.java42
1 files changed, 42 insertions, 0 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandpay.java b/Essentials/src/com/earth2me/essentials/commands/Commandpay.java
new file mode 100644
index 000000000..085f8febe
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandpay.java
@@ -0,0 +1,42 @@
+package com.earth2me.essentials.commands;
+
+import org.bukkit.Server;
+import org.bukkit.command.CommandSender;
+import com.earth2me.essentials.Essentials;
+import org.bukkit.entity.Player;
+import com.earth2me.essentials.User;
+import com.earth2me.essentials.commands.EssentialsCommand;
+
+
+public class Commandpay extends EssentialsCommand
+{
+ public Commandpay()
+ {
+ super("pay");
+ }
+
+ @Override
+ public void run(Server server, Essentials parent, User user, String commandLabel, String[] args) throws Exception
+ {
+
+ int amount;
+ try
+ {
+ amount = Integer.parseInt(args[1].replaceAll("[^0-9]", ""));
+ }
+ catch (Exception ex)
+ {
+ user.sendMessage("§cUsage: /" + commandLabel + " [player] [money]");
+ return;
+ }
+
+ for (Player p : server.matchPlayer(args[0]))
+ {
+ User u = User.get(p);
+ user.payUser(u, amount);
+ }
+ }
+
+
+
+}