Esempio n. 1
0
  @Override
  public boolean onCommand(CommandSender s, Command cmd, String label, String[] args) {
    if (s instanceof Player) {
      Player p = (Player) s;
      if (p.hasPermission("mcrp.msg")) {
        if (args.length <= 1) {
          Functions.tell(p, "§cInvalid arguments. Usage: §f/msg <player> <msg>");
        } else {
          Player t = Bukkit.getPlayer(args[0]);
          if (t != null) {
            message(p, t, args, false);

            MPlayer.getMPlayer(p).setReplyTo(t);
            MPlayer.getMPlayer(t).setReplyTo(p);
          } else Functions.unknownPlayer(p);
        }
      } else Functions.noPerm(p);
    }
    return true;
  }
Esempio n. 2
0
 @Override
 public boolean onCommand(CommandSender s, Command cmd, String labal, String[] args) {
   if (s instanceof Player) {
     Player p = (Player) s;
     if (p.hasPermission("mcrp.balance")) {
       if (args.length == 0) {
         MPlayer pm = MPlayer.getMPlayer(p);
         Functions.tell(p, "§6Balance: §c" + pm.getMoney());
       } else {
         if (p.hasPermission("mcrp.balance.others")) {
           Player t = Bukkit.getPlayer(args[0]);
           if (t != null) {
             MPlayer tm = MPlayer.getMPlayer(t);
             Functions.tell(p, "§c" + t.getName() + "§6's balance: §c" + tm.getMoney());
           } else Functions.noPerm(p);
         } else Functions.noPerm(p);
       }
     } else Functions.noPerm(p);
   }
   return true;
 }