Think it's a nested array anyway, still new to them.
Essentially, what I'm doing is storing some information to an array associated to a variable. I can get the information to store perfectly, but I'm having issues on trying to retrieve it.
I'm storing the data like this
[["DataType1"],["DataType2","DataType2","DataType2"]]
I want to keep them separated like this because DataType1 will only ever have one entry, whereas DataType2 will have multiple player UIDs stored to it.
I'm just not sure how to check for a value within the arrays though. I tried doing something like this
Though that doesn't ever work, and I've read that you can't use 'in' with nested arrays, so I'm not sure if it's because of that or if it's because I'm simply not telling it to read the array correctly.
I've read through the tutorials on arrays via CommanderRetra's post several times now and I swear I'm just hitting my head off the keyboard at this point. I know it's clearly doable, I just don't know how.
I also know my array is storing the data correctly because I can see the data in there, also it worked when it was just a singular array like [DataType2,DataType2] I could check the UIDs fine against that, it's just this nested thing that's going awry.
I'd really appreciate any advice, thanks.
Essentially, what I'm doing is storing some information to an array associated to a variable. I can get the information to store perfectly, but I'm having issues on trying to retrieve it.
I'm storing the data like this
[["DataType1"],["DataType2","DataType2","DataType2"]]
I want to keep them separated like this because DataType1 will only ever have one entry, whereas DataType2 will have multiple player UIDs stored to it.
I'm just not sure how to check for a value within the arrays though. I tried doing something like this
Code:
_realdata = cursorTarget getVariable ["NameofArrayVariable", [], true];
_useabledata = _realdata select 1;
_canUse = ((getPlayerUID player) in _useabledata);
Though that doesn't ever work, and I've read that you can't use 'in' with nested arrays, so I'm not sure if it's because of that or if it's because I'm simply not telling it to read the array correctly.
I've read through the tutorials on arrays via CommanderRetra's post several times now and I swear I'm just hitting my head off the keyboard at this point. I know it's clearly doable, I just don't know how.
I also know my array is storing the data correctly because I can see the data in there, also it worked when it was just a singular array like [DataType2,DataType2] I could check the UIDs fine against that, it's just this nested thing that's going awry.
I'd really appreciate any advice, thanks.