public Position getSpawnIfRandom() { if (spawn == Position.RandomSpawn) { Random rnd = new Random(); int x = rnd.Next(Width), y = rnd.Next(Length); return(Position.FromFeet(x, y, HighestFreeZ(x, y))); } return(spawn); }
static bool HandleCheckpoint(Player p, Zone zone, ref bool deniedZone, Position newPos) { Position centre = Position.FromFeet(zone.Bounds.XCentre, zone.Bounds.YCentre, zone.Bounds.ZCentre); if (p.CheckPoint == centre) { return(false); } if (zone.Bounds.Contains(newPos.BlockX, newPos.BlockY, (newPos.Z - 32) / 32)) { SendZoneMessage(p, "&aCheckPoint &Sreached! This is now your respawn point."); p.CheckPoint = centre; return(true); } return(false); }