mIRC Homepage

Variables

Posted By: michaelukz

Variables - 11/09/15 02:28 AM

Variables... Where should I start.... I hate them... I pretty much hate everything I suck at but variables are the worst haha,

Code:
  var %permStat = $readini(permlist.ini, #michaelukz, $2)



That is the specific part, Here is the breakdown, that code determines if I have enough permission that is found in my personal permissions file IE, not the 1,2,3,4,5 etc from default, instead I prefer to use my own so I can easily edit it, anyways, here is the writing section

Code:
writeini -n permlist.ini #michaelukz $2 3


Now when trying to use a specific MOD ONLY section, it seems it just skips it all together, here it is :3

Code:
var %permStat = $readini(permlist.ini, #michaelukz, $2)
  if (%permStat > 5) {
    msg $chan /me Error you do not have sufficient permissions!
    return
  }


However, it seems to be skipping that because it is allowing someone with 0 permissions to do this!
Posted By: Wims

Re: Variables - 11/09/15 12:30 PM

Everything looks correct, perhaps you meant:
Code:
if (%permStat < 5) {

}
Giving an 'error' if the level is less than 5 because currently, 0 is not higher than 5 so it doesn't enter the if condition
© 2021 mIRC Discussion Forums