diff options
author | mekolat <mekolat@users.noreply.github.com> | 2016-05-08 18:51:22 -0400 |
---|---|---|
committer | mekolat <mekolat@users.noreply.github.com> | 2016-05-08 18:51:22 -0400 |
commit | 3b7d0dad8a3d84ff667d670fcbbe527ca3b5d92d (patch) | |
tree | 84d4d05a409ff01a83532fccc9ad76a04a325d22 | |
parent | fac2b3f47f7367655b69bcffa529ccd8a1bbca30 (diff) | |
download | serverdata-3b7d0dad8a3d84ff667d670fcbbe527ca3b5d92d.tar.gz serverdata-3b7d0dad8a3d84ff667d670fcbbe527ca3b5d92d.tar.bz2 serverdata-3b7d0dad8a3d84ff667d670fcbbe527ca3b5d92d.tar.xz serverdata-3b7d0dad8a3d84ff667d670fcbbe527ca3b5d92d.zip |
allow mute to expire while the player is not logged in
-rw-r--r-- | world/map/npc/commands/mute.txt | 8 |
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; |