Script written by Wyattwic.
Here is a neat little snipplet that will open ghosthawk doors based on altitude.
Add the following in the vehicle init: null = [this] execvm "ghosthawkdoors.sqf";
Here is the ghosthawkdoors.sqf:_unit = _this select 0;
_doorstate = false;
while {alive _unit} do {
_alt = getposatl _unit select 2;
// If under 10 altitude and doors are already closed, open them.
if ((_alt <= 10) && !(_doorstate)) then {
_unit animateDoor ['door_R', 1];
_unit animateDoor ['door_L', 1];
_doorstate = true;
};
// If over 10 altitude and doors are open then close them.
if ((_alt > 10) && (_doorstate)) then {
_unit animateDoor ['door_R', 0];
_unit animateDoor ['door_L', 0];
_doorstate = false;
};
//Slow the script down some. This is not a critical loop.
sleep 7;
};
This setup assumes that the doors are closed on start by default, as BIS had them set.
Forum topic:
- BI forums |