I think the main reason it doesn't work is that the createUnit seems to be incorrect. Try this:
Code:
"US_Soldier_Pilot_EP1" createUnit [getMarkerPos "spawnPlane", group player, "this moveInDriver supplyPlane",1,"Captain"];
"this" will not work where I have "group player" and you have to pass the unit type at the front inside a string. It doesn't need to be group player of course. I do this in my scripts:
Code:
_group = createGroup _side;
where _side is west, east, resistance, civilian, or whatever else is allowed (no quotes).
Also Grimes is correct in the sense that some fixed wing aircraft do need a push. I've seen spawned jets go backwards and flip over and crash. The C130 seems to be handling itself ok in my testing. Here is the code I used in full just now:
Code:
_heading = 330;
_speed = 150;
_velx = (sin _heading * _speed);
_vely = (cos _heading * _speed);
_velz = 0;
_posx = getMarkerPos "spawnPlane" select 0;
_posy = getMarkerPos "spawnPlane" select 1;
_posz = 100;
_newVeh = createVehicle ["C130J_US_EP1", [_posx, _posy, _posz], [], 0, "FLY"];
_newVeh setDir _heading;
_newVeh setVelocity [_velx, _vely, _velz];
"US_Soldier_Pilot_EP1" createUnit [getMarkerPos "spawnPlane", group player, "this moveInDriver _newVeh",1,"Captain"];
The _velx/y/z is to get the correct direction for the push, multiplied by start speed which I have set to 150. After it's spawned, I set it's velocity.