summaryrefslogtreecommitdiff
path: root/world/map/npc/commands
diff options
context:
space:
mode:
Diffstat (limited to 'world/map/npc/commands')
-rw-r--r--world/map/npc/commands/mute.txt8
1 files changed, 8 insertions, 0 deletions
diff --git a/world/map/npc/commands/mute.txt b/world/map/npc/commands/mute.txt
index bf4efa6b..8216a9c7 100644
--- a/world/map/npc/commands/mute.txt
+++ b/world/map/npc/commands/mute.txt
@@ -45,12 +45,20 @@ OnSTFUPC:
OnPCLoginEvent:
if (#MUTE_UNTIL < 1) end;
set .@s, (#MUTE_UNTIL - gettimetick(2));
+ if (.@s < 5) goto L_ClearMute;
set .@m, .@s / 60;
message strcharinfo(0), "Server : ##BYou have been muted for "+ max(1, .@m) +" minutes.";
set MUTE_GLOBAL, 1;
addtimer (.@s * 1000) + 100, strnpcinfo(0) + "::OnCheckMute";
end;
+L_ClearMute:
+ message strcharinfo(0), "Server : ##BYour mute has expired while you were away. You have been automatically unmuted.";
+ if ((#MUTE_UNTIL - gettimetick(2)) >= (0 - 900))
+ wgm "=> Player `"+ strcharinfo(0) +"` has been automatically unmuted."; // only send if unmuted 15 minutes ago or less
+ set #MUTE_UNTIL, 0;
+ end;
+
OnCheckMute:
if (#MUTE_UNTIL < 1) end;
if (gettimetick(2) - #MUTE_UNTIL < 0) end;