Created
December 8, 2013 00:56
-
-
Save darkbro100/7851994 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(args[0].equalsIgnoreCase("addpoints")) { | |
if(args.length == 2) { | |
if(Main.s.getString("players." + args[1].toLowerCase() + ".points") == null) { | |
p.sendMessage(ChatColor.RED + args[1].toLowerCase() + " does not exist!"); | |
return true; | |
} else { | |
Player target = Bukkit.getServer().getPlayer(args[1].toLowerCase()); | |
if(args.length == 3) { | |
try { | |
Integer n = Integer.parseInt(args[2]); | |
Main.s.addPoints(target, n); | |
p.sendMessage(ChatColor.RED + "You gave " + n + " points to player " + target.getName()); | |
} catch (Exception e) { | |
p.sendMessage(ChatColor.RED + args[2] + " is not a valid number!"); | |
} | |
} else { | |
p.sendMessage(ChatColor.RED + "Please supply an amount of points to add!"); | |
} | |
} | |
} else p.sendMessage(ChatColor.RED + "Please supply a player name"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment