Mokey II 5 Posted April 21, 2018 Currently I'm trying to remove weapons that are equipped that are not in a white list defined by an array. after looking up on the wiki, I assumed it would work. Where is my issue? _whiteListedPrimary = _availableRifles + _availableSnipers + _availableLmgs + _availableSmgs; _primaryWeapons = (primaryWeapon player); { if !(primaryWeapon player in _whiteListedPrimary) Then { player removeWeapon (_x player); }; } forEach _primaryWeapons; Share this post Link to post Share on other sites
Grumpy Old Man 3545 Posted April 21, 2018 8 minutes ago, MokeyII (DayZ) said: Currently I'm trying to remove weapons that are equipped that are not in a white list defined by an array. after looking up on the wiki, I assumed it would work. Where is my issue? _whiteListedPrimary = _availableRifles + _availableSnipers + _availableLmgs + _availableSmgs; _primaryWeapons = (primaryWeapon player); { if !(primaryWeapon player in _whiteListedPrimary) Then { player removeWeapon (_x player); }; } forEach _primaryWeapons; Your if then statement makes no sense. You want to check all weapons, not only the primary weapon? primaryWeapon returns a string, not an array. Use weapons player instead: _whiteListedPrimary = _availableRifles + _availableSnipers + _availableLmgs + _availableSmgs; { if !(_x in _whiteListedPrimary) Then { player removeWeapon _x; }; } forEach weapons player; Cheers Share this post Link to post Share on other sites
Mokey II 5 Posted April 21, 2018 Working, it'd help if I didn't have the only weapon I had in a different array :) Share this post Link to post Share on other sites