diff options
author | Jesusaves <cpntb1@ymail.com> | 2021-04-10 03:00:20 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2021-04-10 03:00:20 -0300 |
commit | ba1e827b6b4c17c35a163e6b55be8c122de632b8 (patch) | |
tree | 819f93d0ffee3697e336471710afb9681f0b8d86 /npc/commands/ipcheck.txt | |
parent | 6e7f3113c0faad9edd4367d100ba9dd77e8d3130 (diff) | |
download | serverdata-ba1e827b6b4c17c35a163e6b55be8c122de632b8.tar.gz serverdata-ba1e827b6b4c17c35a163e6b55be8c122de632b8.tar.bz2 serverdata-ba1e827b6b4c17c35a163e6b55be8c122de632b8.tar.xz serverdata-ba1e827b6b4c17c35a163e6b55be8c122de632b8.zip |
Add several convenience functions. Fix some bugs regarding misuse of readparam()
Diffstat (limited to 'npc/commands/ipcheck.txt')
-rw-r--r-- | npc/commands/ipcheck.txt | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/npc/commands/ipcheck.txt b/npc/commands/ipcheck.txt new file mode 100644 index 00000000..a241d3c0 --- /dev/null +++ b/npc/commands/ipcheck.txt @@ -0,0 +1,71 @@ +// TMW2 script +// Author: Jesusalva <admin@tmw2.org> +// +// @ipcheck <player_name> +// #ipcheck <player_name> +// +// Returns user IP + + +- script @ipcheck 32767,{ + end; + +OnCall: + if (.@atcmd_numparameters == 0) + .@request$ = strcharinfo(0); + else + .@request$ = implode(.@atcmd_parameters$, " "); + dispbottom strip(.@request$)+": IP "+getcharip(.@request$); + //dispbottom strcharinfo(0)+": IP "+getcharip(.@request$); + end; + +OnBan: + if (.@atcmd_numparameters == 0) { + dispbottom col("Syntax: #ipban <reason>", 1); + } + // Do not allow banning high-level staff + if (is_admin() || is_gm()) + end; + .@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)+"','2037-01-01 00:00:00','"+.@reason$+"')"; + logmes("was IP-Blocked, and will not connect again."), LOGMES_ATCOMMAND; + sleep2(2000); + charcommand("@kick "+.@target$); + end; + +OnInit: + bindatcmd "ipcheck", "@ipcheck::OnCall", 60, 100, 0; + bindatcmd "ipban", "@ipcheck::OnBan", 99, 100, 1; + end; +} + +// TMW2 script +// Author: Jesusalva <admin@tmw2.org> +// +// @checkidle <player_name> +// #checkidle <player_name> +// +// Returns user idle time in seconds. +// Useful when the game prohibits warping to player. + + +- script @checkidle 32767,{ + end; + +OnCall: + if (.@atcmd_numparameters == 0) + .@request$ = strcharinfo(0); + else + .@request$ = implode(.@atcmd_parameters$, " "); + dispbottom strip(.@request$)+" idle time: "+checkidle(.@request$); + //dispbottom strcharinfo(0)+": IP "+getcharip(.@request$); + end; + +OnInit: + bindatcmd "checkidle", "@checkidle::OnCall", 60, 80, 0; + end; +} + |