Jump to content

Ban 3 days request


Hedning

Recommended Posts

here, you can figure out of this script.. use it like !tempban <#>

on *:SIGNAL:mta.command:{
 var %a = $iif($4,$iif($mta.nick($1,$4) != Unknown,$4,$mta.getid($1,$4)),$2)
 if ($3 == !tempban) {
   if (%a == $2) mta.msg $1 $2 Error - You cant tempban yourself
   elseif (%a == -1) mta.msg $1 $2 Error - Absent ID
   else {
     if ($5 isnum) {
       if ((m* iswm $6) || (h* iswm $6) || (d* iswm $6)) {
         if (m* iswm $6) {
           mta.text $1 $mta.nick($1,%a) has been banned for $5 minute $+ $iif($5 != 1,s) $+ , by $mta.nick($1,$2) $+ . $iif($7,Reason: $7-)
           !.timer 1 $calc($5 * 60) temp.unban $1 $mta.nick($1,%a)
           !writeini " $+ $scriptdir $+ tempbans.ini" $mta.server($1) $mta.nick($1,%a) $calc($ctime + $5 * 60)
         }
         elseif (h* iswm $6) {
           mta.text $1 $mta.nick($1,%a) has been banned for $5 hour $+ $iif($5 != 1,s) $+ , by $mta.nick($1,$2) $+ . $iif($7,Reason: $7-)
           !.timer 1 $calc($5 * 3600) temp.unban $1 $mta.nick($1,%a)
           !writeini " $+ $scriptdir $+ tempbans.ini" $mta.server($1) $mta.nick($1,%a) $calc($ctime + $5 * 3600)
         }
         elseif (d* iswm $6) {
           mta.text $1 $mta.nick($1,%a) has been banned for $5 day $+ $iif($5 != 1,s) $+ , by $mta.nick($1,$2) $+ . $iif($7,Reason: $7-)
           !.timer 1 $calc($5 * 86400) temp.unban $1 $mta.nick($1,%a)
           !writeini " $+ $scriptdir $+ tempbans.ini" $mta.server($1) $mta.nick($1,%a) $calc($ctime + $5 * 86400)
         }
         !writeini " $+ $scriptdir $+ tempbans.ini" IPS $mta.nick($1,%a) $mta.ip($1,%a)
         mta.ban $1 $2
       }
     }
   }
 }
}
on *:SIGNAL:mta.connect:{
 while (%a <= $ini($scriptdir $+ tempbans.ini,$mta.server($1),0)) {
   %b = $readini($scriptdir $+ tempbans.ini,$mta.server($1),$ini($scriptdir $+ tempbans.ini,$mta.server($1),%a))
   if (%b) {
     if ($ctime >= %b) temp.unban $1 $readini($scriptdir $+ tempbans.ini,IPS,$ini($scriptdir $+ tempbans.ini,$mta.server($1),%a))
     else !.timer 1 $calc(%b - $ctime) temp.unban $1 $readini($scriptdir $+ tempbans.ini,IPS,$ini($scriptdir $+ tempbans.ini,$mta.server($1),%a))
   }
   !inc %a
 }
}
alias temp.unban {
 mta.unban $1 $2
 mta.text $1 $+(',$readini($scriptdir $+ tempbans.ini,IPS,$2),') unbanned.
 !remini " $+ $scriptdir $+ tempbans.ini" IPS $mta.nick($1,$2)
 !remini " $+ $scriptdir $+ tempbans.ini" $mta.server($1) $mta.nick($1,$2)
}

Edited by Guest
Link to comment

Tx

