Jump to content

My script - why isn't it working ?


Ford

Recommended Posts

Yes, so I've made veeeery simple script for banning nicknames. Well.. Problem is it isn't kicking banned players when they join.. I know probably there's 943948433 mistakes :P So:

Part that is working:

on *:SIGNAL:mta.command:{

if ($3 == !bannick) {

if ($gus.level($1,$2) > 6) {

mta.text $1 $4 - nick banned.

!writeini -n " $+ $scriptdir $+ bannednick.ini" NICK $4 True

}

else mta.pm $1 $2 Error - You need 7 lvl.

}

}

Part that isn't working:

on *:SIGNAL:mta.join: {

if ($readini($scriptdir $+ bannednick.ini,NICK,$mta.nick($1,$4)) == True) {

mta.kick $1 $4

.timer 1 1 mta.text $1 $4 - nick banned, kicking...

}

}

Thx for fixing the problem.

Link to comment

you are reading it $mta.nick($1,$2) as $mta.nick($1,$4) where as it should be $2 small error nothing to worry about tho :P

on *:SIGNAL:mta.join: { 
if ($readini($scriptdir $+ bannednick.ini,NICK,$mta.nick($1,$2)) == True) { 
mta.kick $1 $2 
.timer 1 1 mta.text $1 $4 - nick banned, kicking... 
} 
} 

Link to comment

Uff thanks :)

But still one small thing that is making me upset, I wrote !unbannick script that looks like:

if ($3 == !unbannick) {

if ($gus.level($1,$2) > 6) {

if ($readini($scriptdir $+ bannednick.ini,NICK,$4) = False) {

mta.pm $1 $2 Error - Nick $4 isnt banned.

}

else {

if ($readini($scriptdir $+ bannednick.ini,NICK,$4) = !null) {

mta.pm $1 $2 Error - Nick $4 isnt banned.

}

else {

mta.text $1 $4 - nick unbanned.

!writeini -n " $+ $scriptdir $+ bannednick.ini" NICK $4 False

}

}

}

else mta.pm $1 $2 Error - You need 7 lvl.

}

}

I can write !unbannick dd all night and it still will reply with "dd - nick unbanned"

As you see I tried to fix that (bold part) but it doesn't work (what a suprise!)

Help? :D

Link to comment
var %x = $iif(($4 == $null),$2,$iif(($mta.getid($1,$4) == $null),$2,$v1)) 
if ($3 == !unbannick) { 
if ($gus.level($1,$2) > 6) { 
elseif ($readini($scriptdir $+ bannednick.ini,NICK,%x) == $null) { 
mta.pm $1 $2 Error - Nick %x isnt banned. 
} 
else { 
mta.text $1 %x - nick unbanned. 
!remini -n " $+ $scriptdir $+ bannednick.ini" NICK %x 
} 
else mta.pm $1 $2 Error - You need 7 lvl. 
} 
} 

Link to comment

OK now it doesnt work at all... I dont know, I checked all } and they match. No idea.

if ($3 == !bannick) {

if ($gus.level($1,$2) > 6) {

if ($readini($scriptdir $+ bannednick.ini,NICK,$4) = True) {

mta.pm $1 $2 Error - Nick $4 already banned.

}

else {

mta.text $1 $4 - nick banned.

!writeini -n " $+ $scriptdir $+ bannednick.ini" NICK $4 True

!writeini -n " $+ $scriptdir $+ bannednick.ini" BANDETAILS $4 date: $date $+ , time: $time($gmt) $+ , by $mta.nick($1,$2)

}

}

}

else mta.pm $1 $2 Error - You need 7 lvl.

}

if ($3 == !unbannick) {

if ($gus.level($1,$2) > 6) {

elseif ($readini($scriptdir $+ bannednick.ini,NICK,%x) == $null) {

mta.pm $1 $2 Error - Nick %x isnt banned..

}

elseif ($readini($scriptdir $+ bannednick.ini,NICK,$4) = False) {

mta.pm $1 $2 Error - Nick $4 isnt banned.

}

else {

mta.text $1 %x - nick unbanned.

!remini -n " $+ $scriptdir $+ bannednick.ini" NICK %x

}

else mta.pm $1 $2 Error - You need 7 lvl.

}

}

}

Both !bannick and !unbannick dont work.

Link to comment

Yes I know...

