A reload event that fires just before a unit has actually started the reload process, so calling
unit setAmmo [currentWeapon unit, 10];
would set the ammo count on the old magazine and not the new magazine.
A reload event that fires just before a unit has actually started the reload process, so calling
unit setAmmo [currentWeapon unit, 10];
would set the ammo count on the old magazine and not the new magazine.
Parameters could be:
0:Object - unit that is reloading
1:String - Weapon that is being reloaded.
2:String - Muzzle of the weapon being reloaded.
3:String - Magazine class being removed from the weapon
4:String - Magazine class being reloaded into the weapon
5:Number - Ammo in magazine being removed from the weapon
6:Number - Ammo in magazine being reloaded into the weapon
To set the ammo in the old magazine to 10 on reload.
player addEventHandler ["Reload",{(_this select 0) setAmmo [(_this select 1), 10];}];
3:String - Magazine class being removed from the weapon
4:String - Magazine class being reloaded into the weapon
5:Number - Ammo in magazine being removed from the weapon
6:Number - Ammo in magazine being reloaded into the weapon
7:Object - Container into which the magazine being removed from the weapon is going to be transferred (objNull if mag is null or empty)
8:Object - Container from which the magazine being reloaded into the weapon originates
I'd actually prefer if it fired after reload is complete. Or maybe have the animation (or animation time) passed.
I see a reloaded eventhandler has been introduced that occurs after reloading has happened. Which I believe essentially solves this.