Why do you have param(8)?? It should be param(0) for the first parameter, param(1) for second parameter etc. 0 is the index of the parameter, not the number of bullets.
Also, I have no idea what's happening when you fire a bullet, this isn't in your screenshot. In theory you should check if ammo>0 and subtract 1 from ammo.