I've changed it a bit so it looks like that:

  
    if ($3 == !unbannick) { 
    if ($gus.level($1,$2) > 6) { 
    if ($readini($scriptdir $+ bannednick.ini,NICK,%x) == $null) { 
    mta.pm $1 $2 Error - Nick %x isnt banned. 
    } 
    else { 
if ($readini($scriptdir $+ bannednick.ini,NICK,$4) = False) {  
    mta.pm $1 $2 Error - Nick $4 isnt banned. 
    } 
    else { 
    mta.text $1 %x - nick unbanned. 
    !remini -n " $+ $scriptdir $+ bannednick.ini" NICK %x 
    } 
} 
    else mta.pm $1 $2 Error - You need 7 lvl. 
    } 

Now !bannick works fine, but this script still says "Nick 5 isnt banned". And yes I have var %x = $iif(($4 == $null),$2,$iif(($mta.getid($1,$4) == $null),$2,$v1)) script pasted.

Link to comment

dont change anything this time as it was broken the version you edited :P

on *:SIGNAL:mta.join: { 
if ($readini($scriptdir $+ bannednick.ini,NICK,$mta.nick($1,$2)) == True) { 
mta.kick $1 $2 
.timer 1 1 mta.text $1 $4 - nick banned, kicking... 
} 
} 
on *:SIGNAL:mta.command { 
var %x = $iif(($4 == $null),$2,$iif(($mta.getid($1,$4) == $null),$2,$v1)) 
if ($3 == !bannick) { 
if ($gus.level($1,$2) > 6) { 
elseif ($readini($scriptdir $+ bannednick.ini,NICK,%x) != $null) {  
   mta.pm $1 $2 Error - Nick %n already banned. 
} 
else { 
  if ($readini($scriptdir $+ bannednick.ini,NICK,%x) == $null) {  
!writeini -n " $+ $scriptdir $+ bannednick.ini" NICK %x True 
!writeini -n " $+ $scriptdir $+ bannednick.ini" BANDETAILS %x date: $date $+ , time: $time($gmt) $+ , by $mta.nick($1,$2) 
mta.text $1 %x - nick banned. 
} 
else mta.pm $1 $2 Error - You need 7 lvl. 
} 
} 
} 
if ($3 == !unbannick) { 
  if ($gus.level($1,$2) > 6) { 
    elseif ($readini($scriptdir $+ bannednick.ini,NICK,%x) == $null) { 
      mta.pm $1 $2 Error - Nick %x isnt banned. 
    } 
    else { 
      mta.text $1 %x - nick unbanned. 
      !remini -n " $+ $scriptdir $+ bannednick.ini" NICK %x 
    } 
    else mta.pm $1 $2 Error - You need 7 lvl. 
  } 
} 
} 

Link to comment

all you have to do is type !bannick

on *:SIGNAL:mta.join: { 
if ($readini($scriptdir $+ bannednick.ini,NICK,$mta.nick($1,$2)) == True) { 
mta.kick $1 $2 
.timer 1 1 mta.text $1 $4 - nick banned, kicking... 
} 
} 
on *:SIGNAL:mta.command { 
var %x = $iif(($4 == $null),$2,$iif(($mta.getid($1,$4) == $null),$2,$v1)) 
if ($3 == !bannick) { 
if ($gus.level($1,$2) > 6) { 
elseif ($readini($scriptdir $+ bannednick.ini,NICK,$4) != $null) {  
   mta.pm $1 $2 Error - Nick %n already banned. 
} 
else { 
  if ($readini($scriptdir $+ bannednick.ini,NICK,$4) == $null) {  
!writeini -n " $+ $scriptdir $+ bannednick.ini" NICK %x True 
!writeini -n " $+ $scriptdir $+ bannednick.ini" BANDETAILS %x date: $date $+ , time: $time($gmt) $+ , by $mta.nick($1,$2) 
mta.text $1 %x - nick banned. 
} 
else mta.pm $1 $2 Error - You need 7 lvl. 
} 
} 
} 
if ($3 == !unbannick) { 
  if ($gus.level($1,$2) > 6) { 
    elseif ($readini($scriptdir $+ bannednick.ini,NICK,$4) == $null) { 
      mta.pm $1 $2 Error - Nick %x isnt banned. 
    } 
    else { 
      mta.text $1 %x - nick unbanned. 
      !remini -n " $+ $scriptdir $+ bannednick.ini" NICK %x 
    } 
    else mta.pm $1 $2 Error - You need 7 lvl. 
  } 
} 
} 

Link to comment

well you didnt say that lol this will work, i made the first one so that when you to !bannick to and theres a player in called todd it writed todd that way you dont have to type the whole nick lol this should work :P

on *:SIGNAL:mta.join: { 
if ($readini($scriptdir $+ bannednick.ini,NICK,$mta.nick($1,$2)) == True) { 
.timer 1 1 mta.text $1 $mta.nick($1,$2) - nick banned, kicking... 
mta.kick $1 $2 
} 
} 
on *:SIGNAL:mta.command { 
if ($3 == !bannick) { 
if ($gus.level($1,$2) > 6) { 
elseif ($readini($scriptdir $+ bannednick.ini,NICK,$4) != $null) {  
   mta.pm $1 $2 Error - Nick $4 already banned. 
} 
else { 
  if ($readini($scriptdir $+ bannednick.ini,NICK,$4) == $null) {  
!writeini -n " $+ $scriptdir $+ bannednick.ini" NICK $4 True 
!writeini -n " $+ $scriptdir $+ bannednick.ini" BANDETAILS $4 date: $date $+ , time: $time($gmt) $+ , by $mta.nick($1,$2) 
mta.text $1 $4 - nick banned. 
} 
else mta.pm $1 $2 Error - You need 7 lvl. 
} 
} 
} 
if ($3 == !unbannick) { 
  if ($gus.level($1,$2) > 6) { 
    elseif ($readini($scriptdir $+ bannednick.ini,NICK,$4) == $null) { 
      mta.pm $1 $2 Error - Nick $4 isnt banned. 
    } 
    else { 
      mta.text $1 $4 - nick unbanned. 
      !remini -n " $+ $scriptdir $+ bannednick.ini" NICK $4 
    } 
    else mta.pm $1 $2 Error - You need 7 lvl. 
  } 
} 
} 

Link to comment

My one, tried and tested :D

!bannick

!unbannick

;---------------------------------------------------- 
;---------------------------------------------------- 
;---------MB|Lagzilla's NICK BANNING SCRIPT---------- 
;---------------------------------------------------- 
;---------------------------------------------------- 
  
alias lag.nicks !return $iif($readini(lag.nicks.ini,BANNED,$mta.nick($1,$2)),$v1,No) 
  
on *:SIGNAL:mta.join: { 
  if ($lag.nicks($1,$2) == Yes) { 
    mta.text $1 Kicking $mta.nick($1,$2) - By Admin: Auto Script $+ , Reason: Banned Nick 
    .timer 1 2 mta.kick $1 $2 
  } 
} 
  
on *:SIGNAL:mta.nick: { 
  if ($lag.nicks($1,$2) == Yes) { 
    mta.text $1 Kicking $mta.nick($1,$2) - By Admin: Auto Script $+ , Reason: Banned Nick 
    .timer 1 2 mta.kick $1 $2 
  } 
} 
  
on *:SIGNAL:mta.connect:{ 
  mta.text $1 Nick Banning Script By: MB|Lagzilla Connected! 
} 
  
on *:SIGNAL:mta.command:{ 
  if ($3 == !bannick) { 
    if ($mta.level($1,$2) >= 4) { 
      if ($4- != $null) { 
        !writeini -n lag.nicks.ini BANNED $4- Yes 
        mta.text $1 The Nick $4- has been banned by Admin: $mta.nick($1,$2) 
      } 
      else mta.pm $1 $2 Error - Missing Information !bannick <nick> 
    }  
    else mta.pm $1 $2 Error - Insufficient Admin level! 
  } 
  elseif ($3 == !unbannick) { 
    if ($mta.level($1,$2) >= 4) { 
      if ($4- != $null) { 
        if ($iif($readini(lag.nicks.ini,BANNED,$4-),$v1,No) == Yes) { 
          !writeini -n lag.nicks.ini BANNED $4- No 
          mta.text $1 The Nick $4- has been unbanned by Admin: $mta.nick($1,$2) 
        } 
        else mta.pm $1 $2 Error - The Nick $4- Is Not Banned 
      } 
      else mta.pm $1 $2 Error - Missing Information !unbannick <nick> 
    }  
    else mta.pm $1 $2 Error - Insufficient Admin level! 
  } 
} 

Link to comment
  • Recently Browsing   0 members

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