This comes from a larger script im working with but i've run into this problem.
I have used BIS function to create a vehicle with the following conditions as below:
But the problem is when i come to set the waypoint loop criteria below i'm not sure how to do it. If I use this a C130 turns up but the script never spawns the crate.Code:_c130Grp = createGroup (west); _pos1 = [(_bpos select 0)+3000 -(random 2000),(_bpos select 1)+3000 -(random 2000),(_bpos select 2)+1000 ]; [_pos1, 180, "PRACS_C130", _c130Grp] call bis_fnc_spawnvehicle; _postarg = [(_bpos select 0),(_bpos select 1),(_bpos select 2)+ 200]; _wp1 = _c130Grp addWaypoint [_postarg, 0]; _wp2 = _c130Grp addWaypoint [_pos1, 0]; [_c130Grp, 2] setWaypointType "CYCLE"; _c130Grp setBehaviour "CARELESS"; _c130Grp setSpeedMode "LIMITED"; _ontarget=0; _c130time=0; if ((date select 3) < 4 or (date select 3) > 20) then { vehicle ( _c130Grp select 0) action ["lightOn",vehicle (_c130Grp select 0)]; };
If I change it to suit the group name i get lots of errors that i dont know how to solveCode:for [{_loop=0}, {_loop<1}, {_loop=_loop}] do { if (_c130 distance _wp1 < 50) then {ontarget=1;_Loop=1;}; if (!alive (driver _c130) OR _c130time > 600 OR !canmove _c130) then {ontarget=2;_Loop=1;}; _c130time=_c130time+1;
Could someone help me with what I need to name my aircraft in the loop?Code:for [{_loop=0}, {_loop<1}, {_loop=_loop}] do { if (_c130Grp distance _wp1 < 50) then {ontarget=1;_Loop=1;}; if (!alive (driver _c130Grp) OR _c130time > 600 OR !canmove _c130Grp) then {ontarget=2;_Loop=1;}; _c130time=_c130time+1;
HOME 

Reply With Quote