i've tryed for ages now to add items to a dead body, for the swap kit script. I can't do it, it won't delete the items i took and neither will it add my items, it seems like the Body inventory is not being updated or touched, whatever..
I did try it with addMagazineCargoGlobal, but unless i made it wrong, that didn't work neither...
/*
Function Name: fnc_add_magazines
Function Description: Add Magazines or Weapons to Unit
Function Parameters: Unit, Weapons or Magazines to add, Type
Function Return: Nothing
*/
private["_unit","_magazineArray","_magslot","_type","_count"];
_unit = _this select 0;
_magazineArray = _this select 1;
_type = _this select 2;
if (_type == "magazine") then {
{_unit removeMagazine _x;} forEach magazines _unit;
{
_unit addMagazine _x;
} forEach _magazineArray;
};
if (_type == "weapon") then {
removeAllWeapons _unit;
{
_unit addWeapon _x;
} forEach _magazineArray;
};
player reveal _unit;
What is wrong with this script? It works fine, if i add the items to the player.. Then all items are removed and added correctly..
Question
Guest
Hi,
i've tryed for ages now to add items to a dead body, for the swap kit script. I can't do it, it won't delete the items i took and neither will it add my items, it seems like the Body inventory is not being updated or touched, whatever..
I did try it with addMagazineCargoGlobal, but unless i made it wrong, that didn't work neither...
What is wrong with this script? It works fine, if i add the items to the player.. Then all items are removed and added correctly..
Link to comment
Share on other sites
24 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now