Bugsy, the code is subtracting 1 from the Bpammo of the player even if it is not firing. I print the value of IBP, is showing the Bpammo that the player should have, but in the hud shows the current value subtracted by one. So when the player's Bpammo is at 0, I can shoot one more time.
Apart from that problem, the code is OK!
I did some tests and found that if you change the display value to -1, it will only show you the Bpammo.
Edit: If I get user button and check if is IN_ATTACK the code work, but still player can shoot more one time if bpammo are 0