Jump to content

Automatic ban nick


Au{R}oN

Recommended Posts

Posted

Hi guys,

I've a little question.

How can I make a script wich ban the players with a specific name.

An example:

Cheaer joined.

Cheater has been banned from the server. Reason: Black List

Thanks 8)

Posted

on *:SIGNAL:mta.join:{ ;the join signal that is triggered when a player enters the server
 if ($mta.name($1,$2) == Cheater) { ;checking if their name is Cheater
   mta.say $1 Banning $mta.name($1,$2) - Reason: Banned nickname ;sending message to server
   mta.ban $1 $2 ;bans the player
 }
 elseif ($mta.name($1,$2) == Cheater2) { ;checking if their name is Cheater2
   mta.say $1 Banning $mta.name($1,$2) - Reason: Banned nickname ;sending message to server
   mta.ban $1 $2 ;bans the player
 }
 elseif (cheat* iswm $mta.name($1,$2)) { ;checking if cheat onwards is in their name
   mta.say $1 Banning $mta.name($1,$2) - Reason: Banned nickname ;sending message to server
   mta.ban $1 $2 ;bans the player
 }
}

tokens can also be used..

Posted

on *:SIGNAL:mta.join:{
if ($mta.name($1,$2) == $readini(Bans.ini,bannned,names)) {
mta.say $1 Banning $mta.name($1,$2) $chr(124) Reason: Blacklisted.
mta.ban $1 $2
}
}
on *:SIGNAL:mta.command:{
if $3 == !addban && $findtok(ADMIN NAMES HERE!!!,$mta.name($1,$2),1,32) { 
if $4 == $null mta.say $1 say !addban 
else {
mta.say $1 added ban name: $4
!writeini bans.ini banned names $readini(bans.ini,banned,names) $+($4,$chr(44))
}
}
if $3 == !remban && $findtok(ADMIN NAMES HERE!!!,$mta.name($1,$2),1,32) { 
if $4 == $null mta.say $1 say !remban 
elseif ($readini(bans.ini,banned,names,$4) == $null) mta.say $1 $4 isn't banned.
else {
mta.say $1 added ban name: $4
!writeini bans.ini banned names $remtok($readini(bans.ini,banned,names),$4,1,44)
}
}
}

use !addban to add bans

use !remban to remove bans

You must edit "ADMINS NAMES HERE!!!" to your name!!!

Posted

on *:SIGNAL:mta.join:{
 if ($findtok($readini(bans.ini,bannned,names),$mta.name($1,$2),44)) {
   mta.say $1 Banning $mta.name($1,$2) $chr(124) Reason: Blacklisted.
   mta.ban $1 $2
 }
}
on *:SIGNAL:mta.command:{
 if ($3 == !addban && $findtok(admin-names,$mta.name($1,$2),1,32)) {
   if ($4 == $null) mta.say $1 say !addban 
   else {
     mta.say $1 added ban name: $4
     !writeini bans.ini banned names $addtok($readini(bans.ini,banned,names),$4,44)
   }
 }
 elseif ($3 == !remban && $findtok(admin-names,$mta.name($1,$2),1,32)) {
   if ($4 == $null) mta.say $1 say !remban 
   elseif (!$readini(bans.ini,banned,names,$4)) mta.say $1 $4 isn't banned.
   else {
     mta.say $1 added ban name: $4
     !writeini bans.ini banned names $remtok($readini(bans.ini,banned,names),$4,1,44)
   }
 }
}

There's many easier ways to do this, but i thought i'd just fix this one :)

Posted

Thanks a lot, but I prefer the first one.

Last question: can the script be more specific?

I've tested it: Cheater is in the blacklist, I enter with the name Cheat, and the script ban me :!:

8)

Posted

yes, thats what the * and iswm does.

to be honest, you should use the !blacklist command in GRS.

Posted

AS long as it isnt Andy's version.. He should buy a new keyboard, his spacebar is broken.

In other words: where's the indenting? ;)

Posted

* Mike prods jax with /help $findtok

You forgot a parameter, it should be:

$findtok($readini(bans.ini,bannned,names),$mta.name($1,$2),1,44)

Posted

Please guys, I not understood what's the parameters of the precision of the script.

I think is this the area to modify, but where?

elseif (cheat* iswm $mta.name($1,$2)) { ;checking if cheat onwards is in their name

mta.say $1 Banning $mta.name($1,$2) - Reason: Banned nickname ;sending message to server

mta.ban $1 $2 ;bans the player

}

}

I'd like to have the max precision :oops:

Posted
* Mike prods jax with /help $findtok

You forgot a parameter, it should be:

$findtok($readini(bans.ini,bannned,names),$mta.name($1,$2),1,44)

...it's not needed :wink:

Posted
* Mike prods jax with /help $findtok

You forgot a parameter, it should be:

$findtok($readini(bans.ini,bannned,names),$mta.name($1,$2),1,44)

...it's not needed :wink:

Can you reply to the precedent post? It's very important :cry:

Posted
Please guys, I not understood what's the parameters of the precision of the script.

I think is this the area to modify, but where?

elseif (cheat* iswm $mta.name($1,$2)) { ;checking if cheat onwards is in their name

mta.say $1 Banning $mta.name($1,$2) - Reason: Banned nickname ;sending message to server

mta.ban $1 $2 ;bans the player

}

}

I'd like to have the max precision :oops:

What the hell you on about boy :P , this line here,

  elseif (cheat* iswm $mta.name($1,$2)) { 

just change the the word "cheat" to what ever you want. so say if you wanted to ban someone who keeps joining the server with "bob1" & "bob2" & "bob3" so you change the word from "cheat" to "bob". ok?????

on *:SIGNAL:mta.join:{
 if ($findtok($readini(bans.ini,bannned,names),$mta.name($1,$2),44)) {
   mta.say $1 Banning $mta.name($1,$2) $chr(124) Reason: Blacklisted.
   mta.ban $1 $2
 }
}
on *:SIGNAL:mta.command:{
 if ($3 == !addban && $findtok(admin-names,$mta.name($1,$2),1,32)) {
   if ($4 == $null) mta.say $1 say !addban 
   else {
     mta.say $1 added ban name: $4
     !writeini bans.ini banned names $addtok($readini(bans.ini,banned,names),$4,44)
   }
 }
 elseif ($3 == !remban && $findtok(admin-names,$mta.name($1,$2),1,32)) {
   if ($4 == $null) mta.say $1 say !remban 
   elseif (!$readini(bans.ini,banned,names,$4)) mta.say $1 $4 isn't banned.
   else {
     mta.say $1 added ban name: $4
     !writeini bans.ini banned names $remtok($readini(bans.ini,banned,names),$4,1,44)
   }
 }
}

There's many easier ways to do this, but i thought i'd just fix this one :)

pfffff i wrote that in couple of mins in text box, i couldn't be arsed checking what i wrote Because i knew for fact you jax or oli would soon correct me anyway :wink:

Posted

Oh, you are a big! But isn't precise 100%

Becouse if I enter with: Cheaterzar, the script ban me, becouse I've the "Cheater" part in the nick.

Help. :(

  • Recently Browsing   0 members

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