Jump to content
cc_kronus

help with script to check if crew position is empty

Recommended Posts

Hi

 

I have a script which I copied from this forum ages ago to create crew in a chopper in multiplayer.  

 
_vehicle = _this select 0;
  _caller = _this select 1;
    _id = _this select 2;
      _helotype = _this select 3; //_class passed in addAction arguments

player sidechat format["%1", _helotype];

_vehicle removeAction _id; //remove the action once it is activated
_spawnpoint = getMarkerPos "pilotspawn";
_grp = createGroup west;

/*

*/

if (_helotype == "RHS_UH1Y") then
{
_pilot2 = "rhsusf_usmc_marpat_wd_helipilot" createUnit [_spawnpoint, _grp, "this assignasgunner _vehicle; this moveinturret [_vehicle,[0]];"];
_crew1 = "rhsusf_usmc_marpat_wd_helicrew" createUnit [_spawnpoint, _grp, "this assignasgunner _vehicle; this moveinturret [_vehicle,[1]];"];
_crew2 = "rhsusf_usmc_marpat_wd_helicrew" createUnit [_spawnpoint, _grp, "this assignasgunner _vehicle; this moveinturret [_vehicle,[2]];"];
hint parseText "<t color='#33cc33'>Tripulació a l'aparell</t>";

};

The problem is that sometimes we have both a human pilot and a copilot, so the _pilot2 position does not need to be created.    Is there any way to make the _pilot2  check if the seat is empty and if it is not, skip the creation of unit and move onto _crew1 and _crew2. ?

I have seen the function fullcrew  but I am totally lost on how to apply it and run a check of the turret 0 of the vehicle.   Help with the right syntax would be highly appreciated.

 

 

Share this post


Link to post
Share on other sites

if (isNull (helo turretUnit [0])) then { hint "there is no copilot in helo" };

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

×