vallfield 10 Posted August 18, 2017 Hi, I wanna delete a group and an heli when a trigger activates, this is my code: for [{_i=1},{_i < 5},{_i = _i + 1}] do {_unit = units helig select _i; deleteVehicle _unit;} ; deleteVehicle heli1; It says: error zero divisor. Share this post Link to post Share on other sites
Grumpy Old Man 3540 Posted August 18, 2017 10 minutes ago, vallfield said: Hi, I wanna delete a group and an heli when a trigger activates, this is my code: for [{_i=1},{_i < 5},{_i = _i + 1}] do {_unit = units helig select _i; deleteVehicle _unit;} ; deleteVehicle heli1; It says: error zero divisor. How did you come up with this? {deletevehicle _x} foreach (units helig + [heli1]); Cheers Share this post Link to post Share on other sites
pierremgi 4737 Posted August 18, 2017 {deleteVehicle _x} forEach units helig; deleteVehicle heli1; deleteGroup group heli1; Share this post Link to post Share on other sites
Grumpy Old Man 3540 Posted August 18, 2017 3 minutes ago, pierremgi said: {deleteVehicle _x} forEach crew heli1; deleteVehicle heli1; deleteGroup group heli1; Deleting the entire crew will make the heli empty. A vehicle with no crew in it belongs to grpNull. In your example the last line will do nothing. Cheers Share this post Link to post Share on other sites
vallfield 10 Posted August 18, 2017 7 minutes ago, Grumpy Old Man said: How did you come up with this? {deletevehicle _x} foreach (units helig + [heli1]); Cheers Thx! Share this post Link to post Share on other sites
pierremgi 4737 Posted August 18, 2017 20 minutes ago, Grumpy Old Man said: Deleting the entire crew will make the heli empty. A vehicle with no crew in it belongs to grpNull. In your example the last line will do nothing. Cheers Yep right! Share this post Link to post Share on other sites