CopsNRobbers/gamemodes/copsnrobbers/entities/weapons/cnr/sh_animate.lua

21 lines
569 B
Lua

function SWEP:SendAnim( anim )
if !self:GetOwner():IsValid() then return 0 end
local vm = self:GetOwner():GetViewModel()
if !vm:IsValid() then return 0 end
if !self.Animations then return 0 end
local AnimData = self.Animations[anim]
if !AnimData then return 0 end
vm:SendViewModelMatchingSequence( vm:LookupSequence(AnimData.Source) )
if AnimData.Delay_Reload then
self:SetDelayReload( CurTime() + AnimData.Delay_Reload )
end
if AnimData.Delay_Refill then
self:SetRefillTime( CurTime() + AnimData.Delay_Refill )
end
return vm:SequenceDuration()
end