Thanks Salmo, will test tonight. With regards to mission number.. well I can't say it is always mission 3 or mission 12. As the game goes on missions load and count in and the mission number can be mission 256
Anyways I will test that tonight. it is clean and looks like it will do the job.
My other way I looked at today was this but have not tested yet.
The below code removes all objects loaded in the mission that are from a country. example de
Code:
Dictionary<GroundStationary, int> StationaryMisRelation = new Dictionary<GroundStationary, int>();
//Section 1: Trigger Nachrichten
public override void OnTrigger(int missionNumber, string shortName, bool active)
{
base.OnTrigger(missionNumber, shortName, active);
if ("DeleteTrigger".Equals(shortName) && active) //Trigger 1 Nachricht
{
foreach (KeyValuePair<GroundStationary, int> kvp in StationaryMisRelation)
{
GamePlay.gpLogServer(null, "Stationary: {0}; MissNr.: {1}", new object[] { kvp.Key.Title, kvp.Value });
}
Timeout(20, () =>
{
GamePlay.gpGetTrigger(shortName).Enable = false;
});
}
}
// Destroy all [Stationary] objects for country de (germany)
public void RemoveStaticAt(string country) //not sure if this will work.
{
foreach (GroundStationary stationary in GamePlay.gpGroundStationarys(country))
{
country = de;
{
stationary.Destroy();
}
}
}