You do either 1 of 2 things. Either you only attack with the weapon once, in which case you are being conservative with ammo, and still have ammo left. Or you can fire as much as you want, and at the end of the encounter you will be out of ammo until you can find more(which is basically a GM...