#Refill players' mags when shooting?

1 messages · Page 1 of 1 (latest)

elfin forum
#

I'm trying to recreate some Arma 3 scripts for some arcadey type games my friends and I like to play when there's not enough time to start another full mission at the end of the night. One of those games is one we call "laser tag" where two teams start in close proximity to each other armed with fast firing weapons (PDW in A3) loaded with tracers and the magazine never runs out of ammo.
For context, here is the relevant part of the script I'm trying to recreate from A3:
initPlayerLocal.sqf

_player = _this select 0;

_player addEventHandler ["FiredMan",
{
    params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_currentMagName", "_projectile", "_vehicle"];
    
    if(isNull _vehicle) then // If the player is *not* in a vehicle/static
    {
        _unit setAmmo [_weapon, 9999];
    }
    else // The player is in a vehicle/static
    {
        _vehicle setVehicleAmmo 1;
    };
}];

I can't figure out how to do this Reforger. The wiki says BaseMuzzleComponent should have an event called OnProjectileShot but I don't see it when I look at BaseMuzzleComponent nor BaseMagazineComponent.
Any help would be greatly appreciated.