@Override
	public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {

		try {

			if (!(sender instanceof Player)) {
				sender.sendMessage(ChatColor.RED + "You can only register if you're on the server!");
				return true;
			}

			if (args.length != 2) {
				sender.sendMessage(ChatColor.RED + "You have entered invalid arguments!");
				return false;
			}

			if (!this.isValidEmailAddress(args[0])) {
				sender.sendMessage(ChatColor.RED + "You have entered an invalid email!");
				return true;
			}

			if (args[1].length() < 3) {
				sender.sendMessage(ChatColor.RED + "Your password is smaller than 3 characters!");
				return true;
			}
		
			Player player = (Player)sender;

			if (HyperPVP.getStorage().readString("SELECT password FROM users WHERE username = '" + player.getName() + "'").length() != 0) {
				sender.sendMessage(ChatColor.GREEN + "Your account is already registered!");
				return true;
			}
			
			if (!HyperPVP.getStorage().entryExists("SELECT * FROM pincodes WHERE name = '" + player.getName() + "'")) {

				String pin = random();
				
				PreparedStatement statement = HyperPVP.getStorage().queryParams("INSERT INTO pincodes (id, name, email, password) VALUES (?, ?, ?, ?)"); {
					statement.setString(1, pin);
					statement.setString(2, player.getName());
					statement.setString(3, args[0]);
					statement.setString(4, args[1]);
					statement.execute();
				}
				
				player.sendMessage(ChatColor.GOLD + "Please go to " + ChatColor.YELLOW + "http://paintballpvp.com/register" + ChatColor.GOLD + " and enter your pincode " + ChatColor.YELLOW + pin);
			} else {
				sender.sendMessage(ChatColor.RED + "Your account is already registered, type /pin if you forgot your PIN code.");
			}
			
		} catch (Exception e) {
			e.printStackTrace();
		}

		return true;

	}