Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Bnae

[SOLVED] In items

Recommended Posts

Hello
 

_initems = items player;

_items = ["item1","item2","item3","item4","item5"];

 

How to check if any of _items in _initems..?

> True if any, false if non

 

-Bnae

 

Edit:

This will do it

_initems = items player;

_items = ["item1","item2","item3","item4","item5"];

_count = count [{_x in _initems} forEach _items];

if {_count > 0} then ...

If you have a better solution, please share it

Would like to return the item that was in the array..

Share this post


Link to post
Share on other sites

Hello

private _array = _items arrayIntersect items player;

 

  • Like 1

Share this post


Link to post
Share on other sites
4 minutes ago, Nikander said:

Hello


private _array = _items arrayIntersect items player;

 

 

Thanks, that's exactly what i was looking for without knowing it

  • Like 1

Share this post


Link to post
Share on other sites

×