Nächstgelegenden Spieler ermitteln

Erstellt: 2026-04-16 00:56:17 Aufrufe: 37 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};