Wenn auch ein abgesprungener Pilot ersetzt werden soll, dann muss das so ausshen:
Code:
temp = this spawn
{
private "_d";
if (!isServer) exitWith {};
while {damage _this < 0.9} do
{
waitUntil {(position _this)select 2 > 10 or damage _this > 0.9};
if ((! alive driver _this) and damage _this < 0.9 and count crew _this > 0) then
{
if (isNull driver _this) then
{
_d = (crew _this)select 0;
_d setPos [0,0,50];
_d moveInDriver _this;
sleep 0.1
}
else
{
{
if ((!alive driver _this )and driver _this != _x) then
{
driver _this setPos (getPos _this);
_x setPos [0,0,50];
_x moveInDriver _this;
sleep 0.1
}
} forEach crew _this
}
};
sleep 1
}
}
alive driver Heli gibt auch false zurück, wenn gar kein Pilot vorhanden ist.
driver Heli dagegen muss mit isNull abgefragt werden um festzustellen ob überhaupt wer auf diesem Platz sitzt.