Jump to content
Sign in to follow this  
sergeziegler

Hi! How do I delete in this case is Vehicle and Crew a group of drivers

Recommended Posts

Hi! How do I delete in this case is Vehicle and Crew a group of drivers....
example:

 

 

_mkr = if (count _this > 0) then { _this select 0 } else { _exit = true };if (_exit) exitWith {};
_markpos = getMarkerPos _mkr; 
_marksize = getMarkerSize _mkr;
_markrad = floor(sqrt((_marksize select 0)*(_marksize select 1)));
 
_radius = if (count _this > 1) then { _this select 1} else { floor(_markrad*1.67); };

_parVeh = if (count _this > 3) then { _this select 3 } else { 5; };

_typerVeh = ["rhsusf_M1078A1P2_B_M2_wd_open_fmtv_usarmy","rhsusf_m998_w_4dr","rhsusf_m998_w_2dr","rhsusf_m1025_w_s","B_G_Offroad_01_armed_F","B_Truck_01_fuel_F","B_Truck_01_mover_F"];

_GrpVeh = createGroup WEST;
for "_x" from 1 to _parVeh step 1 do {
_typeVeh = _typerVeh select (floor(random(count _typerVeh)));
_rndPos = [_markpos,50,_radius,5,0,0.5,0,[],[]] call BIS_fnc_findSafePos; 
_unit33 = _GrpVeh createUnit [_typeVeh, _rndPos, [], 0, "NONE"];
if (isNull _unit33) then {_unit33 = _typeVeh createVehicle _rndPos;
createVehicleCrew _unit33;};
(group _unit33) selectLeader _unit33;
}; 
[_GrpVeh, (_markpos), (random(50)+75)] call BIS_fnc_taskPatrol;

In this example, I was not able to remove. ???

{deleteVehicle _x} forEach (crew _unit33); deleteVehicle _unit33; 
{deleteVehicle _x} forEach units _GrpVeh ;

Share this post


Link to post
Share on other sites

Hi! How do I delete in this case is Vehicle and Crew a group of drivers....

example:

 

 

_mkr = if (count _this > 0) then { _this select 0 } else { _exit = true };if (_exit) exitWith {};
_markpos = getMarkerPos _mkr; 
_marksize = getMarkerSize _mkr;
_markrad = floor(sqrt((_marksize select 0)*(_marksize select 1)));
 
_radius = if (count _this > 1) then { _this select 1} else { floor(_markrad*1.67); };

_parVeh = if (count _this > 3) then { _this select 3 } else { 5; };

_typerVeh = ["rhsusf_M1078A1P2_B_M2_wd_open_fmtv_usarmy","rhsusf_m998_w_4dr","rhsusf_m998_w_2dr","rhsusf_m1025_w_s","B_G_Offroad_01_armed_F","B_Truck_01_fuel_F","B_Truck_01_mover_F"];

_GrpVeh = createGroup WEST;

for "_x" from 1 to _parVeh step 1 do {

_typeVeh = _typerVeh select (floor(random(count _typerVeh)));

_rndPos = [_markpos,50,_radius,5,0,0.5,0,[],[]] call BIS_fnc_findSafePos; 

_unit33 = _GrpVeh createUnit [_typeVeh, _rndPos, [], 0, "NONE"];

if (isNull _unit33) then {_unit33 = _typeVeh createVehicle _rndPos;

createVehicleCrew _unit33;};

(group _unit33) selectLeader _unit33;

}; 

[_GrpVeh, (_markpos), (random(50)+75)] call BIS_fnc_taskPatrol;

In this example, I was not able to remove. ???

{deleteVehicle _x} forEach (crew _unit33); deleteVehicle _unit33; 

{deleteVehicle _x} forEach units _GrpVeh ;

Share this post


Link to post
Share on other sites

Try this:

 

{deleteVehicle _x} forEach (crew vehicle _unit33) + [vehicle _unit33];

 

 

I haven't ​tried it in exactly this form, but it should work.

​

Share this post


Link to post
Share on other sites

You better check your code line by line, because when I execute it, _unit33 is null even after the if(isNull _unit33) statement.

 

Sorry, that I can't help you further for now, but I'm on the hop right now.

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  

×