summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormekolat <mekolat@users.noreply.github.com>2016-05-07 19:39:35 -0400
committermekolat <mekolat@users.noreply.github.com>2016-05-07 19:39:35 -0400
commit63bd5a4c8d36bf57d36ea112f7f33f4fd4261c1e (patch)
tree8f13e3900fbe2de1c66751a774a2422bf7c6f0b1
parentc518db72504fd305fae5ea9c107884b862cda875 (diff)
downloadserverdata-63bd5a4c8d36bf57d36ea112f7f33f4fd4261c1e.tar.gz
serverdata-63bd5a4c8d36bf57d36ea112f7f33f4fd4261c1e.tar.bz2
serverdata-63bd5a4c8d36bf57d36ea112f7f33f4fd4261c1e.tar.xz
serverdata-63bd5a4c8d36bf57d36ea112f7f33f4fd4261c1e.zip
add @stfu command
-rw-r--r--world/map/npc/commands/mute.txt25
1 files changed, 25 insertions, 0 deletions
diff --git a/world/map/npc/commands/mute.txt b/world/map/npc/commands/mute.txt
index 6b6ea4d9..bf4efa6b 100644
--- a/world/map/npc/commands/mute.txt
+++ b/world/map/npc/commands/mute.txt
@@ -20,6 +20,28 @@
message strcharinfo(0), "mute : Player `"+strcharinfo(0, .@target_id)+"` has been muted for "+@argv[0]+" minutes.";
end;
+OnSTFU:
+ if (GM < CMD_MUTE && GM < G_SYSOP) goto L_GM;
+ callfunc "argv_splitter";
+ if (@argv[0] < 1) set @argv[0], 1;
+ if (@argv[0] > 10) set @argv[0], 10;
+ gmlog "@stfu " + @argv[0];
+ set @stfu_nr, 0;
+ foreach 0, getmap(), (POS_X - .range), (POS_Y - .range), (POS_X + .range), (POS_Y + .range), strnpcinfo(0)+"::OnSTFUPC";
+ message strcharinfo(0), "mute : Every player within "+.range+" tiles have been muted for "+@argv[0]+" minutes. ["+@stfu_nr+"]";
+ set @stfu_nr, 0;
+ end;
+
+OnSTFUPC:
+ if (@target_id == BL_ID) end;
+ set .@future, (gettimetick(2) + (@argv[0] * 60));
+ if (get(#MUTE_UNTIL, @target_id) > .@future) end; // if player already has a mute, don't reduce it
+ set MUTE_GLOBAL, 1, @target_id;
+ set #MUTE_UNTIL, .@future, @target_id;
+ addtimer (@argv[0] * 60000) + 100, strnpcinfo(0) + "::OnCheckMute", @target_id;
+ set @stfu_nr, @stfu_nr + 1;
+ end;
+
OnPCLoginEvent:
if (#MUTE_UNTIL < 1) end;
set .@s, (#MUTE_UNTIL - gettimetick(2));
@@ -55,6 +77,9 @@ L_GM:
end;
OnInit:
+ set .range, 14; // FIXME: this should be a const
registercmd chr(ATCMD_SYMBOL) + "mute", strnpcinfo(0);
+ registercmd chr(ATCMD_SYMBOL) + "stfu", strnpcinfo(0) + "::OnSTFU";
+ registercmd chr(ATCMD_SYMBOL) + "areamute", strnpcinfo(0) + "::OnSTFU"; // alias of STFU
end;
}