on *:text:!op *:#: {
var %lines = $lines(access.txt)
var %current = 1
while (%current <= %lines) {
if ($nick == $read(access.txt, %current) {
mode # +o $iif(!$2,$nick,$2)
var %current = $calc(%lines + 1)
}
elseif (%current == %lines) {
.notice $nick You're Not In My Access List. You Can't Use This Command.
break
}
;This can be left out ^^ (from elseif (%current == %lines) to break } )
else {
inc %current
}
}
}
That should op $2 if $nick is in access.txt, or op $nick if no $2 is specified...
Now, to make sure only ops can make ops, and halfops cant...
add this before the while:
if ($nick isop $chan) {
WHILE LOOP HERE
}