I cant figure it out. :( but if i want to ban someone i write e.g !tempban dude 60

Then will the dude be banned 60 minutes?

But how do i write for hours then?

And how do i make it so only admins can use it?

I have MTA:SA General Use Scripts | Final Version btw.

Hope you understand.

Link to comment

here is one for GUS admins with level more than 7

on *:SIGNAL:mta.command:{
 var %a = $iif($4,$iif($mta.nick($1,$4) != Unknown,$4,$mta.getid($1,$4)),$2)
 if ($3 == !tempban) {
   if ($gus.level($1,$2) >= 7) {
     if (%a == $2) mta.msg $1 $2 Error - You cant tempban yourself
     elseif (%a == -1) mta.msg $1 $2 Error - Absent ID
     elseif ($gus.level($1,$2) <= $gus.level($1,%a)) mta.msg $1 $2 Error - Can't ban a player with the same or higher level
     else {
       if ($5 isnum) {
         if ((m* iswm $6) || (h* iswm $6) || (d* iswm $6)) {
           if (m* iswm $6) {
             mta.text $1 $mta.nick($1,%a) has been banned for $5 minute $+ $iif($5 != 1,s) $+ , by $mta.nick($1,$2) $+ . $iif($7,Reason: $7-)
             !.timer 1 $calc($5 * 60) temp.unban $1 $mta.nick($1,%a)
             !writeini " $+ $scriptdir $+ tempbans.ini" $mta.server($1) $mta.nick($1,%a) $calc($ctime + $5 * 60)
           }
           elseif (h* iswm $6) {
             mta.text $1 $mta.nick($1,%a) has been banned for $5 hour $+ $iif($5 != 1,s) $+ , by $mta.nick($1,$2) $+ . $iif($7,Reason: $7-)
             !.timer 1 $calc($5 * 3600) temp.unban $1 $mta.nick($1,%a)
             !writeini " $+ $scriptdir $+ tempbans.ini" $mta.server($1) $mta.nick($1,%a) $calc($ctime + $5 * 3600)
           }
           elseif (d* iswm $6) {
             mta.text $1 $mta.nick($1,%a) has been banned for $5 day $+ $iif($5 != 1,s) $+ , by $mta.nick($1,$2) $+ . $iif($7,Reason: $7-)
             !.timer 1 $calc($5 * 86400) temp.unban $1 $mta.nick($1,%a)
             !writeini " $+ $scriptdir $+ tempbans.ini" $mta.server($1) $mta.nick($1,%a) $calc($ctime + $5 * 86400)
           }
           !writeini " $+ $scriptdir $+ tempbans.ini" IPS $mta.nick($1,%a) $mta.ip($1,%a)
           mta.ban $1 %a
         }
       }
     }
   }
 }
}
on *:SIGNAL:mta.connect:{
 while (%a <= $ini($scriptdir $+ tempbans.ini,$mta.server($1),0)) {
   %b = $readini($scriptdir $+ tempbans.ini,$mta.server($1),$ini($scriptdir $+ tempbans.ini,$mta.server($1),%a))
   if (%b) {
     if ($ctime >= %b) temp.unban $1 $readini($scriptdir $+ tempbans.ini,IPS,$ini($scriptdir $+ tempbans.ini,$mta.server($1),%a))
     else !.timer 1 $calc(%b - $ctime) temp.unban $1 $readini($scriptdir $+ tempbans.ini,IPS,$ini($scriptdir $+ tempbans.ini,$mta.server($1),%a))
   }
   !inc %a
 }
}
alias temp.unban {
 mta.unban $1 $2
 mta.text $1 $+(',$readini($scriptdir $+ tempbans.ini,IPS,$2),') unbanned.
 !remini " $+ $scriptdir $+ tempbans.ini" IPS $mta.nick($1,$2)
 !remini " $+ $scriptdir $+ tempbans.ini" $mta.server($1) $mta.nick($1,$2)
}

use it like:

!tempban dude 50 mins (for 50 mins ban)

!tempban dude 2 hours (for 2 hours ban)

!tempban dude 1 day (for a day ban)

Edited by Guest
Link to comment

does it give any errors in mirc?

try this, if even this won't work, can't help you :? on my 6.16 mirc works perfect..

on *:SIGNAL:mta.command:{
 if ($3 == !tempban) {
   if ($gus.level($1,$2) >= 7) {
     var %a = $iif($4,$iif($mta.nick($1,$4) != Unknown,$4,$bla.getid($1,$4)),$2)
     if (%a == $2) mta.msg $1 $2 Error - You cant tempban yourself
     elseif (%a == -1) mta.msg $1 $2 Error - Absent ID
     elseif ($gus.level($1,$2) <= $gus.level($1,%a)) mta.msg $1 $2 Error - Can't ban a player with the same or higher level
     else {
       if ($5 isnum) {
         if ((m* iswm $6) || (h* iswm $6) || (d* iswm $6)) {
           if (m* iswm $6) {
             mta.text $1 $mta.nick($1,%a) has been banned for $5 minute $+ $iif($5 != 1,s) $+ , by $mta.nick($1,$2) $+ . $iif($7,Reason: $7-)
             !.timer 1 $calc($5 * 60) temp.unban $1 $mta.nick($1,%a)
             !writeini " $+ $scriptdir $+ tempbans.ini" $mta.server($1) $mta.nick($1,%a) $calc($ctime + $5 * 60)
           }
           elseif (h* iswm $6) {
             mta.text $1 $mta.nick($1,%a) has been banned for $5 hour $+ $iif($5 != 1,s) $+ , by $mta.nick($1,$2) $+ . $iif($7,Reason: $7-)
             !.timer 1 $calc($5 * 3600) temp.unban $1 $mta.nick($1,%a)
             !writeini " $+ $scriptdir $+ tempbans.ini" $mta.server($1) $mta.nick($1,%a) $calc($ctime + $5 * 3600)
           }
           elseif (d* iswm $6) {
             mta.text $1 $mta.nick($1,%a) has been banned for $5 day $+ $iif($5 != 1,s) $+ , by $mta.nick($1,$2) $+ . $iif($7,Reason: $7-)
             !.timer 1 $calc($5 * 86400) temp.unban $1 $mta.nick($1,%a)
             !writeini " $+ $scriptdir $+ tempbans.ini" $mta.server($1) $mta.nick($1,%a) $calc($ctime + $5 * 86400)
           }
           !writeini " $+ $scriptdir $+ tempbans.ini" IPS $mta.nick($1,%a) $mta.ip($1,%a)
           mta.ban $1 %a
         }
       }
     }
   }
 }
}
on *:SIGNAL:mta.connect:{
 while (%a <= $ini($scriptdir $+ tempbans.ini,$mta.server($1),0)) {
   %b = $readini($scriptdir $+ tempbans.ini,$mta.server($1),$ini($scriptdir $+ tempbans.ini,$mta.server($1),%a))
   if (%b) {
     if ($ctime >= %b) temp.unban $1 $readini($scriptdir $+ tempbans.ini,IPS,$ini($scriptdir $+ tempbans.ini,$mta.server($1),%a))
     else !.timer 1 $calc(%b - $ctime) temp.unban $1 $readini($scriptdir $+ tempbans.ini,IPS,$ini($scriptdir $+ tempbans.ini,$mta.server($1),%a))
   }
   !inc %a
 }
}
alias temp.unban {
 mta.unban $1 $2
 mta.text $1 $+(',$readini($scriptdir $+ tempbans.ini,IPS,$2),') unbanned.
 !remini " $+ $scriptdir $+ tempbans.ini" IPS $mta.nick($1,$2)
 !remini " $+ $scriptdir $+ tempbans.ini" $mta.server($1) $mta.nick($1,$2)
}
alias bla.getid {
 var %a = 0
 while (%a <= $mta.server($1).cmax)  {
   if ($2 isin $mta.nick($1,%a)) !return %a
   !inc %a
 }
 !return -1
}

Link to comment
  • Recently Browsing   0 members

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