Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DEFINE_BASECLASS( SWEP.Base )
- -- First off the Metro Kalash 2012 code, for resetting the bodygroups while the mag is off-screen, BaseClass changed hasn't it, cause its causing the whole swep to seize up, I've tried my best but I cant get it to work, could you have a look? :3
- local vm
- local obg = -1
- local targ
- local LastReloadTime = -1
- local offscreentime = 1
- local offscreentime_empty = 1
- function SWEP:Deploy( ... )
- obg = -1
- return BaseClass.Deploy(self, ...)
- end
- function SWEP:Reload( ... )
- obg = -1
- LastReloadTime = CurTime()
- return BaseClass.Reload(self, ... )
- end
- function SWEP:Think2( ... )
- BaseClass.Think2(self, ... )
- if not IsValid(vm) then
- vm = self.OwnerViewModel
- return
- end
- if self:GetReloading() and CurTime() > LastReloadTime + ( self:Clip1() <= 0 and offscreentime or offscreentime_empty ) then
- targ = math.Clamp( 20 - math.ceil( ( self:Clip1() + self:Ammo1() ) / 2 ), 0, 20)
- else
- targ = math.Clamp( 20 - math.ceil( self:Clip1()/2 ), 0, 20)
- end
- self.Bodygroups_V[4] = targ
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement