[IK]Lega[Dev]

searching a players inventory for a random array of items

4 posts in this topic

Say I wanted to search a players inventory for a random array of items 

say

ThisNestedArrays = [
["ItemClassname",[1,1,1,2,2,3]],
["ItemClassname",[2,3,3,4,5]],
["ItemClassname",[2,4,5,6,7,7,3]]
];

I know i would use a foreach loop to check something like, 

{
    _ItemClassname = _x select 0;
    _ItemArray = _x Select 1;
        //this is the part I need help with 
        //Something like
        {
        if(_x in (magazines player))then{ //Maybe ? I want it to check for all the Items in the players inventory before carrying on. 

        }foreach _ItemArray;
}foreach ThisNestedArrays;

Any Help would be Great, Can provide a Github, link for people who want a look.

 

Edit, forgot to put, each number represents an Item, and the multiples are there for a reason, so if I needed to search for a multiple of the same Item. 

 

 

Edited by SpiRe
title edit

Share this post


Link to post
Share on other sites
Advertisement

Maybe I mis-red something? Why do you want to do this again?

Share this post


Link to post
Share on other sites

Maybe I mis-red something? Why do you want to do this again?

its for a crafting, and Multi Action Menu Im working on. this part is so Server owners can choose what vehicle they want people to be able to craft, and what it will cost, whether it will save to the db, and if it will cost poptabs 

 

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.