Jump to content
Sign in to follow this  
chondo999

How to add items to a backpack that is not on a player

Recommended Posts

I am making a mission where the player starts riding an atv with his backpack and weapon on the back (not in the cargo) of the atv. I know how to do everything else. I just get stuck adding the ammo and other items into the backpack. Please, help.

Share this post


Link to post
Share on other sites

Did you try additemtobackpack?

player addItemToBackpack "arifle_MXM_Hamr_pointer_F";

https://community.bistudio.com/wiki/addItemToBackpack

(Pasting the link may have changed the font & size of my reply... if so, sorry)

the backpack is not on the player. it is attached to the atv. using the attach to command and groundweaponholder command to spawn it.

Share this post


Link to post
Share on other sites

use everyContainer to retrieve the backpack in the weaponholder, then simply add stuff to the backpack.

 

Cheers

I don't really understand what the wiki is saying to do. Could you please give me an example?

Share this post


Link to post
Share on other sites

Do you mean something like this?

bp = createVehicle ["B_AssaultPack_blk" ,getpos this,[], 0, "none"] ;
bp addmagazineCargoGlobal ["100Rnd_65x39_caseless_mag_Tracer",6];
bp addmagazinecargoGlobal ["SmokeShellGreen", 1];
bp addItemCargoGlobal ["optic_ARCO", 10];
wh = objectParent bp;
wh attachto [car,[0,1,0]];
  • Like 1

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  

×