public boolean playerIsAllowed(String name) {
        boolean bool = false;
        if (portCommand.containsKey(name)) {
            int cid = portCommand.get(name);
            try {
                Connection connection = service.getConnection();
                Statement statement = connection.createStatement();
                String queryCmd = "SELECT num_uses, cooldown FROM commands WHERE c_id = " + cid;
                ResultSet rsCmd = statement.executeQuery(queryCmd);
                if (rsCmd.next()) {
                    int cmd_num = (rsCmd.getInt("num_uses") < 0) ? Integer.MAX_VALUE : rsCmd.getInt("num_uses");
                    long cooldown = (rsCmd.getLong("cooldown") > 0) ? rsCmd.getLong("cooldown") : 0L;
                    String queryPlayer = "SELECT uses, last_use FROM command_uses WHERE c_id = " + cid + " AND player = '" + name + "'";
                    ResultSet rsPlayer = statement.executeQuery(queryPlayer);
                    int uses = 0;
                    long now = System.currentTimeMillis();
                    long last = 0;
                    if (rsPlayer.next()) {
                        uses = rsPlayer.getInt("uses");
                        last = rsPlayer.getLong("last_use") + (cooldown * 1000L);
                    }
                    if (uses < cmd_num && last < now) {
                        bool = true;
                    }
                }
                rsCmd.close();
                statement.close();
            } catch (SQLException e) {
                plugin.debug("Could not check for command! " + e);
            }
        }
        return bool;
    }