|
| Author |
Message |
Vorx Senior Member

Joined: 21 Dec 2003 Posts: 152
   
|
Posted: Tue Dec 30, 2003 7:57 pm Post subject: |
|
|
Hi,
I have more than 1 administrator for my bot, and in the $admin bit of my bot it is like so:
$admin = 'vorx@vorx.co.uk|helder@alexispro.com';
Then on a command I have this:
| Code: | | <br />sub admin {<br /><br />$adminonly = 1;<br />#open the admin txt <br />open (FILE, "admin.txt");<br />$admin = <FILE>;<br />close(FILE);<br /><br />if($adminonly == 1 && $victim ne "$admin") {<br /><br /> $reply = "Only BOTRIX Admins can view this menu";<br /> <br /> } else {<br /> <br /><br />$reply = ":alert {message}\n";<br />$reply .= ":name {new name}\n";<br />$reply .= ":refresh\n";<br /><br />}<br />}<br />1;<br /> |
And I have checked the admin.txt file and it shows:
vorx@vorx.co.uk|helder@alexispro.com
Yet when either of us try the command it doesn't show us the command, it shows us the:
$reply = "Only BOTRIX Admins can view this menu";
I hope someone can help as I need some sort of admin protection on some commands.
Thanks |
|
| Back to top |
|
 |
Nate God Like

Joined: 12 Nov 2003 Posts: 553
    
|
Posted: Tue Dec 30, 2003 8:13 pm Post subject: |
|
|
You can look up the post about having multiple admins/mods, this code should also work:
| Code: | | if($adminonly == 1 && $admin !~ /$victim/) { |
That says "if $admin doesn't contain $victim, they're not an admin" |
|
| Back to top |
|
 |
Vorx Senior Member

Joined: 21 Dec 2003 Posts: 152
   
|
Posted: Tue Dec 30, 2003 8:16 pm Post subject: |
|
|
Hi and thanks for the reply.
Where does that code go that you posted?
And do you know the link to this post you recommended? |
|
| Back to top |
|
 |
Nate God Like

Joined: 12 Nov 2003 Posts: 553
    
|
|
| Back to top |
|
 |
Vorx Senior Member

Joined: 21 Dec 2003 Posts: 152
   
|
Posted: Tue Dec 30, 2003 8:25 pm Post subject: |
|
|
Thanks Nate, i'll let you know how it goes.
Nate, I'm not sure if I can use that post you linked to, because it looks like Erics bot template and I use Wiredbots so I'm unsure about putting anything in the actual bot.pl file. |
|
| Back to top |
|
 |
|