Code: Select all
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# ++ __ __ ______ __ __ ____
# ++ _\ \\ \__ /\ _ \ /\ \ /'_ `\ /'___\
# ++ /\__ _ _\\ \ \L\ \ ___ \_\ \ _ __ __ /\ \L\ \ /\ \__/
# ++ \/_L\ \\ \L_\ \ __ \ /' _ `\ /'_` \/\`'__\/'__`\/_> _ <_\ \ _``\
# ++ /\_ _ _\\ \ \/\ \/\ \/\ \/\ \L\ \ \ \//\ __/ /\ \L\ \\ \ \L\ \
# ++ \/_/\_\\_\/ \ \_\ \_\ \_\ \_\ \___,_\ \_\\ \____\\ \____/ \ \____/
# ++ \/_//_/ \/_/\/_/\/_/\/_/\/__,_ /\/_/ \/____/ \/___/ \/___/
# ++
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# ++ Release: | AMXBans
# ++ Author: | ? 'Andre86' ?
# ++ Version: | 1.0
# ++ Irc: | #Andre86
# ++ Web: | http://www.Andre86.de
# ++ eMail: | Info@andre86.de
# ++ System: | Eggdrop v1.6.17 - tcl/tk v8.4.9
# ++
# ++ Find bugs? | #Andre86 at Quakenet
# ++
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# ++
# ++
# ++ Changelog:
# ++
# ++ [17/09/06] - released
# ++ [17/09/06] - bugs fixed
# ++ [17/09/06] - search changed and splittet to: ban, banhistory
# ++
# ++
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# ++
# ++
# ++ installation (MySQL-TCL | (actually version 3.02)):
# ++
# ++
# ++ [on APT-Systems]
# ++
# ++ apt-get install mysqltcl
# ++
# ++
# ++ [on Other-Systems]
# ++
# ++ cd /opt
# ++ wget http://www.xdobry.de/mysqltcl/mysqltcl-3.02.tar.gz
# ++ gunzip -c mysqltcl-3.02.tar.gz | tar xf -
# ++ cd mysqltcl-3.02
# ++ ./configure
# ++ make
# ++ make install
# ++
# ++ For more information(s) to MySQL-TCL -> visit http://www.xdobry.de/mysqltcl/
# ++
# ++
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# ++
# ++
# ++ Special thanks to:
# ++
# ++ [Helper] - Julian 'PLUGIN' K. (#myplugin @qnet ::: www.myplugin.de)
# ++ [Helper] - ? 'Metzger/Martines' ? (#Sec2 @qnet ::: No Website)
# ++
# ++
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# ++
# ++
# ++ This program is free software; you can redistribute it and/or modify
# ++ it under the terms of the GNU General Public License as published by
# ++ the Free Software Foundation; either version 2 of the License, or
# ++ (at your option) any later version.
# ++
# ++ This program is distributed in the hope that it will be useful,
# ++ but WITHOUT ANY WARRANTY; without even the implied warranty of
# ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# ++ GNU General Public License for more details.
# ++
# ++ You should have received a copy of the GNU General Public License
# ++ along with this program; if not, write to the Free Software
# ++ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# ++
# ++ Disclaimer:
# ++ This Script is under the GPL LICENCE.
# ++ For more information see the accompanying gpl.txt or (if missing or false)
# ++ http://www.gnu.org/licenses/gpl.txt
# ++
# ++
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# ++ | Package(s) Required
package require mysqltcl
# ++ | Configuration
set amxbans(trigger) "\$"
set sql(host) "localhost"
set sql(user) "root"
set sql(pass) ""
set sql(db) "xma"
set amxbans(name) "AMXBans"
set amxbans(author) "Andre86"
set amxbans(build) "20060917"
set amxbans(version) "1.0"
set amxbans(ident) "(c)2006 by: Andre86 \[www.Andre86.de - #Andre86 at Quakenet\]"
# ++ | Copyright
putlog "|--> $amxbans(name) - Version: $amxbans(version)/$amxbans(build) - $amxbans(ident) successfully loaded !!!!"
# ++ | Source
# ++ | NOW don't change anything, if you aren't 100% sure what you are doing!
# ++ | NOW don't change anything, if you aren't 100% sure what you are doing!
# ++ | NOW don't change anything, if you aren't 100% sure what you are doing!
# ++ | NOW don't change anything, if you aren't 100% sure what you are doing!
# ++ | NOW don't change anything, if you aren't 100% sure what you are doing!
# ++ | NOW don't change anything, if you aren't 100% sure what you are doing!
# ++ | NOW don't change anything, if you aren't 100% sure what you are doing!
# ++ | NOW don't change anything, if you aren't 100% sure what you are doing!
# ++ | NOW don't change anything, if you aren't 100% sure what you are doing!
# ++ | NOW don't change anything, if you aren't 100% sure what you are doing!
# ++ | Source
bind pub -|- "$amxbans(trigger)amxversion" amxx:version
bind pub -|- "$amxbans(trigger)amxhilfe" amxx:hilfe
bind pub -|- "$amxbans(trigger)amxhelp" amxx:help
bind pub -|- "$amxbans(trigger)amxban" amxx:db:ban
bind pub -|- "$amxbans(trigger)amxhis" amxx:db:banhis
#######################################
############ Version/Help #############
#######################################
proc amxx:version {nick host hand chan arg} {
putquick "NOTICE $nick :(AMXBans) $::amxbans(name) - Version: $::amxbans(version)/$::amxbans(build) - $::amxbans(ident)"
}
proc amxx:hilfe {nick host hand chan arg} {
puthelp "NOTICE $nick :(AMXBans GERMAN) $::amxbans(trigger)amxban <SteamID> | Um nach einer SteamID in der Ban-Datenbank zu suchen"
puthelp "NOTICE $nick :(AMXBans GERMAN) $::amxbans(trigger)amxhis <SteamID> | Um nach einer SteamID in der History-Datenbank zu suchen"
}
proc amxx:help {nick host hand chan arg} {
puthelp "NOTICE $nick :(AMXBans ENGLISH) $::amxbans(trigger)amxban <SteamID> | To look for a SteamID in the Ban-Database"
puthelp "NOTICE $nick :(AMXBans ENGLISH) $::amxbans(trigger)amxhis <SteamID> | To look for a SteamID in the History-Database"
}
#######################################
############# Ban Search ##############
#######################################
proc amxx:db:ban {nick host hand chan arg} {
global sql
set searchid [lindex $arg 0]
if {![string match "*STEAM_*" $searchid]} {
putserv "NOTICE $nick :(AMXBans) Wrong syntax! - Type: $::amxbans(trigger)amxban STEAM_x:x:xxxxxx"
return
}
set sql(handle) [mysqlconnect -host $sql(host) -user $sql(user) -password $sql(pass) -db $sql(db)]
set sma(qry) [mysqlsel $sql(handle) "SELECT bid,player_ip,player_id,player_nick,ban_reason,ban_length FROM amx_bans WHERE player_id = '$arg' OR player_nick = '$arg'" -flatlist]
mysqlclose $sql(handle)
if {$sma(qry) != ""} {
set gelesen(bid) [lindex $sma(qry) 0]
set gelesen(player_ip) [lindex $sma(qry) 1]
set gelesen(player_id) [lindex $sma(qry) 2]
set gelesen(player_nick) [lindex $sma(qry) 3]
set gelesen(ban_reason) [lindex $sma(qry) 4]
set gelesen(ban_length) [lrange $sma(qry) 5 end]
putserv "PRIVMSG $chan :»» SteamID: $gelesen(player_id) \[Ip: $gelesen(player_ip)\] »»» Nickname: $gelesen(player_nick) »»"
putserv "PRIVMSG $chan :«« Ban ID: $gelesen(bid) ««« Duration: $gelesen(ban_length) ««« Reason: $gelesen(ban_reason) ««"
} else {
putserv "PRIVMSG $chan :$arg not found in Ban-Database ..."
}
}
#######################################
############ Ban History ##############
#######################################
proc amxx:db:banhis {nick host hand chan arg} {
global sql
set searchid [lindex $arg 0]
if {![string match "*STEAM_*" $searchid]} {
putserv "NOTICE $nick :(AMXBans) Wrong syntax! - Type: $::amxbans(trigger)amxhis STEAM_x:x:xxxxxx"
return
}
set sql(handle) [mysqlconnect -host $sql(host) -user $sql(user) -password $sql(pass) -db $sql(db)]
set sma(qry) [mysqlsel $sql(handle) "SELECT bhid,player_ip,player_id,player_nick,ban_reason,ban_length FROM amx_banhistory WHERE player_id = '$arg' OR player_nick = '$arg'" -flatlist]
mysqlclose $sql(handle)
if {$sma(qry) != ""} {
set gelesen(bhid) [lindex $sma(qry) 0]
set gelesen(player_ip) [lindex $sma(qry) 1]
set gelesen(player_id) [lindex $sma(qry) 2]
set gelesen(player_nick) [lindex $sma(qry) 3]
set gelesen(ban_reason) [lindex $sma(qry) 4]
set gelesen(ban_length) [lrange $sma(qry) 5 end]
putserv "PRIVMSG $chan :»» SteamID: $gelesen(player_id) \[Ip: $gelesen(player_ip)\] »»» Nickname: $gelesen(player_nick) »»"
putserv "PRIVMSG $chan :«« History ID: $gelesen(bhid) ««« Duration: $gelesen(ban_length) ««« Reason: $gelesen(ban_reason) ««"
} else {
putserv "PRIVMSG $chan :$arg not found in History-Database ..."
}
}