Undeceived 392 Posted June 19, 2014 Hi guys. :) I have this condition here, which is fulfilled, when the player has a weapon: ({getNumber (configFile/"CfgWeapons"/_x/"type") in [1,2,4,5]} count weapons player != 0 ) Unfortunately this will also be fulfilled if a weapon is in the player's backpack... This is what I want to prevent. So, how can I change this condition, so that it only fires, when the player has a weapon in his main weapon slots (namely: in his hands)? Hidden weapons in a backpack should be allowed. Thanks a lot for your time and help! Share this post Link to post Share on other sites
John Kozak 14 Posted June 19, 2014 primaryWeapon and secondaryWeapon command should help you Share this post Link to post Share on other sites
Grumpy Old Man 3549 Posted June 19, 2014 You could use currentWeapon or primaryWeapon/secondaryWeapon/handgunWeapon to perform the check. Cheers Share this post Link to post Share on other sites
Undeceived 392 Posted June 19, 2014 (edited) Good ideas, but when I use this code... ({getNumber (configFile/"CfgWeapons"/_x/"type") in [1,2,4,5]} count primaryWeapon player != 0 ) ...I get the error: count: Type String, expected Array EDIT: I'm sorry to bother you, guys. This condition I used is from Arma 2 times where items, binoculars and NVGoggles were considered as weapons by the engine (if I remember correctly). Your suggestions work perfectly. A trigger with the following condition will fire, if the player carries a weapon in his hands (rifle, launcher or sidearm): (primaryweapon player != "") OR (secondaryWeapon player != "") OR (handgunWeapon player != "") A trigger with the following condition will fire, if the player has no weapon in his hands (weapons in the backpack are allowed though): (primaryweapon player == "") AND (secondaryWeapon player == "") AND (handgunWeapon player == "") Edited June 19, 2014 by Undeceived Share this post Link to post Share on other sites
zapat 56 Posted June 19, 2014 (edited) ({getNumber (configFile/"CfgWeapons"/_x/"type") in [1,2,4,5]} count [primaryWeapon player, secondaryWeapon player, handgunWeapon player] != 0 ) although I don't get the first part. Why isn't {_x != ""} count [primaryWeapon player, secondaryWeapon player, handgunWeapon player] == 0 enough? Edited June 19, 2014 by zapat Share this post Link to post Share on other sites
Undeceived 392 Posted June 19, 2014 (edited) Thanks a lot, zapat. That one works too (see my edited previous post). I don't remember the author of that condition - can anyone tell me what exactly it checks? What are these 1,2,4,5 for? :) EDIT: I think it comes from Arma 2 times where items, binoculars and NVGoggles were still considered as weapons by the engine, but I'm not sure. Edited June 19, 2014 by Undeceived Share this post Link to post Share on other sites
TittErS 13 Posted June 19, 2014 Hi, For the trigger with the following condition will fire, if the player has no weapon in his hands (weapons in the backpack are allowed though): You can do : // Replace : (primaryweapon player == "") AND (secondaryWeapon player == "") AND (handgunWeapon player == "") // By : currentWeapon player == ""; Share this post Link to post Share on other sites
Undeceived 392 Posted June 19, 2014 (edited) As far as I can tell, that makes sense. :) EDIT: It doesn't work reliably though. If you have a rifle, a pistol and a launcher and then remove the rifle and pistol (or put them in the backpack), the player will stay with the launcher on his back, which means that he has NO current weapon. The result is that the trigger thinks that he's unarmed even though he has the launcher on him. This one from zapat (adjusted a little bit) works fine: ({getNumber (configFile/"CfgWeapons"/_x/"type") in [1,2,4,5]} count [primaryWeapon player, secondaryWeapon player, handgunWeapon player] == 0 ) Edited June 19, 2014 by Undeceived Share this post Link to post Share on other sites