Jump to content

!tempBan script


FFCFoo

Recommended Posts

I am not A very good scripter can someone make me a !tempban script for my new script i am writing so i dont have to use GRS i want my script's to be wrote not from GRS just where i can see them :wink:

umm, I hope that works, MTA:VC

on *:SIGNAL:mta.command: { 
if ($3 == !ban) { 
if ($mta.level($1,$2) == 5)  
mta.kick $1 $4 
!writeini -n " $+ $scriptdir $+ badguys.ini" NICK $4 True 
} 
else mta.pm $1 $2 Error - You have 2 be level 5 to use this command!. 
} 
} 
  

  
on *:SIGNAL:mta.join: { 
if ($readini($scriptdir $+ badguys.ini,NICK,$mta.name($1,$2)) == True) { 
mta.msg $1 $2 Sorry You're Banned from this server. 
mta.ban $1 %a 

It's just a Banning script and I hope that works :P I haven't tested it yet, maybe mta.ban $1 %a should be mta.ban $1 $4 or $2

Link to comment

is it for mtasa or 0.5 ? this ones for mtasa

on *:SIGNAL:mta.join: { 
if ($readini(slrtempban.ini,Tempban,$mta.name($1,$2)) == banned) { 
mta.text $1 $2 Sorry You're temporarly Banned from this server. 
mta.kick $1 %a 
} 
on *:SIGNAL:mta.command: { 
 var %a = $iif(($4 == $null),$2,$iif(($mta.getid($1,$4) == $null),$2,$v1)) 
if ($3 == !tempban) { 
if ($mta.level($1,$2) < 4) mta.pm $1 $2 Error: Incorrect Level 
elseif ($mta.level($1,$2) >= 4)  {  
!writeini -n slrtempban.ini Tempban %a banned 
mta.kick $1 %a 
} 
} 
} 

Link to comment

Try this is a ban script

on *:SIGNAL:mta.command: { 
  if ($3 == !ban) { 
    if ($mta.level($1,$2) >= 2)  
    mta.kick $1 $4 
    !writeini -n " $+ $scriptdir $+ banned.ini" Nick $4 True 
  } 
  else mta.msg $1 $2 Error - You have 2 be level 5 to use this command!. 
} 
on *:SIGNAL:mta.join: { 
  if ($readini($scriptdir $+ banned.ini,Nick,$mta.name($1,$2)) == True) { 
    mta.msg $1 $2 Sorry You're Banned from this server. 
    mta.ban $1 $2 
  } 
} 
  

This is a ban script not a tempban just edit into tempban :D

Link to comment

ok since i dont know what kind of script/login u have, i'll leave the level part out, it can be added whenever...

on *:SIGNAL:mta.command: { 
  var %a = $iif($4 == $null,$2,$iif($mta.getid($1,$4) == -1,-1,$v1)) 
  if ($3 == !tban) && ($mta.name($1,$2) == YOURNAME) { 
    if (%a == $2) mta.msg $1 $2 Error, Cannot Ban Self 
    elseif (%a == -1) mta.msg $1 $2 Error, Invalid Name/ID 
    else { 
      var %bantime = $iif($5 !isnum,30,$iif($5 > 1,$5)) 
      mta.say $1 $mta.name($1,$2) Is Tempbanning $mta.name($1,%a) For %bantime Mins. 
      .timer $+ $mta.name($1,%a) 1 $calc(%bantime * 60) mta.unban $1 $mta.ip($1,%a) 
      mta.ban $1 %a 
    } 
  } 
} 
  

!tban - bans player for 30mins

!tban - bans player for specified time in minutes.

this is just something quick, Note: if u ban someone then switch off mirc, they will stay banned.

i havent tested this, so any probs just post here and i will get back to u asap.

Link to comment

yeah id suggest that too.. i just couldnt be bothered to write it off my head.

ive figured out how to do so much cool stuff just lately, like a proper login system for ALL users, for mta race,

uploading server info to a website etc, all with only a normal irc script.

i just cant be bothered to make it now... is it really worth it :mrgreen:

roll on DM!

Link to comment

here's a tempban script i've just written (not tested!)

usage:

!tempban <#time> (like '!tempban scooby 1 day' - 1 day ban or '!tempban scooby 5 m' - 5 minutes ban)

on *:SIGNAL:mta.connect:{ 
  var %a = 1,%ip,%time 
  while (%a <= $ini($scriptdir $+ $1.tempbans.ini,0)) { 
    %ip = $ini($scriptdir $+ $1.tempbans.ini,%a) 
    %time = $readini($scriptdir $+ $1.tempbans.ini,%ip,time) 
    if ($ctime >= %time) mta.tempunban $1 %ip 
    else !.timer 1 $calc(%time - $ctime) mta.tempunban $1 %ip 
    !inc %a 
  } 
} 
on *:SIGNAL:mta.command:{ 
  var %a = $iif($4,$iif($mta.getid($1,$4),$v1,-1),$2) 
  if ($3 == !tempban) {  
    if ($mta.level($1,$2) < 3) mta.pm $1 $2 Error - Higher level required 
    elseif (%a == $2) mta.pm $1 $2 Error - You cant tempban yourself 
    elseif (%a == -1) mta.pm $1 $2 Error - Absent ID 
    elseif ($mta.level($1,$2) <= $mta.level($1,%a)) mta.pm $1 $2 Error - Can't ban a player with the same or higher level 
    else { 
      if ($5 isnum) { 
        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-) 
          mta.tempban $1 %a $calc($5 * 60) 
        } 
        elseif (h* iswm $6) { 
          mta.texxt $1 $mta.nick($1,%a) has been banned for $5 hour $+ $iif($5 != 1,s) $+ , by $mta.nick($1,$2) $+ . $iif($7,Reason: $7-) 
          mta.tempban $1 %a $calc($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-) 
          mta.tempban $1 %a $calc($5 * 86400) 
        } 
        else mta.pm $1 $2 Invalid time 
      } 
      else mta.pm $1 $2 Invalid time 
    } 
  } 
} 
alias mta.tempban { 
  !writeini " $+ $scriptdir $+ $1.tempbans.ini" $mta.ip($1,$2) nick $mta.nick($1,$2) 
  !writeini " $+ $scriptdir $+ $1.tempbans.ini" $mta.ip($1,$2) time $calc($ctime + $3) 
  mta.ban $1 $2 
  !.timer 1 $3 mta.tempunban $1 $mta.ip($1,$2) 
} 
alias mta.tempunban { 
  mta.unban $1 $2 
  mta.text $1 $readini($scriptdir $+ $1.tempbans.ini,$2,nick) has been unbanned. (Tempban) 
  !remini " $+ $scriptdir $+ $1.tempbans.ini" $2 
} 

Link to comment

hehehe... looks kinda big lil toady... ur slacking mate.. :mrgreen:

u should have use a multiplier for the d/h/m then u wouldnt have needed the same code 3 times.

also, 1 timer running a check on the banned people might be better than a timer per person, although i guess thats debatable.

good work all the same.

foo, I havent tried it, but maybe u should have tried it before u took stuff out.

now noone knows if its broke because of what uve changed. :?

Link to comment
shh scooby! :(

Im forgetting mirc scripting, was putting 'then' and 'end' all over everywhere instead of brackets writing that :P And one timer won't be that accurate!

lol.. i bet

accurate.. hmm well im sure it doesnt need to be to the nearest second, i have mine as mins/hours/weeks/days/months

every 60 secs it checks the file for names to be unbanned.

both are as good i guess, its just if people used it a lot they could end up with a lot of timers running, rather than just 1.

anyway its all good i guess. :lol:

Link to comment
  • Recently Browsing   0 members

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