diff options
author | snowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-03-19 22:39:51 +0000 |
---|---|---|
committer | snowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-03-19 22:39:51 +0000 |
commit | a3ebd254f2897951a2ce31fdd90b6944c582d82b (patch) | |
tree | 11c8670882eed130d7ff1b33cc7c65e496f1bbac /Essentials/src/com/earth2me/essentials/commands/Commandpay.java | |
parent | 487577f2fa856a61077594ad6677f0bdd7150fcd (diff) | |
download | Essentials-a3ebd254f2897951a2ce31fdd90b6944c582d82b.tar Essentials-a3ebd254f2897951a2ce31fdd90b6944c582d82b.tar.gz Essentials-a3ebd254f2897951a2ce31fdd90b6944c582d82b.tar.lz Essentials-a3ebd254f2897951a2ce31fdd90b6944c582d82b.tar.xz Essentials-a3ebd254f2897951a2ce31fdd90b6944c582d82b.zip |
Moving all files to trunk.
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@969 e251c2fe-e539-e718-e476-b85c1f46cddb
Diffstat (limited to 'Essentials/src/com/earth2me/essentials/commands/Commandpay.java')
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandpay.java | 42 |
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); + } + } + + + +} |