I was preparing a "safe mode" script for the player's weapon. I mean (don't know the exact word in english) a button in your weapon used to turn the weapon in a "safe mode". When you turn "safe mode" ON, the weapon can't be fired unintentionally. In real life all weapons have this button, but ArmA it's not contempling it, and in some MP coop games it sucks when your teammate fires his weapon unintentionally and you lose the surprise element. So, my solution was:
1.-create one addaction attached to player, that gives it the possibility of turning on "safe mode". When you activate that action, I save in an array all player's magazines, then I remove all player's magazines and add them again. So, the result is that now you can't fire your weapon if you don't reload it.
2.-Now appears another addaction to turn "safe mode" off. Now I do the same process, but with player's weapons, so all weapons get reloaded instantly and you can fire again.
PROBLEM: All magazines are now at 100% of its capacity, even if you had only 1 bullet per magazine, now you have 30 bullets in every magazine.
If i could set the number of ammo in the loaded magazine, I could store how many bullets has every magazine shifting them in its weapon in the first action, and then set the number of magazines left in every magazine with the same process in the second action.
Well, if there is no way to set the number of bullets in the weapon, my scripts will never work properly because they can be used to get infite ammo, and as a quick reload way.
Wolfrug, I think I understand your idea. I could change the weapon's mag every time it is shot with an addeventhandler, and every 30 shots make the player to reload it with an addaction for example, but I was looking for something very very simple to attach to every cooperative mission and very simple to understand for players. This idea would be not very effective because the number of bullets depends on every weapon (m240 has 100, m24 has 10 etc). The system that I was creating was perfect and working for every weapon, from sniper rifles with 5 bullets per magazine to mguns with 200 even for mods' weapons. It was only 2 files and one line to put in the init file of the mission and it looked smart and simple. This idea would probably work, but would be more complicated for the players and worked only with certain weapons.
Thanks anyway, i'll try to think in a way to make it possible.