Jump to content
Sign in to follow this  
vallfield

Im trying to delete a group. I need help please.

Recommended Posts

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
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

{deleteVehicle _x} forEach units helig;

deleteVehicle heli1;

deleteGroup group heli1;

Share this post


Link to post
Share on other sites
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
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

 

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×