Nächstgelegenden Spieler ermitteln

Erstellt: 2026-05-07 00:58:54 Aufrufe: 51 Tags: playableUnits,getPos,distance

_nearest=objNull;
_nearestdist=10000;
{
_dist=vehicle _x distance civ1;
if (isPlayer _x and _dist<_nearestdist) then {
	_nearest=_x;
	_nearestdist=_dist;
};
} forEach playableUnits;

if (!isNull _nearest) then {civ1 move getPos vehicle _nearest};