Check if item is in anyone's inventory - Printable Version +- Comrades in Arms Discussion Board (http://forum.ciahome.net) +-- Forum: Comrades in Arms Life (http://forum.ciahome.net/forumdisplay.php?fid=3) +--- Forum: Mission Making (http://forum.ciahome.net/forumdisplay.php?fid=8) +--- Thread: Check if item is in anyone's inventory (/showthread.php?tid=2932) |
Check if item is in anyone's inventory - Fuiba - 03-15-2015 Hiya, I'm trying to make a following objective: the team must retrieve an intel item from a building and I cannot seem to find a way to check if the item is in someone's inventory. I have been doing a lot of SELECT * FROM INTERNET; but haven't found a working solution. I've found this Code: intel_item1 in items player (where intel_item1 is the object's given name) but that obviously don't work in MP and that would mean only the group leader holding the item counts. I've also tried this with my mad scripting skills Code: (({_x == "CUP_item_Cobalt_File"} count itemCargo november1) + (where novemberN are the playable/switchable units) and that works to some extend. It registers if anyone in the group picks up the item but stops working if even one member dies before the item is taken. I'm not sure if Code: !alive intel_item1 Re: Check if item is in anyone's inventory - Alwarren - 03-15-2015 You might try the following as condition: Code: {alive _x && "CUP_item_Cobalt_File" in items _x} count [november1, november2, november3, november4, november5, november6, november7, november8, november9, november10] > 0 Re: Check if item is in anyone's inventory - Fuiba - 03-15-2015 (03-15-2015, 04:39 PM)Alwarren link Wrote:You might try the following as condition: Thank you very much, works like a charm! |