Code:
function Create(self)
end
function Update(self)
   if ToMagazine(self.Magazine) == nil then
      self:GibThis()
   end
end
My guess is that the AI auto-reloads it, so it doesn't reach 0 ammo. Instead, you should check if the magazine still exists, and if it doesn't it gibs.
I'm not sure if the code will work though, I tend to have problems with magazines.