Track how much ammo is used and make the pistol unable to shoot when you run out of it, problem solved.