Ford Posted November 12, 2007 Posted November 12, 2007 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 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.
[UVA]Bart Posted November 12, 2007 Posted November 12, 2007 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 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... } }
Ford Posted November 12, 2007 Author Posted November 12, 2007 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?
[UVA]Bart Posted November 12, 2007 Posted November 12, 2007 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. } }
Ford Posted November 12, 2007 Author Posted November 12, 2007 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.
SanZoR Posted November 12, 2007 Posted November 12, 2007 if its standalone, dont forget "on *:SIGNAL:mta.command:{"
Ford Posted November 12, 2007 Author Posted November 12, 2007 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.
[UVA]Bart Posted November 12, 2007 Posted November 12, 2007 dont change anything this time as it was broken the version you edited 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. } } }
[UVA]Bart Posted November 12, 2007 Posted November 12, 2007 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. } } }
[UVA]Bart Posted November 12, 2007 Posted November 12, 2007 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 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. } } }
MB|Lagzilla Posted November 12, 2007 Posted November 12, 2007 My one, tried and tested !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! } }
[UVA]Bart Posted November 13, 2007 Posted November 13, 2007 !writeini -n lag.nicks.ini BANNED $4- No why save things that arnt worth saving remove them lol !remini -n lag.nicks.ini BANNED $4-
MB|Lagzilla Posted November 13, 2007 Posted November 13, 2007 So you have a record for future refrence.
Recommended Posts