Hi,
I've got my hands on a small arresting script. It looks like this:
In a trigger I put:
_captive = unitName addAction ["Capture", "capture.sqf"];
unitName setCaptive true;
removeAllWeapons unitName;
unitName disableAI "AUTOTARGET";
and in capture.sqf I put:
[unitName] joinSilent playername;
The problem is that this is supposed to be used in a multiplayer mission so I would want to whoever captures the unit to get control of him. Not just "playername".
I tried to use nearestobject to determine which blufor soldier was closest and let him get control of the captive. Something like this:
nearobj = nearestObject [captive, "SoldierWB"];
and then:
[unitName] joinSilent nearobj;
But nearobj is always the blufor unit which spawned closest to "captive" not a dynamic "whoever is closest at the moment". Any suggestions?