Jump to content
Sign in to follow this  
custer1981

Delete a whole group script at end of waypoint

Recommended Posts

Hi

I´m trying to get a script that delete all units in a group at the end of a waypoint.

I have tryed to change a script that i found in this forum but with no luck, the script that i have looked at is from forum member SNKMAN

This is the script:

remove = [group this,X] execVM "Remove_Unit.sqf"; where X is the number of the unit want to remove. 

_group = _this select 0;
_number = _this select 1;

if (_number > count units _group) exitWith {};

_unit = units _group select (_number - 1);

deleteVehicle _unit;

I need a script like this but i need it to delete the whole squad instead of only one unit.

I have tryed "deleteGroup groupName" but that one does not work for me? :confused:

Thanks to every sugestion on how to do it as simple as possible.

Share this post


Link to post
Share on other sites

No need for a whole script, one line will do it.

{deleteVehicle _x} forEach units group this;

Share this post


Link to post
Share on other sites
No need for a whole script, one line will do it.

{deleteVehicle _x} forEach units group this;

Put what bhaz said in wp and when way point is complete al is deleted.

Share this post


Link to post
Share on other sites

i have been wondering... does the the variable HAD to be _x? or can I use any other variable, like _men, or _test or _watever?

Share this post


Link to post
Share on other sites
i have been wondering... does the the variable HAD to be _x? or can I use any other variable, like _men, or _test or _watever?

forEach uses _x to run the given code once for every entry.

Had it said:

{player sideChat _x} forEach ["one", "two", "three"];

You'd get three chat messages saying one, two and three.

Share this post


Link to post
Share on other sites
i have been wondering... does the the variable HAD to be _x? or can I use any other variable, like _men, or _test or _watever?

FYI: _x is a special variable so dont use it for anything else than its meant for in your scripts.

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  

×