Nächstgelegenden Spieler ermitteln

Erstellt: 2025-12-14 16:36:41 Aufrufe: 1 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};