mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-22 03:55:18 -04:00
Prevent using /summon to reset AFK. (Thanks Joseph)
This commit is contained in:
parent
d1e9862c6b
commit
176e840926
@ -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.");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user