This code still relies partly on the original zombie fortress code (which is a bit archaic). If a weapon isn't specifically added along with data into the include files then the code won't recognize it and will throw those errors.
As for the first error I have no idea because you didn't provide the necessary line above it.
__________________
YouTuber, Modder, Accountant, and somehow I still enjoy programming after all that.