Called:Code:fSpawnChop = { private["_comp","_side","_heli","_nr","_h","_hlist"]; _comp = _thisselect 0; _side = _thisselect 1; _h = nearestObjects [_comp, ["HeliH"], 100]; _nr = random 1; if (_nr > 0.25) then { switch (_side) do { caseEAST: { _heli = [["ACE_Mi17_RU", "Mi24_V", "ACE_Mi24_V_FAB250_RU", "Ka52Black"],[12,8,6,2]] call CRB_fnc_selectRandomBias; _spawned = _helicreateVehicle (position_h); _spawnedsetPos (getPos_h); _spawnedsetDir (getDir_h); }; caseWEST: { _heli = [["MH60S", "Mi17_CDF", "UH1Y", "ACE_AH1W_AGM_W"],[12,8,6,2]] call CRB_fnc_selectRandomBias; _spawned = _helicreateVehicleposition_h; _spawnedsetPos (getPos_h); _spawnedsetDir (getDir_h); }; }; }; };
if (_camp == "heli_park_us1") then {[_pos, WEST] call fSpawnChop;};
if (_camp == "heli_park_ru1") then {[_pos, EAST] call fSpawnChop;};
so what im trying to do is detect if the spawned composition is a heli park, and if it is, spawn a random chopper there. Any ideas? Seems to not be working.
Also, is there a solution to this? If, then statements tend to cause issues I've noticed, is there a more proficient way to check if _x in in which list?
Example:Code:_fac = "GUE"; if (_camp in _rucamps) then { _fac = "RU"}; if (_camp in _inscamps) then { _fac = "INS"}; if (_camp in _usmccamps) then { _fac = "USMC"}; if (_camp in _cdfcamps) then { _fac = "CDF"};
HOME 
Reply With Quote



