thetrooper 10 Posted April 4, 2014 hi all. I'm simply trying to have a condition if a player has either 1 or two of the weapons. Not sure what it should be. player hasweapon "arifle_MX_ACO_F" OR "srifle_EBR_SOS_F"; I'm stuck. Any ideas? Share this post Link to post Share on other sites
weparo 10 Posted April 4, 2014 try (player hasweapon "arifle_MX_ACO_F" OR player hasweapon "srifle_EBR_SOS_F") Share this post Link to post Share on other sites
cobra4v320 27 Posted April 4, 2014 Another method for any weapon: primaryWeapon player != "" Share this post Link to post Share on other sites
Larrow 2797 Posted April 5, 2014 Even more options.... ({player hasWeapon _x}count ["arifle_MX_ACO_F", "srifle_EBR_SOS_F"] > 0); (primaryWeapon player) in ["arifle_MX_ACO_F", "srifle_EBR_SOS_F"] Share this post Link to post Share on other sites
katipo66 94 Posted February 20, 2016 Ive tried all of the above in a trigger condition with no luck, ive also tried "Weapon_srifle_GM6_F" in weapons player but nothing seems to work, ive tried a few others from other threads but get the feeling it maybe broken, im on 1.56 stable. Is there anything else i can try in a trigger condition to detect if player has a specific weapon? Share this post Link to post Share on other sites
Greenfist 1863 Posted February 20, 2016 Ive tried all of the above in a trigger condition with no luck, ive also tried "Weapon_srifle_GM6_F" in weapons player but nothing seems to work, ive tried a few others from other threads but get the feeling it maybe broken, im on 1.56 stable. Is there anything else i can try in a trigger condition to detect if player has a specific weapon? Wrong class. Try: "srifle_GM6_F" in weapons player Share this post Link to post Share on other sites
katipo66 94 Posted February 21, 2016 Wrong class. Try: "srifle_GM6_F" in weapons player Jeesuz! thanks Greenfist, that was driving me nuts... i got that from the config viewer, even tried other weapons but i guess they arent the actual classnames Share this post Link to post Share on other sites
Greenfist 1863 Posted February 21, 2016 Jeesuz! thanks Greenfist, that was driving me nuts... i got that from the config viewer, even tried other weapons but i guess they arent the actual classnames The "Weapon_srifle_GM6_F" is the object name from CfgVehicles, not the actual weapon from CfgWeapons. You could have just equipped it and typed "weapons player" in the console's watch field. ;) Share this post Link to post Share on other sites
katipo66 94 Posted February 21, 2016 The "Weapon_srifle_GM6_F" is the object name from CfgVehicles, not the actual weapon from CfgWeapons. You could have just equipped it and typed "weapons player" in the console's watch field. ;) Ahh nice, ive only just started using the console lol, thanks for the pro tip! Share this post Link to post Share on other sites
pedeathtrian 99 Posted February 21, 2016 If player has, for example, "srifle_GM6_LRPS_F" your check against "srifle_GM6_F" will fail. Better way is to use isKindOf to check whether some of (weapons player) has common ancestor class in its parents list: scopeName "yourScope"; private _hasGM6 = false; { private _weap = _x select 0; if (_weap isKindOf ["srifle_GM6_F", configFile >> "CfgWeapons"]) then { _hasGM6 = true; breakTo "yourScope"; }; } forEach (weapons player); Share this post Link to post Share on other sites
katipo66 94 Posted February 21, 2016 For this scenario i am placing the specific weapon down that the player is expected to pick up to complete task but thats a useful tip thanks. Share this post Link to post Share on other sites