Jump to content
Rook Mk1

check if item is in container

Recommended Posts

Is it possible to check if an item is in a container?

 

e.g.

if (hgun_P07_F in _box) then

 

I've tried a few different things but none seem to work.

Share this post


Link to post
Share on other sites
10 minutes ago, JokerRetry said:

Not tested but should work with:


if("hgun_P07_F" in (items _box)then{
//CODE
};

 

I tried

if ("hgun_P07_F" in (items _box)) then
                        {hint "true" }
                        else {hint "false"};

 

always returns false.

Share this post


Link to post
Share on other sites
2 minutes ago, JokerRetry said:

okay, checking for weapons seems to be able with "weaponCargo".

if ("hgun_P07_F" in (WeaponCargo ammobox)) then

 

Success! Thanks!

  • 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

×