Or, simplier (you didn't specify if ranks matter so left it out).
You can paste this into a trigger on activation if you wish (just remove the comments first), or in some script (like init.sqf if you wish it to be available right from the start):
player addAction [
"Join Me", //title of the action
{
(_this select 0) removeAction (_this select 2);//removes the action once used,
// finds man class objects around the player within 20m radius and if on the same side as player joins them silently (without the radio calls)
{
if (side _x == side player) then {
[_x] joinSilent player;
};
} forEach (nearestObjects [player, ["Man"], 20]);
}
];
EDIT:
Didn't test the above in A1 though, so not 100% it will work
EDIT2:
Oh, and in case you weren't already familiar with A1 scripting, it prefers .sqf not .sqs so any script examples we give are in .sqf format (both scripts and functions are now in .sqf) and such scripts have to executed using
execVM,
not exec.
Just wanted to make sure, not knowing how familiar you are with these thingies...