Next proplem. I am trying to add while loop so you can grant multiple acces grants in same time ie. whole channel or every friend in channel you got.

This is what it looks now:

Code:
menu nicklist {
  $iif($hget(pmusers) == $null, PM rights)
  . Create access rights database {
    hmake pmusers 100
    .notice $me PM access database created.
  }
  $iif($hget(pmusers) != $null, PM rights)
  . $iif($hfind(pmusers, $$1) != $$1, Give, Remove) {
    var %counter = 0  
    while ($$1- != $null) {
      if ($hfind(pmusers, $$N) != $$N) {
        %counter = %counter + 1
        hadd pmusers $$N $$N
        if ($$N == $null && %counter == 1) {
          .notice $me $$N got now PM rights.
        }
        if ($$N == $null && %counter > 1) {
          .notice $me Selected group got now PM rights.
        }        
      }
      else {
        %counter = counter + 1
        hdel -w pmusers $N
        if ($N == $null && %counter == 1) {
          .notice $me Removed PM rights from $$1.
        }
        if ($N == $null && %counter > 1) {
          .notice $me Removed PM rights from selected group.
        }  
      }
    }
  }
  .-
  . Remove access database {
    hfree -w pmusers
    .notice $me PM access database destroyed.
  }
} 


How ever, the while loop dosent do anything so there must be somehting wrong.

Can anybody help?

Last edited by Jeroi; 17/04/11 11:18 AM.