mIRC Home    About    Download    Register    News    Help

Print Thread
M
Matrix301
Matrix301
M
hello i just made this little script to let admin of my counter-strike 1.6 clan add roster but one thing dont work: when a use exist, instead to say error dont exist, it add it. i cant find the problem, can anyone help

Code:
on *:TEXT:!rosters add *:?: {
  if ($level($nick) >= 100) {
    if ($read(Scripts\txts\Rosters.txt, s, $3-)) {
      msg $nick 14«15«0«4 $3- is already a roster! 0»15»14»
      halt
    }
    else {
      write Scripts\txts\Rosters.txt $3-
      msg #nLegends 14«15«0« Added4 $3- to the rosters. 0»15»14»
      msg $nick 14«15«0« Added4 $3- to the rosters. 0»15»14»
    }
  }
  else ($level($nick) < 100) {
    msg $nick 14«15«0«  Access Denied 70»15»14»
  }
}

Joined: Aug 2004
Posts: 7,168
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,168
1) Change your $3- to $2-
2) Remove the halt
3) Remove ($level($nick) < 100)

Try those changes and get back to me.

M
Matrix301
Matrix301
M
hmm no, its $3- and it dont work, keep adding it even if it exist

Joined: Oct 2004
Posts: 8,061
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Oct 2004
Posts: 8,061
First, your else line is invalid.

It should either say "elseif" and remain the way it is, or you should lose everything after "else" besides the {.

Also, try changing the read line to not be "s" but instead have it be "w".

See if those changes make it work for you.

M
Matrix301
Matrix301
M
which else ? i dont follow you

Joined: Aug 2004
Posts: 7,168
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,168
Hmm...sorry about the mixup on the $2, $3..I counted wrong.
In any case, I've done a bit of a rewrite on your code, and come up with this. Give it a try and let me know if it works. At present I'm unable to test it
Code:
on &gt;=100:TEXT:!rosters add *:?: {
    if ($read(Scripts\txts\Rosters.txt, w, $3-)) {
      msg $nick 14«15«0«4 $3- is already a roster! 0»15»14» 
 }
    else {
      write Scripts\txts\Rosters.txt $3-
      msg #nLegends 14«15«0« Added4 $3- to the rosters. 0»15»14» 
     msg $nick 14«15«0« Added4 $3- to the rosters. 0»15»14» 
   }
}
on &lt;100:TEXT:!rosters add *:?: { 
   msg $nick 14«15«0«  Access Denied 70»15»14»  }  

M
Matrix301
Matrix301
M
nah it dont work

Joined: Mar 2005
Posts: 420
X
Fjord artisan
Offline
Fjord artisan
X
Joined: Mar 2005
Posts: 420
Try this

Code:
 on *:TEXT:!rosters add *:?: {
  if ($level($nick) &gt;= 100) {
    if ($read(Scripts\txts\Rosters.txt, w, $3-)) {
      msg $nick 14«15«0«4 $3- is already a roster! 0»15»14»
    }
    else {
      write Scripts\txts\Rosters.txt $3-
      msg #nLegends 14«15«0« Added4 $3- to the rosters. 0»15»14»
      msg $nick 14«15«0« Added4 $3- to the rosters. 0»15»14»
    }
  }
  else msg $nick 14«15«0«  Access Denied 70»15»14»
} 

Joined: Oct 2004
Posts: 8,061
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Oct 2004
Posts: 8,061
Quote:
which else ? i dont follow you


Sorry, I meant the last one.


Link Copied to Clipboard