Sorry, made a couple of small mistakes. Tested this and it works:

Code:
alias getuserlist {
  var %ini = $ini($2-,$1)
  ; Syntax: /getuserlist <section> <path\file>
  if (!$isfile($2-)) .notice $nick File doesn't exist. $+($chr(40),$2-,$chr(41))
  elseif (!%ini) .notice $nick Section $+(,$1,) does not exist. $+($chr(40),$2-,$chr(41))
  else {
    var %i = 0
    while ($readini($2-,$1,n $+ %i) != $null) {
      .notice $nick $gettok($v1,2,58)
      inc %i
    }
  }
}