Jump to content
Sign in to follow this  
Rellikplug

Zeus Loadout Module and Respawn Inventory

Recommended Posts

I have noticed the Loadout module does not allow you to clear the loadouts added.  You must always have at least one selected.  You can delete the module but this does not remove the loadout and continues to force  all respawned players to have the gear.

 

My intention is to be able to utilize the loadout module during a mission but be able to remove all loadouts when desired, during the mission.

 

In order to do this I've been working on a function that will gather all the inventory id per side and then delete them.  This works fine for all loadouts created by selecting any of the units from the list in the module but it does not work for loadouts added from the curator's profileNamespace.  The inventory id is prefixed with 'missionnamespace:'.

 

My question is; how do I go about removing the custom (profileNamespace) loadouts added to the loadout module?

 

Here's a copy of the function.

private ["_riAll","_riWEST","_riEAST","_riINDEPENDENT","_riCIVILIAN","_riMN"];

 // Set empty array to house all 
_riAll =  [];
 // get all WEST respawn inventories.  Return array.
_riWEST = [WEST, true] call BIS_fnc_getRespawnInventories;
 // get all EAST respawn inventories.  Return array.
_riEAST =  [EAST, true] call BIS_fnc_getRespawnInventories;
 // get all INDEPENDENT respawn inventories.  Return array.
_riINDEPENDENT = [INDEPENDENT, true] call BIS_fnc_getRespawnInventories;
 // get all CIVILIAN respawn inventories.  Return array.
_riCIVILIAN = [CIVILIAN,  true] call BIS_fnc_getRespawnInventories;
 // Add all respawnInventories to one array
_riALL = _riALL + _riWEST + _riEAST + _riINDEPENDENT + _riCIVILIAN;
//if (isNil "_riALL") exitWith {}; 
	if (count _riALL != 0) then {    // if main array is not empty
		if (count _riWEST != 0) then {     // if west array is not empty
			{ [WEST, _x] call BIS_fnc_removeRespawnInventory; } forEach _riALL;      // Remove all respawnInventories for WEST
		};
		if (count _riEAST != 0) then {
			{ [EAST, _x] call BIS_fnc_removeRespawnInventory; } forEach _riALL;
		};
		if (count _riINDEPENDENT != 0) then {
			{ [INDEPENDENT, _x] call BIS_fnc_removeRespawnInventory; } forEach _riALL;
		};
		if (count _riCIVILIAN != 0) then {
		{ [CIVILIAN, _x] call BIS_fnc_removeRespawnInventory; } forEach _riALL;
	};
	["General",["Notice","Respawn Inventory has been cleared."]] remoteExecCall ["BIS_fnc_showNotification", 0, false];
};

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  

×