public boolean onCommand(CommandSender sender, Command cmd,
            String commandLabel, String[] args) {
        Player victim;
        String mod;
        String reason = "";
        int display = 0;

        if (commandLabel.equalsIgnoreCase("warn")) {
            if (sender.hasPermission(SeruBans.WARNPERM) || sender.isOp()
                    || (!(sender instanceof Player))) {
                if (args.length == 0) {
                    return false;
                } else if (args.length > 1) {
                    reason = ArgProcessing.reasonArgs(args);
                } else {
                    reason = "undefined";
                }
                mod = sender.getName();
                victim = plugin.getServer().getPlayer(args[0]);
                // processes Warn message

                String line = "";
                if (victim != null) {
                    CheckPlayer.checkPlayer(victim, sender);
                    MySqlDatabase.addBan(victim.getName(), SeruBans.WARN, 0,
                            mod, reason, display);
                    // Warns and broadcasts message
                    SeruBans.printServer(ArgProcessing.GlobalMessage(
                            WarnMessage, reason, mod, victim.getName()));
                    plugin.log.info(mod + " warned " + victim.getName()
                            + " for " + reason);
                    victim.sendMessage(ArgProcessing.GetColor(ArgProcessing
                            .PlayerMessage(WarnPlayerMessage, reason, mod)));

                    // adds player to db
                    return true;
                } else {
                    CheckPlayer.checkPlayerOffline(args[0], sender);
                    MySqlDatabase.addBan(args[0], 3, 0, mod, reason, display);
                    // broadcasts message
                    SeruBans.printServer(ArgProcessing.GlobalMessage(
                            WarnMessage, reason, mod, args[0]));
                    plugin.log.info(mod + " warned " + args[0] + " for "
                            + reason);
                    return true;
                }
            } else {
                sender.sendMessage(ChatColor.RED + "You do not have permission!");
            }
        }
        return false;
    }