summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-09-20 15:18:27 -0300
committerJesusaves <cpntb1@ymail.com>2019-09-20 15:18:27 -0300
commitcfebc4301c2a7b6b9af3564c5b8c9ad6cd307bce (patch)
treeb30ff7144b91b5068bb3460e6ca190ec7b8ed139
parent2f8f7b2be3fa8e66409e2f9f9e6beaa8dffb9a57 (diff)
downloadserverdata-cfebc4301c2a7b6b9af3564c5b8c9ad6cd307bce.tar.gz
serverdata-cfebc4301c2a7b6b9af3564c5b8c9ad6cd307bce.tar.bz2
serverdata-cfebc4301c2a7b6b9af3564c5b8c9ad6cd307bce.tar.xz
serverdata-cfebc4301c2a7b6b9af3564c5b8c9ad6cd307bce.zip
New command: #ipban <ban reason>
Will ban someone's IP until 2030. WARNING: THIS IS IRREVERSIBLE. Use with due caution.
-rw-r--r--npc/commands/ipcheck.txt15
1 files changed, 15 insertions, 0 deletions
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 <reason>"), 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;
}