Jump to content
Sign in to follow this  
SouthSaturnDelta

eject everyone exept the pilot and gunners

Recommended Posts

Hello, another puzzling setback to my half arse work.

I need to ditch all the units in a vehicle (Heli),but not the original crew.

Could use

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

foreach (units group player)

But prefer to try

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

"if (_x != driver _vehicle && _x != gunner _vehicle) then {_para_array = _para_array + [_x]}" foreach _crew_array

This line is giving all sorts of errors just now.

Any ideas?

Share this post


Link to post
Share on other sites

To be on the safe side, you can do it this way. To ensure you get just the cargo for vehicles with multiple gunners:

Create a function called SSD_CargoCrew.sqf for example:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">private ["_cargocrew","_Vehicle"];

_Vehicle=_This Select 0;

_CargoCrew=[];

{

If (((AssignedVehicleRole _x) Select 0)=="Cargo") Then

       {

       _CargoCrew=_CargoCrew+[_x];

       };

} ForEach ((Crew _Vehicle)-(Driver _Vehicle)-(Commander _Vehicle));

_CargoCrew

Load the function from your init.sqf or somewhere suitable with:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">SSD_CargoCrew=Compile PreProcessFile "SSD_CargoCrew.sqf"

Then call it when required with:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_para_array=[_Vehicle] Call SSD_CargoCrew

I currently have a team of legal experts compiling a water tight disclaimer smile_o.gif But in the mean time:

There may be typo's or syntax errors in the above code. But the principle works.

I will not be held accountable for any aspects of your requirements, which you choose to keep hidden.

The above code is just one example of how to achieve the requested results and is not supposed to be the eleventh Commandment.

Other than that, I hope it helps smile_o.gif

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×