Jump to content
Sign in to follow this  
braveblades

Adding items to backpack & vest

Recommended Posts

Hi, i've a problem with add some items to backpack (for SP mission). After remove backpack from unit, i can't add any item to it.

And have the same problem with vest :(

can u check what is wrong with code? thank you!

I call script loadout.sqf from unit init field: 0 = this execVM "loadout.sqf"

and the loadout.sqf file:

removeVest _this;

_this addVest "V_PlateCarrier1_PMC_blk";

_this addMagazines ["Chemlight_yellow", 1];

_this addMagazines ["RH_30Rnd_556x45_Mk262", 2];

_this addMagazines ["HandGrenade", 2];

_this addItem "FirstAidKit";

removebackpack _this;

_this addBackpack "B_AssaultPack_blk";

(unitbackpack _this) addmagazinecargoGlobal ["RH_30Rnd_556x45_Mk262", 7];

(unitbackpack _this) addmagazinecargoGlobal ["SmokeShellGreen", 1];

Share this post


Link to post
Share on other sites

0 = [this] execVM "loadout.sqf"


_unit = _this select 0;
[i]removeVest _unit;

_unit addVest "V_PlateCarrier1_PMC_blk";  

_unit addMagazines ["Chemlight_yellow", 1]; 
_unit addMagazines ["RH_30Rnd_556x45_Mk262", 2];
_unit addMagazines ["HandGrenade", 2];
_unit addItem "FirstAidKit"; 

removebackpack _unit;

_unit addBackpack "B_AssaultPack_blk";

(unitbackpack _unit) addmagazinecargoGlobal ["RH_30Rnd_556x45_Mk262", 7];
(unitbackpack _unit) addmagazinecargoGlobal ["SmokeShellGreen", 1];[/i]

Share this post


Link to post
Share on other sites

Thank you Iceman77! :) it's working now.

One additional question - is this any solution to add items strictly to vest, because in example above - Chem-light add to uniform - not to vest.

I found the solution - to first add vest and items, than uniform, but i think this is rather workaround...

Many thanks anyway!

Share this post


Link to post
Share on other sites

Great! :) ..as i good understand - for now i can use this commands (addItemToUniform, addItemToVest, addItemToBackPack) in stable branch, am i correct?

and short question - is this possible to add to vest something with array?

Edited by braveblades

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  

×