How can I disable the standard helicopters?
I need a similar way of (This is for the aircraft):
Code:void removeBuiltInAirdrop() { var triggeredEvents = UnityEngine.Object.FindObjectsOfType<TriggeredEventPrefab>(); var planePrefab = triggeredEvents.Where(e => e.targetPrefab != null && e.targetPrefab.guid.Equals("8429b072581d64747bfe17eab7852b42")).ToList(); foreach (var prefab in planePrefab) { Puts("Builtin Airdrop removed"); UnityEngine.Object.Destroy(prefab); } }
Solved Disabling default helicopter?
Discussion in 'Rust Development' started by Romzes, Oct 1, 2016.
-
Use HeliControll plugin - in default settings it doesnt change nothing, but it haves option to disable heli completely
-
I have my own plugin. I have a timer at the right time I launch the helicopter. Only now do I need to disable the standard flight helicopter, how to do it?
-
Take a look at HeliControl's code and feel free to use it, it does what you're looking for, I believe.
-
I have almost everything ready, it remains only to remove the default event. -
Inside of HeliControl there is code that does exactly what I believe you want, here is the snippet:
Code:for (int i = 0; i < events.Length; i++) { var prefab = events[i]; var name = prefab?.targetPrefab?.resourcePath ?? "Unknown"; if (name.Contains("heli")) { GameObject.Destroy(prefab); Puts("Disabled default Helicopter spawning."); break; } }
-
Thank you, that's what I was looking for!