The weapons and ammo are also stored in the level codes. Think of the code like a save game. If you loose your shotgun then you won't start with it! Weapon and ammo management is part of the gameplay. Perhaps go back a few codes to an earlier level to replay and try to gain/conserve some extra weapons and ammo (or start a new game from the title screen).