Jump to content
Sign in to follow this  
Diabolical1001

Gunner and commander cannot enter vehicle without driver script?

Recommended Posts

as the title has stated

is there a way ( in a multiplayer setting) to restrict the gunner/commander seats in vehicles unless there is a driver present?

been looking around and cant seem to find anything on it

thanks

Share this post


Link to post
Share on other sites

It seems like a great idea at first. I was thinking of writing a script to do this. However, it could go wrong. What happens if the vehicle is out in the field and something happens to the driver? A disconnect, or a death (somehow). That would automatically render the vehicle useless. Anyhow... here's one way, though it only checks initially when the crew would get in.

Something like this maybe (untested):

this addEventHandler ["GetIn", {call TAG_fnc_crewCheck}];

init.sqf

TAG_fnc_crewCheck = {
   _veh = _this select 0;
   _unit = _this select 2;
  if (count driver _veh > 0) then {
      hint "ready to roll";
  } else {
     _unit action ["Eject", _veh];
    hint "there's no driver";
  };
};

Edited by Iceman77

Share this post


Link to post
Share on other sites
It seems like a great idea at first. I was thinking of writing a script to do this. However, it could go wrong. What happens if the vehicle is out in the field and something happens to the driver? A disconnect, or a death (somehow). That would automatically render the vehicle useless. Anyhow... here's one way, though it only checks initially when the crew would get in.

Something like this maybe (untested):

this addEventHandler ["GetIn", {call TAG_fnc_crewCheck}];

init.sqf

TAG_fnc_crewCheck = {
   _veh = _this select 0;
   _unit = _this select 2;
  if (count driver _veh > 0) then {
      hint "ready to roll";
  } else {
     _unit action ["Eject", _veh];
    hint "there's no driver";
  };
};

thanks iceman, and the whole (What happens if the vehicle is out in the field and something happens to the driver) ill use the tough luck excuse

---------- Post added at 04:59 ---------- Previous post was at 04:48 ----------

It seems like a great idea at first. I was thinking of writing a script to do this. However, it could go wrong. What happens if the vehicle is out in the field and something happens to the driver? A disconnect, or a death (somehow). That would automatically render the vehicle useless. Anyhow... here's one way, though it only checks initially when the crew would get in.

Something like this maybe (untested):

this addEventHandler ["GetIn", {call TAG_fnc_crewCheck}];

init.sqf

TAG_fnc_crewCheck = {
   _veh = _this select 0;
   _unit = _this select 2;
  if (count driver _veh > 0) then {
      hint "ready to roll";
  } else {
     _unit action ["Eject", _veh];
    hint "there's no driver";
  };
};

thanks iceman, and the whole (What happens if the vehicle is out in the field and something happens to the driver) ill use the tough luck excuse

---------- Post added at 05:02 ---------- Previous post was at 04:59 ----------

well, not quite working, this is what was in the rpt file though

Error in expression <s select 0;
_unit = _this select 2;
if (count driver _veh > 0) then {
hint "read>
 Error position: <count driver _veh > 0) then {
hint "read>
 Error count: Type Object, expected Array,Config entry
File C:\Users\radio rentals\Documents\Arma 3 - Other Profiles\Diabolical\mpmissions\crewkick%20test.Stratis\init.sqf, line 4
Error in expression <s select 0;
_unit = _this select 2;
if (count driver _veh > 0) then {
hint "read>
 Error position: <count driver _veh > 0) then {
hint "read>
 Error count: Type Object, expected Array,Config entry
File C:\Users\radio rentals\Documents\Arma 3 - Other Profiles\Diabolical\mpmissions\crewkick%20test.Stratis\init.sqf, line 4
Error in expression <s select 0;
_unit = _this select 2;
if (count driver _veh > 0) then {
hint "read>
 Error position: <count driver _veh > 0) then {
hint "read>
 Error count: Type Object, expected Array,Config entry
File C:\Users\radio rentals\Documents\Arma 3 - Other Profiles\Diabolical\mpmissions\crewkick%20test.Stratis\init.sqf, line 4

Share this post


Link to post
Share on other sites
TAG_fnc_crewCheck = {
   _veh = _this select 0;
   _unit = _this select 2;
  if (!isNull driver _veh) then {
      hint "ready to roll";
  } else {
     _unit action ["Eject", _veh];
    hint "there's no driver";
  };
};

Share this post


Link to post
Share on other sites

cheers

working good besides the fact that if your in the the drivers seat and scroll to the gunners seat it doesn't kick you out, not sure on a fix for that

Share this post


Link to post
Share on other sites

You'd have to monitor the seats in a loop and kick any occupants out if a driver isn't present. Unless someone knows a better way.

Share this post


Link to post
Share on other sites

this has got me stuck, if i could fin a way in were if your in the drivers seat it would disable the option to move to commander and gunner it would be fine

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  

×