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.

Need Help With Global Invite+ban

Old posts that have not been replied to for several years.
Locked
User avatar
CoMMy
Halfop
Posts: 99
Joined: Thu Jul 24, 2003 1:03 am
Location: Cyprus

Need Help With Global Invite+ban

Post by CoMMy »

Hi, I need Some help with global cmds.
I wrote these few commands but they dont work.
Can you help me out please?

I cant get this to globaly ban a host in all channels plus not to ban the owner (host).

Code: Select all

bind pub - !globalban pub_globalban

proc pub_globalban {nick host handle chan testes} {
set who [lindex $testes 0]
set dur [lindex $testes 1]
set why [lrange $testes 2 end]
if {[matchattr $handle n]} {
if {$who == ""} {
putnotc $nick "Usage: !globalban <HOST> <duration> <reason>"
return 0 }
if {[matchattr [nick2hand $who $chan] nQ]} {
putnotc $nick "You cannot ban a user added as a Global member."
return 0 }
if {[matchattr $handle n]} {
putnotc $nick "You cannot ban a user added as a Global member."
return 0 }
if {$dur == ""} {set dur "60"}
if {$why == ""} {set why "Requested"}
newban $who $nick "$why" $dur  
putnotc $nick "Banned $who on all chan's with reason $why and duration $dur."
return 1 }}
The Same Problem Is With Global Invite.

Appreciate Your Help.
(c) CoMMy (c)
Resistance is Futile!!
We Are The Borg!!
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

you probably want to remove

Code: Select all

if {[matchattr $handle n]} {
putnotc $nick "You cannot ban a user added as a Global member."
return 0 }
and change the ban creation line to

Code: Select all

newban "*![getchanhost $who]" $nick "$why" $dur
this will make a ban not like nick!*@* but *!ident@host.com. If you like *!*ident@*.com you may use [maskhost [getchanhost $who]] as ban.

Note that you should check to ensure the did not typo using the comment ^^

Code: Select all

if { ![onchan $who] } {
  puthelp "NOTICE $nick :Can't find $who on any channel"
  return 0
}
I would also suggest to use any elseif construct, which will remove all the return 0 lines and you can add an return 1 at the end of ban creation and a return 0 at the end of the proc ^^.
Locked