Hab mal auf die schnelle ein nützlicheres, variables Skript geschrieben
Code:
/*
============================================================
by Cyborg11
Version: 1.0
Parameters:
_spawn = true or false
_unit = Unitname by _spawn = false
and
Classname by _spawn = true
_pos = array of possible spawn positions (markers)
Example1: nul = [false,unit,[pos1,pos2,pos3]] execVM "randomspawn.sqf";
Example2: nul = [true,["SoldierWB",west],[pos1,pos2,pos3]] execVM "randomspawn.sqf";
=============================================================
*/
_spawn = _this select 0;
If (_spawn && _this select 1 == typeName "ARRAY") then {
_unitarray = _this select 1;
_unit = _unitarray select 0;
_side = _unitarray select 1;
} else {
_unit = _this select 1;
};
_posarray = _this select 2;
_poscount = count _posarray;
_pos = _posarray select (round (random _poscount));
If (_spawn) then {
If (_unit isKindOf "MAN") then {
_rgrp = createGroup _side;
_man = _unit createGroup [getMarkerPos _pos, _rgrp];
} else {
_veh = _unit createVehicle (getMarkerPos _pos);
};
} else {
_unit setPos (getMarkerPos _pos);
};
Ist aber nicht getestet, da ich es nur auf die Schnelle geschrieben habe (5 Min)