Well, without detailed analysis, I'd say I see a couple of problems right off.
First, you never defined weapon_name, so you can't access it like an array element with something like weapon_name[e]. You need a global definition somewhere like:
Second, I'm not sure on this one, but I don't think you can call a function like giveback without parens. Maybe that should be giveback()
Other than that, I'd have to try in a real project and see what else I could dig up.
System Specs: OS - Windows 7 Home Premium 64-bit SP1, CPU - AMD Phenom II X4 945, 3.0Ghz, RAM - 8Gb DDR3, GFX Card - 2048MB NVIDIA GeForce GT 640, FPSC-R Version - Beta 1.0085