Jump to content
HBAOplus

Looking for a command similar to "linkItem"

Recommended Posts

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

this page says " If there is an item in the targeted slot, it gets replaced."

 

I want to find a similar command, so that when an item(called A1) was created,  If targeted slot is empyt, A1 will be put in the slot; If there is already an item (call A2) in the targeted slot, A2 will still be there, and A1 be stored in player's inventory.

 

Anyone can help?

Share this post


Link to post
Share on other sites

Just add a condition. Something like:


 

if ("ChemicalDetector_01_watch_F" in (assignedItems player + [goggles player] + [headgear player])) then {
  player addItem "SPE_US_ItemWatch"
} else {
  player linkItem "SPE_US_ItemWatch"
};

see also : canAdd

 

Note:

You can wait for next update (v 2.14), coming with:

alternative syntax for assignedItems [unit, alItems, includeBinocs]

and

getSlotItemName

 

depending on what you want exactly.

  • Like 1
  • Thanks 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

×