public void Despawn(uint aircraftId) { lock (lockObj) { logger.LogDebug("Despawning object ID {id}.", aircraftId); simconnect?.AIRemoveObject(aircraftId, DATA_REQUESTS.AI_DESPAWN); } }
private void RemoveFarAwayObjects(Coordinate userLocation, int radius) { foreach (var simObject in ObjectsInSimulation.Values) { if (Distance(userLocation, simObject.Location) > radius) { sc.AIRemoveObject(simObject.ObjectID, Requests.RemoveAI); } } }
private void detach_towplane() { simconnect.AIRemoveObject(towplaneid, DATA_REQUESTS.REQUEST_PLANE_LIST); AirplaneData apd = new AirplaneData(); apd.altitude = 99999; apd.latitude = 0; apd.longitude = 0; simconnect.SetDataOnSimObject(DEFINITIONS.AirplaneData, towplaneid, 0, apd); attachTick.Stop(); button3.Text = "Attach towplane to player"; isAttached = false; towplaneid = uint.MaxValue; playerid = uint.MaxValue; }
public void AiRemoveObject(UInt32 simObject, int enumOffset) { _mySimconnect.AIRemoveObject(simObject, RequestId.ObjectBase + enumOffset); }