@Override
	public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
		if (sender.hasPermission("CreeperWarning.warn")) {
			if (args.length >= 2) {
				String prefix = CreeperWarningMain.chat.getPlayerPrefix((Player) sender);
				prefix = CreeperWarningMain.replaceChatColors(prefix);
				plugin.toPlayer = args[0];
				this.toPlayer = plugin.toPlayer;
				String[] alltheargs = args;
				StringBuilder reason = new StringBuilder();
				Calendar currentDate = Calendar.getInstance();
				SimpleDateFormat formatter = new SimpleDateFormat("yyyy/MMM/dd HH:mm:ss");
				String dateNow = formatter.format(currentDate.getTime());
				if (!(sender instanceof Player)) {
					sender.sendMessage(ChatColor.RED + NAME + "This command my only be run as a player!");
				} else {
					if (!(args.length <= 1)) {
						for (String s : alltheargs) {
							if (s.equalsIgnoreCase(toPlayer)) {
								s.equals("");
								continue;
							}
							reason.append(s);
							reason.append(" ");
						}

						int test = plugin.lookUp(toPlayer);

						if (Bukkit.getPlayer(toPlayer) != null) {
							if (test == 0) {
								WarnLevel.addPlayer(Bukkit.getPlayer(toPlayer));
							} else {
								double added = Math.floor(Math.round((WarnLevel.getPoints(Bukkit.getPlayer(toPlayer)) / 2) + 5) * Math.sin(Math.PI / Math.sqrt(1)) * 10000000000000000d);
								WarnLevel.addPointsToLevel(Bukkit.getPlayer(toPlayer), Math.floor(Math.round((WarnLevel.getPoints(Bukkit.getPlayer(toPlayer)) / 2) + 5) * ((Math.sin(Math.PI / Math.sqrt(1)))) * 10000000000000000d));

								double totalPoints = WarnLevel.getPoints(Bukkit.getPlayer(toPlayer));
								// Bukkit.broadcastMessage("Player: " + toPlayer
								// + " Has had "+ added
								// +" points added! Total Points: " +
								// totalPoints);
								pds.editDataLevel(toPlayer, (double) totalPoints);
							}
							// if((WarnLevel.getPoints(Bukkit.getPlayer(toPlayer))
							// >= 50) &&
							// (WarnLevel.getPoints(Bukkit.getPlayer(toPlayer))
							// <= 100)){
							// Bukkit.getPlayer(toPlayer).kickPlayer("You have gained too many damn points, last warning: "
							// + reason);
							// }

							Bukkit.getServer().getPlayer(toPlayer).sendMessage(ChatColor.DARK_RED + plugin.getConfig().getString("customMessageLineOne"));
							Bukkit.getServer().getPlayer(toPlayer).sendMessage(ChatColor.DARK_RED + "" + ChatColor.BOLD + plugin.getConfig().getString("customMessageLineTwo"));
							Bukkit.getServer().getPlayer(toPlayer).sendMessage(ChatColor.DARK_RED + "" + ChatColor.BOLD + plugin.getConfig().getString("customMessageLineThree") + ": " + reason);
							Bukkit.getServer().getPlayer(toPlayer).sendMessage(ChatColor.DARK_RED + "" + ChatColor.BOLD + plugin.getConfig().getString("customMessageLineFour") + ": " + prefix + sender.getName());
							Bukkit.getServer().getPlayer(toPlayer).sendMessage(ChatColor.DARK_RED + "" + ChatColor.BOLD + plugin.getConfig().getString("customMessageLineFive") + ": " + dateNow);
							Bukkit.getServer().getPlayer(toPlayer).sendMessage(ChatColor.DARK_RED + plugin.getConfig().getString("customMessageLineSix"));
							plugin.lookUpPlayerWarns(toPlayer, sender);
							plugin.getLogger().info(ChatColor.GREEN + NAME + sender.getName() + " has warned " + toPlayer + " for " + reason);
							sender.sendMessage(ChatColor.RED + NAME + ChatColor.GREEN + "Player " + toPlayer + " has been warned!");
							plugin.logToFile(toPlayer + "|" + reason.toString() + "|" + sender.getName() + "|" + dateNow);
						} else {
							sender.sendMessage(CreeperWarningMain.NAME + ChatColor.RED + "Player not found!");

						}

					}
				}
			} else {
				sender.sendMessage("The correct command is /warn <Player> <Reason>");
			}
		}
		return false;
	}