Monsada 10 Posted December 3, 2009 (edited) Hi all, I am worried with a problem, I am doing an script for IA and want the group exit vehicle when near objective. I trid this: { If (_x!= gunner _vehicle && _x!= driver _vehicle) then { _x leaveVehicle _vehicle; }; } foreach crew _vehicle; the problem is gunner returns a relative name to vehicle _vehicle = A_1_1 gunner _vehicle = A_1_1G driver _vehicle = A_1_1D but crew returns another names: example 1_2_3 1_2_4 1_2_5 how to identify de gunner and driver using crew for avoiding disembark gunner and driver? (corrected _x, thankhs nuxil) Edited December 3, 2009 by Monsada Share this post Link to post Share on other sites
nuxil 2 Posted December 3, 2009 (edited) if you look on your if statment you see its wrong. the x is missing a underscore x -> _x If (x!= gunner _vehicle && x!= driver _vehicle) then { If (_x != gunner _vehicle && _x != driver _vehicle) then { also. i would not use leaveVehicle. even tho it unassigns them. but you never know.. so put in a simple action. getout or eject . like { If (_x != gunner _vehicle && _x != driver _vehicle) then { unassignVehicle _x; _x action ["getOut", vehicle _x] ; }; } foreach crew _vehicle; Edited December 3, 2009 by nuxil Share this post Link to post Share on other sites
Deadfast 43 Posted December 3, 2009 An alternative without the if: { unassignVehicle _x; _x action ["getOut", _vehicle]; } forEach ((crew _vehicle) - [driver _vehicle, gunner _vehicle]); Share this post Link to post Share on other sites
f2k sel 145 Posted December 3, 2009 Don't you find they still get back in? I have to use [_x] allowGetIn false; placed after the action command. Share this post Link to post Share on other sites
Deadfast 43 Posted December 3, 2009 They shouldn't after unassignVehicle. Share this post Link to post Share on other sites
f2k sel 145 Posted December 3, 2009 They do get back in probably because they're still part of the same group. Share this post Link to post Share on other sites
Monsada 10 Posted December 4, 2009 Thanks for all, it runs ok ;) Now I had one doubt more, I need to know the capacity of a vehicle. How can I get it? How can I know if a vehicle is full? Share this post Link to post Share on other sites
Deadfast 43 Posted December 4, 2009 emptyPositions Check if all passenger seats are full: _car = myVehicle; if (_car emptyPositions "Cargo" == 0) then { hint "Vehicle is full."; }; Share this post Link to post Share on other sites
Monsada 10 Posted December 4, 2009 Thanks Deadfast!! it runs ok. Another trouble, now I want to order a group of IA to "MoveToCargo", the problem is that IA disapear and apear in vehicle as cargo. I tried: _x moveinCargo _vehicle; _x action ["getInCargo", _vehicle]; and _x action ["moveToCargo", _vehicle]; but two first moves instantly, and the last, _x action ["moveToCargo", _vehicle]; does nothing. How can i do for the IA moves to vehicle and then gett in it? Share this post Link to post Share on other sites
nuxil 2 Posted December 4, 2009 maybe something like _vehicle = car; { _x assignAsCargo _vehicle; [_x] allowGetIn true; [_x] orderGetIn true } foreach (units group AI); in this example, AI is the name of the group leader of the Ai squad. Share this post Link to post Share on other sites