mr_shadow 4 Posted October 29, 2013 (edited) Hello, does someone know whats wrong with it? bgate_1 addaction ["Open","open12.sqf",[],1,false,true,"","isro and player distance bgate_1 <= 0.55"]; if (!("itemandroid" in (items player)) ) then { isro = true; }; ---------- Post added at 23:24 ---------- Previous post was at 21:57 ---------- "Has weapon" can't help me because I'm trying to detect item. This one also is not working bgate_1 addaction ["open","open12.sqf",[],1,false,true,"","("itemandroid" in (items player)) and player distance bgate_1 <= 0.55"]; So does anyone know how can i check for item in inventory? Edited October 30, 2013 by mr_shadow Share this post Link to post Share on other sites
shuko 59 Posted October 29, 2013 isro distance bgate_1 <= 0.55 and player distance bgate_1 <= 0.55 Share this post Link to post Share on other sites
mr_shadow 4 Posted October 30, 2013 It was working without isro, are you sure that the problem is with distance? Share this post Link to post Share on other sites
cuel 25 Posted October 30, 2013 Isro will work if its a boolean, not if it's an object ---------- Post added at 11:07 AM ---------- Previous post was at 11:06 AM ---------- @OP code Share this post Link to post Share on other sites
shuko 59 Posted October 30, 2013 If you want to check if two units are within certain distance to a target, you need to check each distance separately. You can't just do "unit1 and unit2 distance...". isro distance bgate_1 <= 0.55 and player distance bgate_1 <= 0.55 Share this post Link to post Share on other sites
mr_shadow 4 Posted October 30, 2013 I want to check if player have item then addaction. Share this post Link to post Share on other sites
Kunsa 10 Posted October 30, 2013 I think isro is a boolean. maybe use some brackets just to be sure thats not the problem... (isro && ((player distance bgate_1) <= 0.55)) Share this post Link to post Share on other sites
mr_shadow 4 Posted October 30, 2013 (edited) Really is this part correct? if (!("itemandroid" in (items player)) ) then { isro = true; }; ---------- Post added at 14:48 ---------- Previous post was at 13:59 ---------- This one also is not working bgate_1 addaction ["open","open12.sqf",[],1,false,true,"","("itemandroid" in (items player)) and player distance bgate_1 <= 0.55"]; ---------- Post added at 16:36 ---------- Previous post was at 15:15 ---------- So does anyone know how can i check for item in inventory? Edited October 30, 2013 by mr_shadow Share this post Link to post Share on other sites
cuel 25 Posted October 30, 2013 (edited) Does this give you any hints? You're telling the engine BEGIN STRING - ( - END STRING - itemandroid BEGIN STRING ... etc Wrap "itemandroid" in normal quotes so it reads 'itemandroid' Edited October 30, 2013 by cuel Share this post Link to post Share on other sites