Arma 3
Loafus Jun 4, 2021 @ 1:39am
How to make sidearms have unlimited magazines
So i found this script that generates a single magazine of the same type you're using for your primary or secondary weapons everytime you reload as long as you have a backup mag in your inventory.

_this addEventHandler ["Reloaded",{
_unit = _this select 0 ;
_mag = _this select 4 select 0 ;
_unit addMagazine _mag ;
}] ;

However as the title says, i wanted the script above to only affect secondary weapons only. Is it even possible?
I'm new to scripting so any help would be appreciated :)
Last edited by Loafus; Jun 4, 2021 @ 2:34am
Originally posted by MATTXYO:
One possible way
this addEventHandler ["Reloaded",{ _unit = _this select 0 ; if (_this select 1 == handgunWeapon _unit)then { _magCount = { _x in getArray (configFile >> "CFGWeapons" >> (currentWeapon player) >> "magazines") }count (magazines player); if(_magCount < 3)then { _mag = _this select 4 select 0; _unit addMagazine _mag ; } }; }] ;
< >
Showing 1-4 of 4 comments
The author of this thread has indicated that this post answers the original topic.
MATTXYO Jun 4, 2021 @ 4:02pm 
One possible way
this addEventHandler ["Reloaded",{ _unit = _this select 0 ; if (_this select 1 == handgunWeapon _unit)then { _magCount = { _x in getArray (configFile >> "CFGWeapons" >> (currentWeapon player) >> "magazines") }count (magazines player); if(_magCount < 3)then { _mag = _this select 4 select 0; _unit addMagazine _mag ; } }; }] ;
Loafus Jun 4, 2021 @ 11:22pm 
Works like a charm, many thanks <3
Last edited by Loafus; Jun 4, 2021 @ 11:38pm
is this for copy paste, because i don't know how to use the console
MATTXYO Oct 31, 2022 @ 5:30pm 
Originally posted by ByBagan347:
is this for copy paste, because i don't know how to use the console
Yeah, just post it into a units init field.
< >
Showing 1-4 of 4 comments
Per page: 1530 50