From cfebc4301c2a7b6b9af3564c5b8c9ad6cd307bce Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Fri, 20 Sep 2019 15:18:27 -0300 Subject: New command: #ipban Will ban someone's IP until 2030. WARNING: THIS IS IRREVERSIBLE. Use with due caution. --- npc/commands/ipcheck.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/npc/commands/ipcheck.txt b/npc/commands/ipcheck.txt index a1f9345c2..501dbfe8b 100644 --- a/npc/commands/ipcheck.txt +++ b/npc/commands/ipcheck.txt @@ -19,8 +19,23 @@ OnCall: //dispbottom strcharinfo(0)+": IP "+getcharip(.@request$); end; +OnBan: + if (.@atcmd_numparameters == 0) { + dispbottom col(l("Syntax: #commandname "), 1); + } + .@target$=strcharinfo(0); + .@reason$ = implode(.@atcmd_parameters$, " "); + dispbottom col(l("You were permanently banned by the GM Team."), 1); + sleep2(200); + query_sql "INSERT INTO ipbanlist (list,btime,rtime,reason) VALUES ('"+getcharip(.@target$)+"','"+gettime(7)+"-"+gettime(6)+"-"+gettime(5)+" "+gettime(3)+":"+gettime(2)+":"+gettime(1)+"','2030-01-01 00:00:00','"+.@reason$+"')"; + logmes("was IP-Blocked, and will never connect again."), LOGMES_ATCOMMAND; + sleep2(2000); + charcommand("@kick "+.@target$); + end; + OnInit: bindatcmd "ipcheck", "@ipcheck::OnCall", 80, 100, 1; + bindatcmd "ipban", "@ipcheck::OnBan", 99, 100, 1; end; } -- cgit v1.2.3-60-g2f50