Nächstgelegenden Spieler ermitteln

Erstellt: 2026-03-25 23:38:01 Aufrufe: 31 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};