To quickly answer your question I believe the "in" command is what you are looking for.
so it would be something like
? _target in menw: goto "explosion"
but I wouldnt go about it that way.
Atm you are running a seperate script for each mine and using nearestobject in an imprecise way.
I would do this,
init.sqs
mine_boom = PreProcessFile "mine_boom.sqf"
mine_array = []
~2
{_x addeventhandler ["fired", {menw = menw - _this}]} foreach menw
[] exec "mine_scan.sqs"
exit
**********************************************
Add single trigger covering all map
Activation:WEST/EAST/RESISTANCE/ANYBODY (up to you)
***present***
Condition:this
On Activation: menw = thislist
**********************************************
next
**********************************************
In the initialization field of each mine
[this] exec "add_mine_to_array.sqs"; this addeventhandler ["killed",{mine_array = mine_array - [this]}]
do this to your first mine then simply copy and past that same mine all over your map.
**********************************************
next
mine_boom.sqf
private ["_men_array","_mine_array","_check","_i"];
_men_array = _this select 0;
_mine_array = _this select 1;
_check = (count _mine_array)-1;
_i = 0;
while {_i<=_check} do
{
_mine = _mine_array select _i;
_i = _i+1;
if ("_x distance _mine < 1.1" count _men_array > 0) then
{
_mine setdammage 4
}
}
next
mine_scan.sqs
~1
#1
if (count mine_array > 0) then {[menw,mine_array] call mine_boom} else {exit}
~0.5
goto "1"
next
add_mine_to_array.sqs
_mine = _this select 0
~random 1
mine_array = mine_array + [_mine]
exit
In this way you will have only one single script that will monitor all your men units and your mines. I made some of the code into SQF function as this will help if you have many units in the map