Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Enables antennas and sets their radius to maximum. Need to find a way to ensure broadcasting is on.
- void EnableAntennas()
- {
- List<IMyTerminalBlock> antennas = new List<IMyTerminalBlock>();
- GridTerminalSystem.GetBlocksOfType<IMyRadioAntenna>(antennas);
- for (int i=0; i < antennas.Count; i++)
- {
- antennas[i].GetActionWithName("OnOff_On").Apply(antennas[i]);
- antennas[i].SetValueFloat("Radius", 50000.0f);
- }
- }
- // Checks is a ship is piloted. For example, if a pilot accidentally exits a ship, this could be used to engage emergency stop.
- bool ShipIsPiloted()
- {
- List<IMyTerminalBlock> controlStations = new List<IMyTerminalBlock>();
- GridTerminalSystem.GetBlocksOfType<IMyCockpit>(controlStations);
- for (int i = 0; i < controlStations.Count; i++)
- {
- if ((controlStations[i] as IMyCockpit).IsUnderControl)
- {
- return true;
- }
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement