Although this technique sort of works (as suggested by Jason0), it is a very inefficient way to detect when someone exits a vehicle. It also would only work at the end of init.sqs, since it doesn't run a new script. You should be placing a "GETOUT" event handler on the plane instead, which will be performed at the moment the player gets out of the plane, rather than continually checking whether the player is still in the plane using @.
Since it is a separate file, life is easier in SQF.
this addEventHandler ["GETOUT", { _this execVM "jumpFormation.sqf" }];
_jumper = _this select 2;
// Only run the script if it is the local player jumping out of the plane.
if (_jumper != player) exitWith {};
// I suspect that waiting 2.5 seconds is a bit much, since you want the AI to
// appear as soon as the player has cleared the aircraft.
// You might like to play with this value to get the effect you want.
sleep 1;
_numChutes = 4;
_verticalOffset = 2; // Distance above player to put AI parachutes.
_radius = 10;
_delta = 360 / _numChutes;
// Create the formation.
for "_i" from 0 to (_numChutes - 1) do
{
_pos = [((getPos (vehicle player)) select 0) + (sin(_delta * _i) * _radius),
((getPos (vehicle player)) select 1) + (cos(_delta * _i) * _radius),
((getPos (vehicle player)) select 2) + _verticalOffset];
chute = createVehicle ["ParachuteWest", _pos, [], 0, "FLY"];
chute setPos _pos;
chute setDir (getDir (vehicle player));
_soldier = "SoldierWPilot" createUnit [_pos, group player, "this moveInDriver chute"];
// Re-equip the soldier with removeAllWeapons,addWeapon,addMagazine here.
};
// Keep the formation on the way down (AI seem to paradrop using different
// physics to players!).
// This is quite ugly in a way, since the parachutes look like they are pinned
// in space, but otherwise, they would not keep in formation at all...
waitUntil
{
for "_i" from 0 to (_numChutes - 1) do
{
_pos = [((getPos (vehicle player)) select 0) + (sin(_delta * _i) * _radius),
((getPos (vehicle player)) select 1) + (cos(_delta * _i) * _radius),
((getPos (vehicle player)) select 2) + _verticalOffset];
(vehicle ((units (group player)) select (_i + 1))) setPos _pos;
};
// Wait until the player is near the ground to break the formation.
((getPos (vehicle player)) select 2) < 10;
};
exit;
On a more general note, saying that you are getting errors isn't very helpful to us, since it means we have to entirely recreate the mission you are testing, hoping that we make an exact copy just from your description. If we knew the error message, then we could probably fix the code without having to even fire up ArmA. Please either write down the full error message or take a screen-shot (but remember to trim the image down to just the black error area, or the file will be unnecessarily large).