Here are several additions to the !ban script that most people use. These additions have the following features:
!ban - logs the reason, date, time, ip and banner in an ini.
!unban - checks the ini and unbans if they were banned.
!banned - checks if has been banned and returns the reason, date, time and banner details.
If a player is banned and then rejoins with the same name there is a warning saying they were banned.
If a person joins with the same 2 or 3 parts of the ip of a banned person then the scrips warns of who was banned in that subnet. (this is basically a subnet warning for banned people, regardless of name).
If a player is banned and then unbanned there is a warning of rejoining that they were unbanned by the name of the unbanner.
This script is very useful for warning of people using proxies to get around bans as the admin is instantly aware of the details and can check the ip's further.
alias mta.join {
if ( $read(subnet.txt,w,$gettok($mta.ip($1,$2),1-2,46) ) ) {
set %subnet $read(subnet.txt,w,$gettok($mta.ip($1,$2),1-2,46) )
set %network $gettok($mta.ip($1,$2),1-3,46)
set %bannedname $readini( "MTAwarn.ini", subnets, %subnet )
set %bannedip $gettok($readini( "MTAwarn.ini", bannedip, %bannedname ),1-3,46)
if ( %bannedip == %network ) {
mta.say $1 Warning: $mta.name($1,$2) - First 3 ip groups match $readini( "MTAwarn.ini", subnets, %subnet ) $+ , who was banned.
}
else {
mta.say $1 Warning: $mta.name($1,$2) - First 2 ip groups match $readini( "MTAwarn.ini", subnets, %subnet ) $+ , who was banned.
}
unset %subnet
unset %network
unset %bannedname
unset %bannedip
}
elseif ( $readini( "MTAwarn.ini", main, $mta.name($1,$2) ) == 4 ) {
mta.say $1 Warning: $mta.name($1,$2) has been previously banned.
}
elseif ( $readini( "MTAwarn.ini", main, $mta.name($1,$2) ) == 5 ) {
mta.say $1 Warning: $mta.name($1,$2) was previously banned, but was unbanned by $readini( "MTAwarn.ini", unbanned, $mta.name($1,$2) )
}
}
alias mta.text {
if ($3 == !ban && %isadmin. [ $+ [ $1 ] $+ . $+ [ $2 ] ] == true ) {
if ( $mta.name($1,$mta.getid($1,$4)) == unknown ) {
mta.say $1 $mta.name( $1 , $2 ) $+ : Error - unable to ban absent ID.
}
else {
if ($5 != $null) {
mta.say $1 $mta.name( $1 , $mta.getid($1,$4) ) ( $+ $mta.ip( $1 , $mta.getid($1,$4) ) $+ ) is banned by $mta.name( $1 , $2 ) $+ . Reason: $5-
set %kicks $calc($readini("MTAScript.ini",kicks,$mta.name( $1 , $2 )) + 1)
writeini -n "MTAScript.ini" kicks $mta.name( $1 , $2 ) %kicks
echo -a Server $1 : $mta.name( $1 , $2 ) kicked nr. %kicks
writeini "MTAwarn.ini" main $mta.name($1,$mta.getid($1,$4)) 4
writeini "MTAwarn.ini" banreasons $mta.name($1,$mta.getid($1,$4)) $5- $date $time $mta.name($1,$2)
writeini "MTAwarn.ini" bannedip $mta.name($1,$mta.getid($1,$4)) $mta.ip($1,$mta.getid($1,$4)) $date $time $mta.name($1,$2)
writeini "MTAwarn.ini" subnets $gettok($mta.ip($1,$mta.getid($1,$4)),1-2,46) $mta.name($1,$mta.getid($1,$4))
write subnet.txt $gettok($mta.ip($1,$mta.getid($1,$4)),1-2,46)
mta.ban $1 $mta.getid($1,$4)
}
else {
mta.say $1 $mta.name( $1 , $mta.getid($1,$4) ) ( $+ $mta.ip( $1 , $mta.getid($1,$4) ) $+ ) is banned by $mta.name( $1 , $2 )
set %kicks $calc($readini("MTAScript.ini",kicks,$mta.name( $1 , $2 )) + 1)
writeini -n "MTAScript.ini" kicks $mta.name( $1 , $2 ) %kicks
echo -a Server $1 : $mta.name( $1 , $2 ) kicked nr. %kicks
writeini "MTAwarn.ini" main $mta.name($1,$mta.getid($1,$4)) 4
writeini "MTAwarn.ini" banreasons $mta.name($1,$mta.getid($1,$4)) some reason $date $time $mta.name($1,$2)
writeini "MTAwarn.ini" bannedip $mta.name($1,$mta.getid($1,$4)) $mta.ip($1,$mta.getid($1,$4)) $date $time $mta.name($1,$2)
writeini "MTAwarn.ini" subnets $gettok($mta.ip($1,$mta.getid($1,$4)),1-2,46) $mta.name($1,$mta.getid($1,$4))
write subnet.txt $gettok($mta.ip($1,$mta.getid($1,$4)),1-2,46)
mta.ban $1 $mta.getid($1,$4)
}
}
}
elseif (($3 == !unban) && %isadmin. [ $+ [ $1 ] $+ . $+ [ $2 ] ] == true ) {
if ($4 != $null) {
if ( $readini( "MTAwarn.ini", bannedip, $4 )) {
set %unban $gettok($readini( "MTAwarn.ini", bannedip, $4 ),1-2,46)
mta.say $1 $mta.name($1,$2) $+ : UnBanned $4
mta.unban $1 $readini( "MTAwarn.ini", bannedip, $4 )
writeini "MTAwarn.ini" main $4 5
writeini "MTAwarn.ini" unbanned $4 $mta.name($1,$2)
remini "MTAwarn.ini" banreasons $4
remini "MTAwarn.ini" bannedip $4
remini "MTAwarn.ini" subnets %unban
write -ds [ $+ [ %unban ] ] subnet.txt
unset %unban
}
else {
mta.say $1 $mta.name($1,$2) $+ : Error - $4 is not banned.
}
}
else {
mta.say $1 $mta.name($1,$2) $+ : Syntax: !unban
}
}
elseif ($3 == !banned) {
if ($4 != $null) {
if ( $readini( "MTAwarn.ini", bannedip, $4 )) {
mta.say $1 $4 has been banned at this server.
mta.say $1 Deatils: $readini( "MTAwarn.ini", banreasons, $4- )
}
elseif ( $readini( "MTAwarn.ini", main, $4 ) == 5) {
mta.say $1 $4 was banned, but was then unbanned by $readini( "MTAwarn.ini", unbanned, $4 )
}
else {
mta.say $1 $4 has not been banned at this server.
}
}
else {
mta.say $1 $mta.name($1,$2) $+ : Error - Syntax: !banned
}
}
}
kooper, here is your script. Manhunt that runs only once when active. You can select players aswell, do !mh player from admin. It has a vote on function for players aswell. They type !manhunt and if half the ppl vote for it then it turns on. Here is the script:
alias mh {
if ($2 isnum) {
if ($2 == 0) {
mta.say $1 $mta.name($1,% [ $+ [ $1 ] ]) survived for 10 mins!
}
else {
mta.say $1 $mta.name($1,% [ $+ [ $1 ] ]) you must survive for $2 more mins!
.timermh $+ $1 1 60 mh $1 $calc($2 - 1)
}
}
if ($2 == on) {
mh.pick $1
.timermh $+ $1 1 60 mh $1 9
mta.say $1 ManHunt has begun!
mta.say $1 $mta.name($1,% [ $+ [ $1 ] ]) is the fugitive, find and kill him!
}
if ($2 == player) {
if ( $3 != $null ) {
if ( $mta.name($1,$3) == unknown ) {
mta.say $1 Player $3 not present
}
else {
% [ $+ [ $1 ] ] = $3
.timermh $+ $1 1 60 mh $1 9
mta.say $1 ManHunt has begun!
mta.say $1 $mta.name($1,% [ $+ [ $1 ] ]) is the fugitive, find and kill him!
}
}
}
if ($2 == off) {
unset % [ $+ [ $1 ] ]
mta.say $1 ManHunt stopped!
.timermh $+ $1 off
}
}
alias mh.pick {
if ($mta.players($1) <= 3) {
mta.say $1 ManHunt stopped! To few players!
unset % [ $+ [ $1 ] ]
.timermh $+ $1 off
halt
}
else {
% [ $+ [ $1 ] ] = 30
while (!$ini($+($scriptdir,$1,.ini),ID $+ % [ $+ [ $1 ] ])) {
% [ $+ [ $1 ] ] = $rand(0,25)
}
return
}
}
alias mta.admin {
if (!mh == $2) mh $1 $3
}
alias mta.join {
if (% [ $+ [ $1 ] ]) {
mta.say $1 Hello $mta.name($1,$2) Server is running in Manhunt mode, find and kill $mta.name($1,% [ $+ [ $1 ] ]) !
}
}
alias mta.part {
if (% [ $+ [ $1 ] ] == $2) {
mta.say $1 $mta.name($1,% [ $+ [ $1 ] ]) gives up!
mh.pick $1
mta.say $1 $mta.name($1,% [ $+ [ $1 ] ]) is now the fugitive, kill him!
.timermh $+ $1 1 60 mh $1 9
}
}
alias mta.text {
;$1 = Server
;$2 = Player ID
;$3- = Text
if ( $3 == !manhunt ) {
mh.voteon $1-
}
elseif ( $3 == !mh ) {
mh.vote $1-
}
}
alias mta.kill {
if (% [ $+ [ $1 ] ] == $2) {
if (($3 == % [ $+ [ $1 ] ]) || ($3 >= 254)) {
mta.say $1 $mta.name($1,% [ $+ [ $1 ] ]) couldn't take the pressure!
mh.pick $1
mta.say $1 $mta.name($1,% [ $+ [ $1 ] ]) is now the fugitive, kill him!
.timermh $+ $1 1 60 mh $1
}
elseif ($3 <= 253) {
% [ $+ [ $1 ] ] = $3
mta.say $1 $mta.name($1,$3) killed the fugitive!
mta.say $1 $mta.name($1,$3) is now the fugitive, find and kill him!
.timermh $+ $1 1 60 mh $1 9
}
}
}
alias mh.cancel{
mta.say $1 Not enough people voted for Manhunt to be on. Manhunt Stopped.
unset %vote.voters. [ $+ [ $1 ] ]
unset %mhon
}
alias mh.voteon {
if ( %mhon == on ) {
mta.say $1 Manhunt vote is already running
}
else {
set %mhon on
set %vote.voters. [ $+ [ $1 ] ] $null
mta.say $1 Manhunt: "!mh" if u think that Manhunt should be activated. [ $calc($left($did(mta,$1 $+ 21),2) / 2) votes needed][60 sec]
.timervote [ $+ [ $1 ] ] 1 60 mh.cancel $1
}
}
alias mh.vote {
if ( %mhon == on ) {
if ($2 !isin %vote.voters. [ $+ [ $1 ] ]) {
%vote.voters. [ $+ [ $1 ] ] = %vote.voters. [ $+ [ $1 ] ] $2
mta.say $1 $numtok(%vote.voters. [ $+ [ $1 ] ],32) votes for Manhunt to be on!
if ($numtok(%vote.voters. [ $+ [ $1 ] ],32) >= $calc($left($did(mta,$1 $+ 21),2) / 2)) {
mta.say $1 !mh on
unset %vote.voters. [ $+ [ $1 ] ]
unset %mhon
.timervote [ $+ [ $1 ] ] off
}
}
else mta.say $1 $mta.name($1,$2) You have already voted
}
else {
mta.say $1 Manhunt vote not running.
}
}
hope it works ok, i havnt tested it too much so im not sure of everything.
Can anyone let me know if they have a problem with these advanced banning features, as this script was taken out of my larger script so isnt tested individually.