Page MenuHomeFeedback Tracker

removePrimaryMagazines & removeHandgunMagazines
New, WishlistPublic

Description

At the moment we have removeAllWeapons which clears weapons and magazines from the units/players inventory.

It's more than likely a long shot, but it would be nice to have "removePrimaryMagazines" & "removeHandgunMagazines".

The idea of these commands are as follows.

init="removePrimaryMagazines this;" // <-- Will remove any magazine intended for a primary weapon, 6.5, 7.62 or 5.56.

init="removeHandgunMagazines this;" // <-- Will remove any magazine intended for a handgun or SMG weapon, 9mm, .45 and so on.

Both of these commands should clear out magazines regardless of whether the player has a primary weapon or not.

An example of this would be creating a trigger with

OnAct=removeWeapon "arifle_MXC_F"; removePrimaryMagazines this;

Details

Legacy ID
322695545
Severity
None
Resolution
Open
Reproducibility
N/A
Category
Scripting

Event Timeline

ColinM9991 edited Additional Information. (Show Details)
ColinM9991 set Category to Scripting.
ColinM9991 set Reproducibility to N/A.
ColinM9991 set Severity to None.
ColinM9991 set Resolution to Open.
ColinM9991 set Legacy ID to 322695545.May 7 2016, 6:56 PM
Lecks added a subscriber: Lecks.May 7 2016, 6:56 PM
Lecks added a comment.Jul 10 2014, 5:05 AM

Unfortunately there's at least 1 type of magazine that will fit in both a handgun and a SMG in vanilla Arma 3. I think that may make this impossible or unreliable.

There's probably a better way but you could try something like this:

{this removeMagazine _x;}forEach(getArray (configFile >> "CfgWeapons" >> (handgunWeapon this) >> "magazines"));

Right now I'm using array subtraction to detect the players magazines, subtract magazines from an array of illegal items; and re-add the rest of the items the unit had.

Lecks, I see what you mean; I'm sure there's a workaround though, I'll see what I can think of.