deleteGroupWhenEmpty: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\|x([0-9])= *<code>([^<]*)<\/code>" to "|x$1= <sqf>$2</sqf>")
m (Text replacement - "\{\{Note([^<]*)<code>([^<]*)<\/code>" to "{{Note$1<sqf>$2</sqf>")
Line 33: Line 33:
|text= It seems, that the argument has to be local (like for deleteGroup).
|text= It seems, that the argument has to be local (like for deleteGroup).
So if you run it on a server and the group isn't local to the server this wouldn't work:
So if you run it on a server and the group isn't local to the server this wouldn't work:
<code>_group deleteGroupWhenEmpty true;</code>
<sqf>_group deleteGroupWhenEmpty true;</sqf>
But this would work:
But this would work:
<code>if (local _group) then
<code>if (local _group) then

Revision as of 11:41, 13 May 2022

Hover & click on the images for description

Description

Description:
Marks given group for auto-deletion when group is empty. true will mark the group for auto-deletion, however false will only unmark the group that was marked previously. Other engine group auto-deletion mechanisms in place are not affected by this.
It might take up to a minute for the groups marked for auto-deletion when empty to get deleted when they become empty.
This command sets the group deletion flag, similar to the flag being set during group creation. True does not mean that the group will be deleted but that it was suggested to the engine that it should be deleted. It is up to the engine how it manages groups. False does not mean that the group will not be deleted at all. It has no influence on the engine functionality whatsoever.
Groups:
Groups

Syntax

Syntax:
group deleteGroupWhenEmpty delete
Parameters:
group: Group
delete: Boolean - true to mark for auto-deletion
Return Value:
Nothing

Examples

Example 1:
_group deleteGroupWhenEmpty true;

Additional Information

See also:
deleteGroup isGroupDeletedWhenEmpty createGroup group setGroupId groupID units groupFromNetId netId leader selectLeader join createCenter createUnit createVehicle Side

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
Wyqer - c
Posted on Feb 08, 2018 - 22:01 (UTC)
It seems, that the argument has to be local (like for deleteGroup). So if you run it on a server and the group isn't local to the server this wouldn't work:
_group deleteGroupWhenEmpty true;
But this would work: if (local _group) then { _group deleteGroupWhenEmpty true; } else { [_group, true] remoteExec ["deleteGroupWhenEmpty", groupOwner _group]; };