Zum Beispiel so... (nicht getestet, irgendwann muss ich mir mal ArmA auf den Rechner auf der Arbeit machen
)
Code:
if (format ["%1", ab2] == "scalar bool array string 0xe0ffffef") exitWith {};
if (!alive ab2) exitWith {};
_bombs = ["R_Hydra_HE","R_PG7V_AT","SH_125_HE","SH_105_HE","M_Hellfire_AT","BO_GBU12_LGB","Nichts"];
_ran = floor (random count _bombs);
if ((_bombs select _ran) != "Nichts") then {
Bomb1 = (_bombs select _ran) createVehicle [(getpos ab2 select 0),(getpos ab2 select 1),0];
// wenn die Variable für die Bombe (BombX) immer anders heißen muss, dann so:
// call compile format ["Bomb%1 = (_bombs select _ran) createVehicle [(getpos ab2 select 0),(getpos ab2 select 1),0];",_ran];
} else {
hint "Die Bombe ist Schrott!";
};
Xeno