So I have a patient spawner that spawns civillians with a damaged limbs for medical training. However, these guys start to run away sometimes as we are working on them and I'm trying to figure out how to set them captive without having to chase them down and try to flexcuff them or spawn a new one.
Here's the code on the spawner can anyone help with this? Thanks!
[MedicalData1,3] call BIS_fnc_dataTerminalAnimate;
sleep 5;
_group1=createGroup civilian;
'C_Man_1_enoch_F' createUnit [getmarkerPos 'patient1', _group1,'pat1=this; dostop pat1'];
[pat1, selectRandom[0.3,.4,.5,.6], "leg_r", selectrandom ["stab","bullet","falling"]] call ace_medical_fnc_addDamageToUnit;
[pat1, selectRandom[0.3,.4,.5,.6], "leg_l", selectrandom ["stab","bullet","falling"]] call ace_medical_fnc_addDamageToUnit;
[pat1, selectRandom[0.3,.4,.5,.6], "body", selectrandom ["stab","bullet","falling"]] call ace_medical_fnc_addDamageToUnit;
[pat1, selectRandom[0.3], "head", selectrandom ["stab","bullet","falling"]] call ace_medical_fnc_addDamageToUnit;
[pat1, selectRandom[0.3,.4,.5,.6], "hand_r", selectrandom ["stab","bullet","falling"]] call ace_medical_fnc_addDamageToUnit;
[pat1, selectRandom[0.3,.4,.5,.6], "hand_l", selectrandom ["stab","bullet","falling"]] call ace_medical_fnc_addDamageToUnit;
[MedicalData1,0] call BIS_fnc_dataTerminalAnimate;
hint 'Minor Patient Spawned';
pat1 addEventHandler ["Dammaged",
{
_unit = _this select 0;
_part = _this select 1;
_dam = _this select 2;
if ((_part == "") and (_dam > 0.95)) then {_dam = 0.1};
_dam
}];
//the first selctrandom chooses a randomish damage from a small one to a large one, the second selectrandom chooses the type of damage.