Advertisement
Guest User

Untitled

a guest
May 27th, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. public boolean onCommand2(CommandSender sender, Command cmd, String commandLabel, String[] args) {
  2. Player player = (Player) sender;
  3. player.sendMessage("Permission good");
  4. if(cmd.getName().equalsIgnoreCase("ribal")) {
  5. if(player.hasPermission("risingempire.economy")) {
  6. if(args.length == 0) {
  7. sender.sendMessage(ChatColor.RED + "Failed!");
  8. }
  9. if(args.length == 3) {
  10. player.sendMessage("Args good");
  11. if(args[0] != null && args[1] != null && args[2] != null) {
  12. player.sendMessage("Args good not null");
  13. Player targetplayer = player.getServer().getPlayer(args[2]); //Target player
  14. String penz = args[1]; //Balance S
  15. Double value = Double.parseDouble(penz); //Balance D
  16. Double cb = main.eco.getBalance(targetplayer); //Cureent balance
  17. if(args[0].equalsIgnoreCase("give")){ //Give Money
  18. main.eco.depositPlayer(targetplayer, value);
  19. }
  20. if(args[0].equalsIgnoreCase("set")){
  21. main.eco.withdrawPlayer(targetplayer, cb);
  22. main.eco.depositPlayer(targetplayer, value);
  23. }
  24. }
  25. }
  26. }
  27. }
  28. return true;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement