zombiesurvival-evolved/gamemodes/zombiesurvival/gamemode/obj_weapon_extend_sv.lua
William Moodhe e9da54c2f9 ZS updates for 2014-2018
Too many changes to list.
2018-05-01 18:32:59 -04:00

35 lines
901 B
Lua

local meta = FindMetaTable("Weapon")
function meta:EmptyAll(nodefaultclip)
if self.Primary and string.lower(self.Primary.Ammo or "") ~= "none" then
local owner = self:GetOwner()
if owner:IsValid() then
if self:Clip1() >= 1 then
owner:GiveAmmo(self:Clip1(), self.Primary.Ammo, true)
end
if not nodefaultclip then
owner:RemoveAmmo(self.Primary.DefaultClip, self.Primary.Ammo)
end
end
self:SetClip1(0)
end
if self.Secondary and string.lower(self.Secondary.Ammo or "") ~= "none" then
local owner = self:GetOwner()
if owner:IsValid() then
if self:Clip2() >= 1 then
owner:GiveAmmo(self:Clip2(), self.Secondary.Ammo, true)
end
if not nodefaultclip then
owner:RemoveAmmo(self.Secondary.DefaultClip, self.Secondary.Ammo)
end
end
self:SetClip2(0)
end
end
function meta:HideWorldModel()
self:DrawShadow(false)
end
function meta:HideViewModel()
end