OK - first a little summary:
array1 = [planetype,seattype,canopytype]
This array contains 3 elements:
type of the plane (we need this only to compare it to the
plane, we get passed by the action) - a10
type of the seat (for that plane) - a10seat
type of canopy (for that plane) - a10canopy
OK, this array would only cover one plane.
What you need is something like a table (or database), where
more plane types are possible.
Therefore you need to work with subarrays.
main_array = [array1,array2,array3]
Now you have an array, which contains of 3 subarrays.
main_array looks then like:
planetype seattype canopytype
"a10" "a10seat" "a10canopy"
"su25" "su25seat" "su25canopy"
"F16" "F16seat" "F16canopy"
Now if you execute the action, you need to compare the plane,
from where the action has been called (_this select 0)
against the first parameter of the subarrays from main_array.
Once you find the right plane, you can use this subarray to
get the seat and canopytypes.
To get the plane you can use (as already mentioned):
_plane = _this select 0
Now you need the type of the plane:
_planet = typeOf(_plane)
Now comes the "if" stuff.
{If (_planet == _x select 0) Then {_seatt = _x select 1; _canopyt = _x select 2}} ForEach my_array
This command does now compare _planet to each subarrays
first element, and if it does match, _seatt and _canopyt will be
assigned to the seattype and canopytype of the same subarray,
where the plane does match.
[_plane,_seatt,_canopyt] exec "ejection.sqs"
This line will then execute ejection.sqs and pass an array of
3 parameters to the script.
OK, let's have a look how it will work in real:
you fly in an a10
you press the custom action: eject-plane
_plane = _this select 0
;_plane will be the plane which owns the action
_planet = typeOf(_plane)
;will be a10
{If (_planet == _x select 0) Then {_seatt = _x select 1; _canopyt = _x select 2}} ForEach main_array
_x represents each subarray from main_array
_x select 0 represents each first element of each subarray
inside main_array => the plane type
Now _planet (in this case: a10) does match with one of the
first elements of the subarrays: a10 - su25 - F16 - doesn't it?
OK it matches with: a10
This means _seatt = "a10seat" and _canopyt = "a10canopyt"
Then the script says:
[_plane,_seatt,_canopyt] exec "ejection.sqs"
or:
[the plane,"a10seat","a10canopy"] exec "ejection.sqs"
:note - for the exec array i did not use _planet, as it's only
the type of the plane, but i used _plane, as it's the reference
to the plane itself.
hope the fire gets burning now
~S~ CD