From 3b7d0dad8a3d84ff667d670fcbbe527ca3b5d92d Mon Sep 17 00:00:00 2001 From: mekolat Date: Sun, 8 May 2016 18:51:22 -0400 Subject: allow mute to expire while the player is not logged in --- world/map/npc/commands/mute.txt | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'world/map/npc/commands/mute.txt') 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; -- cgit v1.2.3-60-g2f50