Prevent using /summon to reset AFK. (Thanks Joseph)

This commit is contained in:
UnknownShadow200 2017-03-03 19:31:12 +11:00
parent d1e9862c6b
commit 176e840926

View File

@ -48,6 +48,7 @@ namespace MCGalaxy.Commands {
Player[] players = PlayerInfo.Online.Items;
foreach (Player pl in players) {
if (pl.level == p.level && pl != p && p.Rank > pl.Rank) {
pl.AFKCooldown = DateTime.UtcNow.AddSeconds(2);
pl.SendPos(Entities.SelfID, p.pos[0], p.pos[1], p.pos[2], p.rot[0], 0);
pl.SendMessage("You were summoned by " + p.ColoredName + "%S.");
}
@ -73,6 +74,8 @@ namespace MCGalaxy.Commands {
}
if (p.level != who.level) return; // in case they were unable to move to this level
who.AFKCooldown = DateTime.UtcNow.AddSeconds(2);
who.SendPos(Entities.SelfID, p.pos[0], p.pos[1], p.pos[2], p.rot[0], 0);
who.SendMessage("You were summoned by " + p.ColoredName + "%S.");
}