Jump to content

Advanced Ban System v1.0


Guest [UVA]Phil

Recommended Posts

alias mta.findid {
 var %a = 0
 while (%a <= $readini($mta.dir $+ mta.ini,$1,max))  {
   if $2 isnum { 
     if $mta.name($1,$2) != Unknown { !return $2 }
     else {
       var %b = 0
       while %b <= $readini($mta.dir $+ mta.ini,$1,max) {
         if ($+(*,$2,*) iswm $readini($mta.dir $+ $1.ini,ID $+ %b,name)) !return %b
         !inc %b
       }
       !return -1
     }
   }
   elseif ($+(*,$2,*) iswm $readini($mta.dir $+ $1.ini,ID $+ %a,name)) !return %a
   !inc %a
 }
 !return -1
}
on *:SIGNAL:mta.command: {
var %b = $iif($4 == $null,$2,$mta.findid($1,$4)))
elseif $3 == !ban {
 if $2 == %b mta.msg $1 $2 Error - You cannot ban you
   else {
     if %b == -1 mta.say $1 Error - Invalid ID
       else { 
         mta.say $1 $+(',$mta.name($1,%b),') is banned by admin $+(',$mta.name($1,$2),':) $iif($5,$5-,No reason.)
         !writeini -n "MTAbans.ini" banreasons $mta.name($1,%b) $5- $date $time $mta.name($1,$2)
         !writeini -n "MTAbans.ini" bannedip $mta.name($1,%b) $mta.ip($1,%b) $date $time $mta.name($1,$2)
         !writeini -n "MTAbans.ini" main $mta.name($1,%b) 4
         !writeini -n "data.ini" ip $gettok($mta.ip($1,$2),1-2,46) $mta.name($1,%b)
         mta.ban $1 %b
       }
     }
     elseif $3 == !blacklist {
       if %b == -1 mta.say $1 Error - Invalid ID
       else mta.say $1 $mta.name($1,%b) - Added to the Blacklist
       !writeini -n "blacklist.ini" $mta.name($1,%b) $mta.ip($1,%b) 1
       !writeini -n "blacklist.ini" $mta.name($1,%b) $mta.name($1,%b) 1
       !writeini -n "blacklist.ini" $mta.name($1,%b) $gettok($mta.ip($1,$2),1-2,46) 1
       mta.ban $1 %b          
     }
   }
 }
}
on *:SIGNAL:mta.join: {
 if ($gettok($mta.ip($1,$2),1-2,46)) && $readini(data.ini,shortip,$gettok($mta.ip($1,$2),1-2,46)) { 
   mta.say $1 Warning: $mta.name($1,$2) - First 2 ip groups match $readini(data.ini,ip,$gettok($mta.ip($1,$2),1-2,46)), who was banned. $+
 }
 if ($readini(blacklist.ini,$mta.name($1,$2),$mta.ip($1,$2)) == 1) { 
   mta.say $1 $mta.name($1,$2) Reason: Blacklisted
   mta.ban $1 $2 
 }
 if ($readini(blacklist.ini,$mta.name($1,$2),$mta.name($1,$2)) == 1) { 
   mta.say $1 $mta.name($1,$2) Reason: Blacklisted
   mta.ban $1 $2 
 }
 if ($readini(blacklist.ini,$mta.name($1,$2),$gettok($mta.ip($1,$2),1-2,46)) == 1) { 
   mta.say $1 $mta.name($1,$2) Reason: Blacklisted
   mta.ban $1 $2 
 }
}

Link to comment

its basically a compilation of stuff. The ip match thing is something i wrote in 0.3.. and the findid system is mine too.. and the blacklist thing.. if u wanna call it that is based on a script of aerons i think.

Link to comment
its basically a compilation of stuff. The ip match thing is something i wrote in 0.3.. and the findid system is mine too.. and the blacklist thing.. if u wanna call it that is based on a script of aerons i think.

can you add it to GRS anyway?

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...