This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Small problem with !op script

Old posts that have not been replied to for several years.
Locked
R
Real
Voice
Posts: 24
Joined: Mon Mar 08, 2004 11:27 am

Small problem with !op script

Post by Real »

Hello

I want to make a script that has this:

Owners (or higher) can use " !op nick " to op this person. Nick is optional, otherwise it will op the person himself.

But I also want the script to let ops in the channel use the command. So everybody who has op, can use " !op nick " too, and that's were the problem is:

Code: Select all

bind pub o|o !op pub_op_own
bind pub - !op pub_op


proc pub_op {nick mask hand chan text} {
 if {[isop $nick $chan]} { 
    set opname "[lindex $text 0]"
	if {$opname != ""} {
	 pushmode $chan +o $opname 
	}
     }
}

proc pub_op_own {nick mask hand chan text} { 
    set opname "[lindex $text 0]"
	if {$opname == ""} {
       pushmode $chan +o $nick }
	if {$opname != ""} {
	 pushmode $chan +o $opname 
	}
     }
So as I've expected, only the second proc works now, so ops cannot use the !op command.

Any solution to this? Thank you :)
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

Code: Select all

bind pub - !op pub_op 


proc pub_op {nick mask hand chan text} { 
	if {[isop $nick $chan] || [matchattr $hand o|o $chan]} { 
		set opname "[lindex $text 0]" 
		if {$opname != "" && [matchattr $hand o|o $chan]} { 
			pushmode $chan +o $nick 
		} elseif {$opname != ""} {
			pushmode $chan +o $opname 
		}
	} 
} 
Elen sila lúmenn' omentielvo
Locked