If a player uses /a regardless of if staff are online, offline, or vanished, making it always yield a response telling the player that if there are staff currently online, they will receive a reply soon - removing the "there are no staff online" message. Also a 60s Recharge for this.

This commit is contained in:
Ben 2016-05-07 23:07:09 +01:00 committed by cnr
parent 6760c07e6c
commit 014ce137fc

View File

@ -11,6 +11,7 @@ import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilServer;
import mineplex.core.incognito.IncognitoManager; import mineplex.core.incognito.IncognitoManager;
import mineplex.core.message.MessageManager; import mineplex.core.message.MessageManager;
import mineplex.core.recharge.Recharge;
public class AdminCommand extends CommandBase<MessageManager> public class AdminCommand extends CommandBase<MessageManager>
{ {
@ -46,7 +47,6 @@ public class AdminCommand extends CommandBase<MessageManager>
UtilPlayer.message(caller, F.rank(Plugin.GetClientManager().Get(caller).GetRank()) + " " + caller.getName() + " " + C.cPurple + message); UtilPlayer.message(caller, F.rank(Plugin.GetClientManager().Get(caller).GetRank()) + " " + caller.getName() + " " + C.cPurple + message);
//Send //Send
boolean staff = false;
for (Player to : UtilServer.getPlayers()) for (Player to : UtilServer.getPlayers())
{ {
if (Plugin.GetClientManager().Get(to).GetRank().has(Rank.HELPER)) if (Plugin.GetClientManager().Get(to).GetRank().has(Rank.HELPER))
@ -64,16 +64,17 @@ public class AdminCommand extends CommandBase<MessageManager>
if(Plugin.GetClientManager().Get(to).isDisguised() || !caller.canSee(to)) if(Plugin.GetClientManager().Get(to).isDisguised() || !caller.canSee(to))
continue; continue;
} }
staff = true;
//Sound //Sound
to.playSound(to.getLocation(), Sound.NOTE_PLING, 0.5f, 2f); to.playSound(to.getLocation(), Sound.NOTE_PLING, 0.5f, 2f);
} }
} }
if (!staff)
UtilPlayer.message(caller, F.main(Plugin.getName(), "There are no Staff Members online."));
if (!Plugin.GetClientManager().hasRank(caller, Rank.HELPER) && Recharge.Instance.use(caller, "AdminCommand.InformMsg", 60 * 1000, false, false))
{
UtilPlayer.message(caller, F.main(Plugin.getName(), "If there are any staff currently online, you will receive a reply shortly."));
}
//Log XXX //Log XXX
//Logger().logChat("Staff Chat", from, staff, message); //Logger().logChat("Staff Chat", from, staff, message);
} }