sproyd 2 Posted October 22, 2013 A bit embarrasing but I can't seem to figure out a basic script to determine if the player has a particular backpack and NVGs both on his person at any given time. I've set up this script _backpack = unitBackpack player; if (("B_TacticalPack_mcamo" == typeof _backpack)) then {gotpack=true}; and then have the variable gotpack as the condition for a trigger but I can't seem to get it to work. The player basically needs to go up to a box and pick up a backpack and NVGs (I haven't got to the NVG bit yet). I know this is probably kids play but I can't get it to work! Help from you awesome guys appreciated! Share this post Link to post Share on other sites
iceman77 18 Posted October 23, 2013 Hi, try this. Untested. if ((Player HasWeapon "NVGoggles") && (unitBackpack Player isKindof "B_TacticalPack_mcamo")) then {gotpack=true;}; 1 Share this post Link to post Share on other sites
sproyd 2 Posted October 23, 2013 Hi, try this. Untested. if ((Player HasWeapon "NVGoggles") && (unitBackpack Player isKindof "B_TacticalPack_mcamo")) then {gotpack=true;}; Well the backpack part of your script worked but not the NVGs part - I'm guessing HasWeapon doesn't apply to NVGs - could I use http://community.bistudio.com/wiki/items somehow? Share this post Link to post Share on other sites
iceman77 18 Posted October 23, 2013 Hmm.. that was some old code I pulled from an arma2 mission I had. I assumed it would work here too. You could try hasitem or something similar. Good luck. Share this post Link to post Share on other sites
Larrow 2801 Posted October 23, 2013 (edited) "NVGoggles" in (items player + assignedItems player) Will make sure he has a set either worn or in his cargo. Remember NVGoggles is blufor the others are followed by their side name NVGoggles_OPFOR / NVGoggles_INDEP Cover all {_x in (items player + assignedItems player)}count ["NVGoggles", "NVGoggles_OPFOR","NVGoggles_INDEP"] > 0 Edited October 23, 2013 by Larrow Share this post Link to post Share on other sites
sproyd 2 Posted October 24, 2013 Hmm.. that was some old code I pulled from an arma2 mission I had. I assumed it would work here too. You could try hasitem or something similar. Good luck. hasItem is not a scripting command unfortunately... ---------- Post added at 12:43 ---------- Previous post was at 12:42 ---------- "NVGoggles" in (items player + assignedItems player) Will make sure he has a set either worn or in his cargo. Remember NVGoggles is blufor the others are followed by their side name NVGoggles_OPFOR / NVGoggles_INDEP Cover all {_x in (items player + assignedItems player)}count ["NVGoggles", "NVGoggles_OPFOR","NVGoggles_INDEP"] > 0 Thanks mate that's just the kind of simple and effective code I was looking for. Will test it later tonight. I wasn't aware that the various factions had different classnames for their NVGs - what's the point in that? Unless they use different models/textures which I'm not sure they do unless that's a new addition. Share this post Link to post Share on other sites