zombiesurvival-evolved/gamemodes/zombiesurvival/entities/weapons/weapon_zs_arsenalcrate/shared.lua

66 lines
1.5 KiB
Lua
Raw Normal View History

SWEP.PrintName = "Arsenal Crate"
SWEP.Description = "This crate is invaluable to survival. It allows people to purchase new weapons, tools, ammunition, etc.\nThe deployer gets a 5% commission on purchases not made by themselves.\nPress PRIMARY ATTACK to deploy the crate.\nPress SECONDARY ATTACK and RELOAD to rotate the crate."
2014-10-02 08:49:54 +08:00
SWEP.ViewModel = "models/weapons/v_pistol.mdl"
SWEP.WorldModel = Model("models/Items/item_item_crate.mdl")
SWEP.AmmoIfHas = true
SWEP.Primary.ClipSize = 1
SWEP.Primary.DefaultClip = 1
SWEP.Primary.Ammo = "airboatgun"
SWEP.Primary.Delay = 1
SWEP.Primary.Automatic = true
SWEP.Secondary.ClipSize = 1
SWEP.Secondary.DefaultClip = 1
SWEP.Secondary.Ammo = "dummy"
SWEP.MaxStock = 5
2014-10-02 08:49:54 +08:00
SWEP.WalkSpeed = SPEED_NORMAL
SWEP.FullWalkSpeed = SPEED_SLOWEST
SWEP.NoDeploySpeedChange = true
2014-10-02 08:49:54 +08:00
function SWEP:Initialize()
self:SetWeaponHoldType("slam")
self:SetDeploySpeed(10)
2014-10-02 08:49:54 +08:00
self:HideViewAndWorldModel()
end
function SWEP:SetReplicatedAmmo(count)
self:SetDTInt(0, count)
end
function SWEP:GetReplicatedAmmo()
return self:GetDTInt(0)
end
function SWEP:GetWalkSpeed()
if self:GetPrimaryAmmoCount() > 0 then
return self.FullWalkSpeed
end
end
function SWEP:SecondaryAttack()
end
function SWEP:Reload()
end
function SWEP:CanPrimaryAttack()
if self:GetOwner():IsHolding() or self:GetOwner():GetBarricadeGhosting() then return false end
2014-10-02 08:49:54 +08:00
if self:GetPrimaryAmmoCount() <= 0 then
self:SetNextPrimaryFire(CurTime() + self.Primary.Delay)
return false
end
return true
end
function SWEP:Holster()
return true
end