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

You cant spawn vehicle with createunit command.

 

anyway i show you how i handle with

        _grp4C = [_newPos, INDEPENDENT, (configfile >> "CfgGroups" >> "Indep" >> "LOP_AM" >> "Motorized" >> "LOP_AM_Motor_squad_LR")] call BIS_fnc_spawnGroup;
	_cleanUpveh = vehicle leader _grp4C;
	[_grp4C,getpos warlord, 200] call BIS_fnc_taskPatrol;

        {deleteVehicle _x} forEach units _grp4C;
	{deleteVehicle _x} forEach crew _cleanUpveh + [_cleanUpveh];
	deleteGroup _grp4C;
  • Like 1

Share this post


Link to post
Share on other sites

Hi! Thanks for the answer. I waited for an answer.

How do I create multiple groups and is randomly?

Share this post


Link to post
Share on other sites

how to optimize it skripts, for better performance?

 

 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 > 2) then { _this select 2 } else { 3; };
_parUnit = if (count _this > 3) then { _this select 3 } else { 10; };
_parStat = if (count _this > 4) then { _this select 4 } else { 5; };
_cleanUpveh = [];
_cleanStatick = [];
 
_typer = ["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"]; 
_GrpDiver = createGroup WEST;
for "_x" from 1 to _parVeh step 1 do {
_type = _typer select (floor(random(count _typer)));
_rndPos = [[[_markpos, _radius], []], ["water", "out"]] call BIS_fnc_randomPos; 
_unit33 = _type createVehicle _rndPos;
_crew = [ _unit33, _GrpDiver ] call bis_fnc_spawncrew;
_cleanUpveh = vehicle leader _GrpDiver;
}; 
[_GrpDiver, (_markpos), (random(50)+100)] call BIS_fnc_taskPatrol;
sleep 3;
_types = ["rhsusf_army_ocp_squadleader","rhsusf_army_ucp_sniper","rhsusf_army_ocp_riflemanat","rhsusf_army_ocp_medic","rhsusf_army_ucp_machinegunnera","rhsusf_army_ocp_machinegunner","rhsusf_army_ocp_grenadier", "rhsusf_army_ocp_engineer","rhsusf_army_ocp_combatcrewman","rhsusf_army_ocp_autoriflemana","rhsusf_army_ucp_autorifleman","rhsusf_army_ucp_javelin","rhsusf_army_ocp_aa","rhsusf_army_ucp_aa"];
 
_GrpUnit = createGroup WEST;
for "_x" from 1 to _parUnit step 1 do {
_type = _types select (floor(random(count _types)));
         _rndPos = [[[_markpos, _radius], []], ["water", "out"]] call BIS_fnc_randomPos; 
_specnaz = _GrpUnit createUnit [_type, _rndPos, [], 0, "NONE"];
}; 
  [_GrpUnit, (_markpos), (random(50)+75)] call BIS_fnc_taskPatrol;
Sleep 3;
 
_statickUnits = ["B_HMG_01_high_F","B_GMG_01_high_F","B_Mortar_01_F","B_GMG_01_F"];
_GrpStatick = createGroup WEST;
for "_x" from 1 to _parStat step 1 do {
_type = _statickUnits select (floor(random(count _statickUnits)));
_rndPos = [[[_markpos, _radius], []], ["water", "out"]] call BIS_fnc_randomPos; 
_statick = _type createVehicle _rndPos;
_crew = [ _statick, _GrpStatick ] call bis_fnc_spawncrew;
_cleanStatick = vehicle leader _GrpStatick;
}; 
 
here so is removed all the groups and Appliances:
 
{deleteVehicle _x} forEach units _GrpDiver;
{deleteVehicle _x} forEach crew _cleanUpveh + [_cleanUpveh];
deleteGroup _GrpDiver;
 
{deleteVehicle _x} forEach units _GrpUnit;
deleteGroup _GrpUnit;
 
{deleteVehicle _x} forEach units _GrpStatick;
{deleteVehicle _x} forEach crew _cleanStatick + [_cleanStatick];
deleteGroup _GrpStatick;

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  

×