Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- include( "ai_translations.lua" )
- include("sh_anim.lua")
- /*-----------------------------------------------------------
- Remake of Leeroy's first base.
- -----------------------------------------------------------*/
- if !ConVarExists("Lee_WeaponsSpeed") then
- CreateConVar("Lee_WeaponsSpeed", '1', FCVAR_NOTIFY)
- end
- if !ConVarExists("Lee_WeaponDamageMul") then
- CreateConVar("Lee_WeaponDamageMul", '1', FCVAR_NOTIFY)
- end
- if !ConVarExists("Lee_WeaponRecoilMul") then
- CreateConVar("Lee_WeaponRecoilMul", '1.4', FCVAR_NOTIFY)
- end
- if !ConVarExists("Lee_WeaponEDT") then
- CreateConVar("Lee_WeaponEDT", '1', FCVAR_NOTIFY)
- end
- if !ConVarExists("Lee_WeaponEDC") then
- CreateConVar("Lee_WeaponEDC", '3', FCVAR_NOTIFY)
- end
- if !ConVarExists("Lee_WeaponViewKick") then
- CreateConVar("Lee_WeaponViewKick", '1', FCVAR_NOTIFY)
- end
- if !ConVarExists("Lee_WeaponInfiniteAmmo") then
- CreateConVar("Lee_WeaponInfiniteAmmo", '0', FCVAR_NOTIFY)
- end
- if !ConVarExists("Lee_WeaponShakeMul") then
- CreateConVar("Lee_WeaponShakeMul", '5', FCVAR_NOTIFY)
- end
- if !ConVarExists("Lee_WeaponHitEffect") then
- CreateConVar("Lee_WeaponHitEffect", '0', FCVAR_NOTIFY)
- end
- if !ConVarExists("Lee_AttachViewModelToView") then
- CreateConVar("Lee_AttachViewModelToView", '0', FCVAR_NOTIFY)
- end
- if !ConVarExists("Lee_WeaponAutoReload") then
- CreateConVar("Lee_WeaponAutoReload", '0', FCVAR_NOTIFY)
- end
- SWEP.ViewModelFlip = false
- SWEP.ViewModel = "models/weapons/v_pistol.mdl"
- SWEP.WorldModel = "models/weapons/w_357.mdl"
- SWEP.AnimPrefix = "python"
- SWEP.HoldType = "pistol"
- SWEP.Spawnable = false
- SWEP.AdminSpawnable = false
- SWEP.Primary.Sound = Sound( "Weapon_AK47.Single" )
- SWEP.Primary.Recoil = 1.5
- SWEP.Primary.Damage = 40
- SWEP.Primary.NumShots = 1
- SWEP.Primary.Cone = 0.02
- SWEP.Primary.Delay = 0.15
- SWEP.Primary.SmokeTrail = "smoke_trail"
- SWEP.Secondary.ClipSize = -1
- SWEP.Secondary.DefaultClip = -1
- SWEP.Secondary.Automatic = false
- SWEP.Secondary.Ammo = "none"
- SWEP.IronSightTime = 0.15
- SWEP.RunSetTime = 0.30
- SWEP.IronSightZoom = 1.35
- SWEP.SetHolsterTime = 0.35
- SWEP.TracerRate = 1
- SWEP.CanZoom = true
- SWEP.Running = false
- SWEP.Reloading = false
- SWEP.CanShellEject = true
- SWEP.ViewAnim = false
- SWEP.UseScope = false
- SWEP.EjectSmoke = true
- SWEP.MuzzleSmoke = true
- SWEP.NearWall = false
- SWEP.Silenced = false
- SWEP.UseSilencer = true
- SWEP.SilencerAnim = false
- SWEP.DryFireAnim = false
- SWEP.CanIdle = true
- SWEP.RecoverTime = 0.15
- SWEP.MinRecoil = 0
- SWEP.MaxRecoil = 1
- SWEP.MinSpread = 0
- SWEP.MaxSpread = 0.06
- SWEP.MuzzleEffect = "lee_muzzle_pistol"
- SWEP.MuzzleAttachment = "1"
- SWEP.EjectAttachment = "2"
- SWEP.EjectTime = 0.01
- SWEP.SmokeMuzzleAttachment = "1"
- SWEP.SmokeEjectAttachment = "2"
- SWEP.Burst = {} -- best burst evar 8D
- SWEP.Burst.Enable = false
- SWEP.Burst.NumShots = 3
- SWEP.Burst.NextShotDelay = 0.05
- SWEP.Burst.NextBurst = 1
- SWEP.SmokeMuzzleAttachment = "1"
- SWEP.SmokeEjectAttachment = "5"
- SWEP.HolsterPos = Vector (0.2425, 0, 2.1846)
- SWEP.HolstersAng = Vector (-68.267, 2.6728, 0)
- SWEP.NewOriginPos = Vector (2.9742, 0, 0.5123)
- SWEP.NewOriginAng = Vector (0, 0, 0)
- SWEP.PistolNearWallPos = Vector (-0.6027, -11.384, -6.2741)
- SWEP.PistolNearWallAng = Vector (67.6324, 4.9439, -3.6316)
- SWEP.NearWallPos = Vector (-1.0416, -11.4198, -2.2259)
- SWEP.NearWallAng = Vector (40.6435, -56.4456, -17.6906)
- SWEP.ShotgunNearWallPos = Vector (3.1884, -13.3188, -2.7605)
- SWEP.ShotgunNearWallAng = Vector (59.4118, 1.7834, 9.1462)
- /*---------------------------------------------------------
- Name: SWEP:Initialize( )
- Desc: Called when the weapon is first loaded
- ---------------------------------------------------------*/
- function SWEP:Initialize()
- if SERVER and IsValid(self.Owner) and self.Owner:IsNPC() then
- self:SetWeaponHoldType( self.HoldType )
- self:SetNPCMinBurst(1)
- self:SetNPCMaxBurst(3)
- self:SetNPCFireRate(1)
- self.Weapon:SetCurrentWeaponProficiency( WEAPON_PROFICIENCY_VERY_GOOD )
- end
- if self.WeaponType == "pistol" then
- self.CanZoom = false
- self.UseScope = false
- elseif self.WeaponType == "smg" then
- self.CanZoom = true
- self.UseScope = false
- elseif self.WeaponType == "rifle" then
- self.CanZoom = true
- self.UseScope = false
- elseif self.WeaponType == "shotgun" then
- self.CanZoom = true
- self.HoldType = "shotgun"
- self.UseScope = false
- elseif self.WeaponType == "sniper" then
- self.CanZoom = true
- self.UseScope = true
- elseif self.WeaponType == "winchester" then
- self.CanZoom = true
- self.UseScope = false
- elseif self.WeaponType == "aa12" then
- self.CanZoom = true
- self.UseScope = false
- end
- self:SetUpFiremode()
- self:SetupDataTables()
- self:ResetVar()
- end
- function SWEP:ResetVar()
- self.Weapon:SetDTBool(0, false)
- self:SetIronsights( false )
- self.Weapon:SetDTBool(2, false)
- self.Weapon:SetNWBool("DoReloadBlur", false)
- self.Weapon:SetDTFloat(0, 0)
- self.Reloading = false
- self.DontNearWall = false
- self.NearWall = false
- self.ShotGunReloading = false
- self.LastSilBool = false
- self.ActionDelay = CurTime()
- self.NextMod = CurTime()
- self.NextHolster = CurTime()
- self.ReloadTimer = CurTime()
- self.IronFiremode = nil
- self.SpreadModifyTime = nil
- self.RemoveClipDelay = nil
- self.SetClipDelay = nil
- self.ShellEjectTime = nil
- self.MuzzleTime = nil
- self.BurstTime = nil
- self.NextBurstShot = nil
- self.MuzzleSmokeTrailTime = nil
- self.EjectSmokeTrailTime = nil
- self.ViewModelCenterFix = nil
- self.AddSpreadTime = nil
- self.CurrentSpread = 0
- self.CurrentRecoil = 0
- self.BurstCounter = 0
- self.AddSpread = 0
- end
- function SWEP:SetupDataTables()
- self.Weapon:DTVar("Bool", 0, "Holstered")
- self.Weapon:DTVar("Bool", 1, "Ironsights")
- self.Weapon:DTVar("Bool", 2, "Lee_Scope")
- self.Weapon:DTVar("Float", 0, "CurrentSpread")
- end
- /*---------------------------------------------------------
- DoViewAnim
- ---------------------------------------------------------*/
- function SWEP:DoViewAnim(Time)
- if SERVER then
- umsg.Start( "SendViewAnim" )
- umsg.Float( Time )
- umsg.End( )
- end
- self.ViewAnimFinishTime = CurTime() + Time
- end
- /*---------------------------------------------------------
- GetTimeDivider
- ---------------------------------------------------------*/
- function SWEP:GetTimeDivider() -- make your weapon on cocaine
- if !self.Owner:GetNWBool("Extention_Adrenaline") then
- TimeDivider = (GetConVarNumber("Lee_WeaponsSpeed") or 1)
- elseif self.Owner:GetNWBool("Extention_Adrenaline") then
- TimeDivider = 1.5
- end
- return TimeDivider
- end
- function SWEP:SetUpFiremode() -- initialize the fire mode
- if self.Primary.Mode and self.Primary.Mode == "semi" then
- self.Primary.Automatic = false
- elseif self.Primary.Mode and self.Primary.Mode == "auto" then
- self.Primary.Automatic = true
- elseif self.Primary.Mode and self.Primary.Mode == "burst" then
- self.Primary.Automatic = false
- elseif !self.Primary.Mode then
- self.Primary.Automatic = false
- end
- end
- /*---------------------------------------------------------
- Name: SWEP:Precache( )
- Desc: Use this function to precache stuff
- ---------------------------------------------------------*/
- function SWEP:Precache()
- end
- /*---------------------------------------------------------
- Name: SWEP:PrimaryAttack( )
- Desc: +attack1 has been pressed
- ---------------------------------------------------------*/
- function SWEP:PrimaryAttack()
- local vm = self.Owner:GetViewModel()
- if self.ShotGunReloading then
- self.Weapon:SendWeaponAnim(ACT_SHOTGUN_RELOAD_FINISH)
- self.Weapon:SetNWBool("DoReloadBlur", false)
- self.AnimDuration = vm:SequenceDuration() / self:GetTimeDivider()
- vm:SetPlaybackRate ( self:GetTimeDivider() )
- self:DoViewAnim(self.AnimDuration)
- self.ShotGunReloading = false
- self.Reloading = false
- self.ActionDelay = CurTime() + self.AnimDuration
- self.ViewModelCenterFix = CurTime() + self.AnimDuration
- self.Weapon:SetNextPrimaryFire(CurTime() + self.AnimDuration)
- self.Weapon:SetNextSecondaryFire(CurTime() + self.AnimDuration)
- if self.Primary.Automatic != true then
- timer.Simple(self.PumpTime / self:GetTimeDivider(), function()
- if self.PumpPunch then
- self.Owner:ViewPunch(Angle(self.PumpPunch[1],self.PumpPunch[2],self.PumpPunch[3]))
- end
- end, self.Weapon)
- end
- if ( (game.SinglePlayer() && SERVER) || CLIENT ) then
- self.Weapon:SetNetworkedFloat( "CrossHairGap", CurTime() )
- end
- else
- if self.Owner:KeyDown(IN_USE) then
- local SetHolster = !self:GetHolster()
- self:SetHolster( SetHolster )
- end
- if ( !self:CanPrimaryAttack() ) then return end
- if !self.Owner:KeyDown(IN_USE) then
- if !self.Burst.Enable then
- self:AttackCode()
- else
- self.BurstCounter = self.Burst.NumShots
- self:AttackCode()
- self.BurstTime = CurTime() + (self.Primary.Delay * self.BurstCounter)
- self.NextBurstShot = CurTime() + self.Primary.Delay
- end
- end
- end
- end
- function SWEP:AttackCode()
- local vm = self.Owner:GetViewModel()
- if !self:GetSilencer() then
- self.Weapon:EmitSound( self.Primary.Sound )
- else
- self.Weapon:EmitSound( self.Primary.Silenced )
- end
- self:ShootBullet( self.Primary.Damage, self.Primary.NumShots, self.CurrentSpread, self.CurrentRecoil )
- self.Weapon:SetNextPrimaryFire( CurTime() + self.Primary.Delay)
- self.ActionDelay = CurTime() + self.Primary.Delay
- self:TakePrimaryAmmo( 1 )
- if ( self.Owner:IsNPC() ) then return end
- if ( (game.SinglePlayer() && SERVER) || CLIENT ) then
- self.AddSpread = self.AddSpread + 1
- self.RecoverSpreadTime = CurTime() + self.RecoverTime
- self.Weapon:SetNetworkedFloat( "LastShootTime", CurTime() )
- end
- end
- /*---------------------------------------------------------
- GetIronsights
- ---------------------------------------------------------*/
- function SWEP:GetIronsights()
- return self.Weapon:GetDTBool( 1 )
- end
- /*---------------------------------------------------------
- SetIronsights
- ---------------------------------------------------------*/
- function SWEP:SetIronsights( b )
- if self.Owner and self.Weapon then
- if (b) then
- if self.UseScope == true then
- self.ScopeTime = CurTime() + self.IronSightTime
- self.NextReload = CurTime() + self.IronSightTime
- end
- else
- /*
- if self:GetScope() then
- self:SetScope(false, self.Owner)
- end
- */
- end
- end
- if SERVER then
- if IsValid(self.Owner) then
- umsg.Start("CallIronTilt", self.Owner)
- umsg.Float(self.IronSightTime)
- umsg.End()
- end
- end
- self.LastIron = self:GetIronsights()
- self.Weapon:SetDTBool(1, b)
- end
- /*---------------------------------------------------------
- SetHolster
- ---------------------------------------------------------*/
- function SWEP:SetHolster( b )
- if self.NextHolster and self.NextHolster <= CurTime() then
- self.Weapon:SetDTBool(0, b)
- local Time = self.SetHolsterTime - 0.05
- self.NextHolster = CurTime() + Time
- self.Weapon:SetNextPrimaryFire(CurTime() + Time)
- end
- end
- function SWEP:GetHolster()
- return self.Weapon:GetDTBool( 0 )
- end
- /*---------------------------------------------------------
- SetFireMode
- ---------------------------------------------------------*/
- function SWEP:SetFireMode(mode, cansound, cantext)
- if !self.NextMod or self.NextMod > CurTime() or !IsFirstTimePredicted() or OneTime then return end
- local Text = ""
- OneTime = true
- self:SetIronsights(false)
- self:SetHolster( true )
- if mode == "semi" then
- self.Primary.Automatic = false
- self.Primary.Mode = "semi"
- self.Burst.Enable = false
- if cansound then
- self.Owner:EmitSound("firemode/firemode_semi.wav", 80)
- end
- Text = "Firemode switched to semi automatic."
- elseif mode == "auto" then
- self.Primary.Automatic = true
- self.Primary.Mode = "auto"
- self.Burst.Enable = false
- if cansound then
- self.Owner:EmitSound("firemode/firemode_auto.wav", 80)
- end
- Text = "Firemode switched to automatic."
- elseif mode == "burst" then
- self.Primary.Automatic = false
- self.Primary.Mode = "burst"
- self.Burst.Enable = true
- if cansound then
- self.Owner:EmitSound("firemode/firemode_burst.wav", 80)
- end
- Text = "Firemode switched to burst shots."
- end
- if IsValid(self.Owner) and IsValid(self.Weapon) and self.Owner:GetActiveWeapon() == self.Weapon and Text != "" and cantext then
- self.Owner:ChatPrint(Text)
- end
- self.NextMod = CurTime() + 0.5
- self.Weapon:SetNextSecondaryFire(CurTime() + 0.8)
- self.IronFiremode = CurTime() + self.IronSightTime
- OneTime = false
- return
- end
- SWEP.NextSecondaryAttack = 0
- /*---------------------------------------------------------
- SecondaryAttack
- ---------------------------------------------------------*/
- function SWEP:SecondaryAttack()
- if not IsFirstTimePredicted() then return end
- if self.Owner and !self.Owner:KeyDown(IN_USE) then
- if !self.IronSightsPos or self.Reloading or self.ShotGunReloading or self.NearWall then return end
- if self.NextSecondaryAttack > CurTime() then return end
- bIronsights = !self:GetIronsights()
- self:SetIronsights( bIronsights )
- self.NextSecondaryAttack = CurTime() + 0.3
- elseif self.Owner and self.Owner:KeyDown(IN_USE) then
- self:DoMode()
- end
- end
- function SWEP:DoMode()
- if !table.HasValue(self.AvailableFireMode, "burst") and table.HasValue(self.AvailableFireMode, "auto") and self.Primary.Mode == "semi" then
- self:SetFireMode("auto", true, true)
- elseif !table.HasValue(self.AvailableFireMode, "burst") and table.HasValue(self.AvailableFireMode, "semi") and self.Primary.Mode == "auto" then
- self:SetFireMode("semi", true, true)
- elseif table.HasValue(self.AvailableFireMode, "burst") and !table.HasValue(self.AvailableFireMode, "semi") and self.Primary.Mode == "auto" then
- self:SetFireMode("burst", true, true)
- elseif table.HasValue(self.AvailableFireMode, "auto") and !table.HasValue(self.AvailableFireMode, "semi") and self.Primary.Mode == "burst" then
- self:SetFireMode("auto", true, true)
- elseif table.HasValue(self.AvailableFireMode, "burst") and !table.HasValue(self.AvailableFireMode, "auto") and self.Primary.Mode == "semi" then
- self:SetFireMode("burst", true, true)
- elseif table.HasValue(self.AvailableFireMode, "semi") and !table.HasValue(self.AvailableFireMode, "auto") and self.Primary.Mode == "burst" then
- self:SetFireMode("semi", true, true)
- elseif table.HasValue(self.AvailableFireMode, "semi") and table.HasValue(self.AvailableFireMode, "auto") and table.HasValue(self.AvailableFireMode, "burst") and self.Primary.Mode == "semi" then
- self:SetFireMode("auto", true, true)
- elseif table.HasValue(self.AvailableFireMode, "semi") and table.HasValue(self.AvailableFireMode, "auto") and table.HasValue(self.AvailableFireMode, "burst") and self.Primary.Mode == "auto" then
- self:SetFireMode("burst", true, true)
- elseif table.HasValue(self.AvailableFireMode, "semi") and table.HasValue(self.AvailableFireMode, "auto") and table.HasValue(self.AvailableFireMode, "burst") and self.Primary.Mode == "burst" then
- self:SetFireMode("semi", true, true)
- end
- end
- /*---------------------------------------------------------
- Name: SWEP:CheckReload( )
- Desc: CheckReload
- ---------------------------------------------------------*/
- function SWEP:CheckReload()
- end
- /*---------------------------------------------------------
- Name: SWEP:Reload( )
- Desc: Reload is being pressed
- ---------------------------------------------------------*/
- function SWEP:Reload()
- if self.Owner:IsPlayer() then
- local vm = self.Owner:GetViewModel()
- if !self.Owner:KeyDown(IN_USE) then
- if self.WeaponType != "shotgun" and self.WeaponType != "winchester" then
- if self.ActionDelay and self.ActionDelay <= CurTime() and ( self.Weapon:Clip1() < self.Primary.ClipSize ) and self.Owner:GetAmmoCount(self.Primary.Ammo) > 0 then
- if self.Silenced and self.SilencerAnim then
- self:CustomReload(ACT_VM_RELOAD_SILENCED)
- else
- if self.ReloadTable["CanEmptyReload"] then
- if self.Weapon:Clip1() > 0 then
- self:CustomReload(ACT_VM_RELOAD)
- else
- self:CustomReload(ACT_VM_RELOAD)
- end
- else
- self:CustomReload(ACT_VM_RELOAD)
- end
- end
- end
- else
- if self.ActionDelay and self.ActionDelay <= CurTime() and (self.Weapon:Clip1() < self.Primary.ClipSize and self.Owner:GetAmmoCount(self.Primary.Ammo) > 0) then
- if self.Owner:KeyPressed(IN_RELOAD) and !self.ShotGunReloading then
- self.ViewModelCenterFix = nil
- self.ShotGunReloading = true
- vm:SetSequence("reload_start")
- self.Weapon:SendWeaponAnim(ACT_SHOTGUN_RELOAD_START)
- vm:SetPlaybackRate ( self:GetTimeDivider() )
- self.Weapon:SetNWBool("DoReloadBlur", true)
- self.AnimDuration = vm:SequenceDuration() / self:GetTimeDivider()
- self:DoViewAnim(self.AnimDuration)
- self.ActionDelay = CurTime() + self.AnimDuration
- self.ReloadTimer = CurTime() + self.AnimDuration
- self.Weapon:SetNextPrimaryFire(CurTime() + self.AnimDuration)
- self:SetIronsights(false)
- if ( (game.SinglePlayer() && SERVER) || CLIENT ) then
- self.Weapon:SetNetworkedFloat( "LastShootTime", CurTime() )
- end
- end
- end
- if self.ShotGunReloading and self.ReloadTimer < CurTime() and self.ActionDelay and self.ActionDelay <= CurTime() and self.Owner:KeyPressed(IN_RELOAD) then
- if (self.Weapon:Clip1() < self.Primary.ClipSize and self.Owner:GetAmmoCount(self.Primary.Ammo) > 0) then
- vm:SetPlaybackRate ( self:GetTimeDivider() )
- self.Weapon:SendWeaponAnim(ACT_VM_RELOAD)
- vm:SetPlaybackRate ( self:GetTimeDivider() )
- self.AnimDuration = vm:SequenceDuration() / self:GetTimeDivider()
- /* -- for killing floor
- self.StopShotgunAnim = CurTime() + self.AnimDuration
- */
- if self.AddShellPunch then
- self.Owner:ViewPunch(Angle(self.AddShellPunch[1],self.AddShellPunch[2],self.AddShellPunch[3]))
- end
- self:DoViewAnim(self.AnimDuration)
- self.Weapon:SetNetworkedInt( "reloadtimer", CurTime() + self.AnimDuration - 0.1)
- self.Owner:RemoveAmmo( 1, self.Primary.Ammo, false )
- self.Owner:SetAnimation (PLAYER_RELOAD)
- self.ActionDelay = CurTime() + self.AnimDuration
- self.Weapon:SetClip1( self.Weapon:Clip1() + 1 )
- self.Weapon:SetNextPrimaryFire(CurTime() + self.AnimDuration)
- self.Weapon:SetNextSecondaryFire(CurTime() + self.AnimDuration)
- if ( (game.SinglePlayer() && SERVER) || CLIENT ) then
- self.Weapon:SetNetworkedFloat( "LastShootTime", CurTime() )
- end
- end
- end
- end
- elseif self.Owner:KeyDown(IN_USE) and self.UseSilencer and self.WeaponType != "shotgun" then
- if !self.ActionDelay or self.ActionDelay > CurTime() then return end
- if !self.SilencerAnim then
- local SilBool = !self:GetSilencer()
- local SilencerDelay = 2
- self.SetSilencerTime = CurTime() + SilencerDelay / 2
- self.ActionDelay = CurTime() + SilencerDelay + 0.5
- if SERVER then
- self:SetIronsights(false)
- umsg.Start("ClSetSilencerTime", self.Owner)
- umsg.Float(SilencerDelay)
- umsg.Bool(SilBool)
- umsg.End()
- end
- timer.Simple(0.3, function()
- if SERVER then
- if SilBool then
- self.Weapon:EmitSound( "Weapon_USP.AttachSilencer" )
- else
- self.Weapon:EmitSound( "Weapon_USP.DetachSilencer" )
- end
- end
- end, self.Weapon)
- else
- if !self.Silenced then
- self.Weapon:SendWeaponAnim(ACT_VM_ATTACH_SILENCER)
- self.Silenced = true
- else
- self.Weapon:SendWeaponAnim(ACT_VM_DETACH_SILENCER)
- self.Silenced = false
- end
- umsg.Start("ClSendSilencer", self.Owner)
- umsg.Bool(self.Silenced)
- umsg.End()
- self:SetIronsights(false)
- self.AnimDuration = vm:SequenceDuration() / self:GetTimeDivider()
- vm:SetPlaybackRate(self:GetTimeDivider())
- self.ActionDelay = CurTime() + self.AnimDuration
- self.ViewModelCenterFix = CurTime() + self.AnimDuration
- self.Weapon:SetNextPrimaryFire(CurTime() + self.AnimDuration)
- self.Weapon:SetNextSecondaryFire(CurTime() + self.AnimDuration)
- end
- end
- else
- self.Weapon:DefaultReload( ACT_VM_RELOAD );
- end
- end
- function SWEP:GetSilencer()
- return self.Silenced
- end
- function SWEP:CustomReload(anim) -- i hate the DefaultReload
- if !anim then return end
- self.ViewModelCenterFix = nil
- local Vm = self.Owner:GetViewModel()
- self.Owner:SetAnimation (PLAYER_RELOAD)
- self.Weapon:SendWeaponAnim(anim or "")
- self.AnimDuration = Vm:SequenceDuration()
- self:SetIronsights(false)
- self.Reloading = true
- self.EmptyReload = false
- self.Weapon:SetNWBool("DoReloadBlur", true)
- Vm:SetPlaybackRate ( self:GetTimeDivider() )
- local ReloadSpeed = self.AnimDuration / self:GetTimeDivider()
- local SetClipvalue = math.Clamp( self.Owner:GetAmmoCount(self.Primary.Ammo), 0, self.Primary.ClipSize )
- if self.ReloadTable then
- local EmptyRemoveClipTime = self.ReloadTable["RemoveClip"].EmptyTime
- local EmptySetClipTime = self.ReloadTable["SetClip"].EmptyTime
- local RemoveClipTime = self.ReloadTable["RemoveClip"].Time
- local SetClipTime = self.ReloadTable["SetClip"].Time
- if self.ReloadTable["CanEmptyReload"] and self.Weapon:Clip1() <= 0 and EmptyRemoveClipTime and EmptySetClipTime and EmptyRemoveClipTime > 0 and EmptySetClipTime > 0 then
- self.RemoveClipDelay = CurTime() + (EmptyRemoveClipTime / self:GetTimeDivider())
- self.SetClipDelay = CurTime() + (EmptySetClipTime / self:GetTimeDivider())
- self.Weapon:SetNextSecondaryFire( CurTime() + ReloadSpeed )
- self.Weapon:SetNextPrimaryFire( CurTime() + ReloadSpeed )
- self:DoViewAnim(ReloadSpeed)
- self.ActionDelay = CurTime() + ReloadSpeed
- self.NextSecondaryAttack = CurTime() + ReloadSpeed
- self.FinishReloadTime = CurTime() + ReloadSpeed
- self.ReloadBlurTime = CurTime() + ReloadSpeed - 0.35
- else
- self.RemoveClipDelay = CurTime() + (RemoveClipTime / self:GetTimeDivider())
- self.SetClipDelay = CurTime() + (SetClipTime / self:GetTimeDivider())
- self.Weapon:SetNextSecondaryFire( CurTime() + ReloadSpeed )
- self.Weapon:SetNextPrimaryFire( CurTime() + ReloadSpeed )
- self:DoViewAnim(ReloadSpeed)
- self.ActionDelay = CurTime() + ReloadSpeed
- self.NextSecondaryAttack = CurTime() + ReloadSpeed
- self.FinishReloadTime = CurTime() + ReloadSpeed
- self.ReloadBlurTime = CurTime() + ReloadSpeed - 0.35
- end
- else
- timer.Simple( ReloadSpeed, function() --shitty reload
- self.Reloading = false
- self.Weapon:SetNWBool("DoReloadBlur", false)
- self.Weapon:SetNWBool("DoReloadViewAnim", false)
- self.Weapon:SetClip1( SetClipvalue )
- self.Owner:RemoveAmmo( SetClipvalue, self.Primary.Ammo, false )
- end, self.Weapon)
- end
- end
- function SWEP:ReloadEffect()
- if self.Reloading == false then return end
- if self.RemoveClipDelay and CurTime() >= self.RemoveClipDelay then
- self.RemoveClipDelay = nil
- local RemoveClipTime = self.ReloadTable["RemoveClip"].Time
- local HaveCylinder = self.ReloadTable["RemoveClip"].Cylinder
- if self.Weapon:Clip1() > 0 then
- if HaveCylinder == false then
- self.Weapon:SetClip1( 1 )
- else
- self.Weapon:SetClip1( 0 )
- end
- else
- self.Weapon:SetClip1( 0 )
- end
- if ( self.Owner:IsNPC() ) then return end
- if ( (game.SinglePlayer() && SERVER) || CLIENT ) then
- self.Weapon:SetNetworkedFloat( "CrossHairGap", CurTime() )
- end
- end
- if self.SetClipDelay and CurTime() >= self.SetClipDelay then
- self.SetClipDelay = nil
- local SetClipvalue = math.Clamp( self.Owner:GetAmmoCount(self.Primary.Ammo) , 0 , self.Primary.ClipSize )
- if self.Weapon:Clip1() < 1 then
- self.Weapon:SetClip1( SetClipvalue )
- else
- self.Weapon:SetClip1( SetClipvalue + 1 )
- end
- if GetConVarNumber("Lee_WeaponInfiniteAmmo") <= 0 then
- self.Owner:RemoveAmmo( SetClipvalue, self.Primary.Ammo, false )
- end
- if self.EmptyReload == true then
- self.EmptyReload = false
- end
- if ( self.Owner:IsNPC() ) then return end
- if ( (game.SinglePlayer() && SERVER) || CLIENT ) then
- self.Weapon:SetNetworkedFloat( "CrossHairGap", CurTime() )
- end
- end
- if self.ReloadBlurTime and self.ReloadBlurTime <= CurTime() then
- self.ReloadBlurTime = nil
- self.Weapon:SetNWBool("DoReloadBlur", false)
- end
- if self.FinishReloadTime and self.FinishReloadTime <= CurTime() then
- self.FinishReloadTime = nil
- self.Reloading = false
- if IsValid(self.Weapon) and IsValid(self.Owner) and self.Owner and self.Owner:Health() > 0 and self.Owner:KeyDown(IN_ATTACK2) and !self.Owner:KeyDown(IN_SPEED) then
- self:SetIronsights(true, true)
- end
- end
- end
- function SWEP:AltThink()
- end
- function SWEP:CalcWeaponVar()
- self.CurrentSpread = self.Primary.Cone
- self.CurrentRecoil = self.Primary.Recoil
- if self.Owner:IsPlayer() then
- local vel = self.Owner:GetVelocity()
- local vellen = vel:Length()
- if self.WeaponType != "shotgun" then
- if self.RecoverSpreadTime and self.RecoverSpreadTime < CurTime() and self.AddSpread > 0 then
- local Dist = self.AddSpread - 0
- self.AddSpread = self.AddSpread - FrameTime() * (Dist * 10)
- if self.AddSpread < 0 then
- self.AddSpread = 0
- end
- end
- if self.Owner:OnGround() and self.Owner:KeyDown(IN_DUCK) then
- self.CurrentSpread = self.CurrentSpread / 1.5
- self.CurrentRecoil = self.CurrentRecoil / 1.5
- self.AddSpread = self.AddSpread / 1.2
- end
- if !self.Owner:OnGround() then
- self.CurrentSpread = self.CurrentSpread * 2
- self.CurrentRecoil = self.CurrentRecoil * 2
- self.AddSpread = self.AddSpread * 1.5
- end
- if self:GetIronsights() then
- self.CurrentSpread = self.CurrentSpread / 1.5
- self.CurrentRecoil = self.CurrentRecoil / 1.5
- self.AddSpread = self.AddSpread / 1.2
- end
- self.CurrentSpread = self.CurrentSpread
- self.CurrentSpread = math.Clamp(self.CurrentSpread + (vellen / 16000), self.MinSpread, self.MaxSpread)
- self.CurrentRecoil = self.CurrentRecoil + (vellen / 1200)
- self.Weapon:SetDTFloat(0, self.CurrentSpread)
- end
- end
- end
- /*---------------------------------------------------------
- Name: SWEP:Think( )
- Desc: Called every frame
- ---------------------------------------------------------*/
- function SWEP:Think()
- if !self.Running and !self.Owner:KeyDown(IN_DUCK) and self.Owner:KeyDown(IN_SPEED) and self.Owner:GetVelocity():Length() > self.Owner:GetWalkSpeed() and !self:GetIronsights() and !self:GetHolster() and self.Owner:IsOnGround() then
- self.Running = true
- self:SetIronsights(false)
- elseif self.Running and (!self.Owner:KeyDown(IN_SPEED) or self.Owner:KeyDown(IN_DUCK)) then
- self.Running = false
- if !self.Reloading then
- self.Weapon:SetNextPrimaryFire( CurTime() + 0.15 )
- end
- elseif self.Running and self:GetIronsights() or self.Running and self.Owner:GetVelocity():Length() <= self.Owner:GetWalkSpeed() or self.Running and self.Owner:KeyDown(IN_SPEED) and !self.Owner:KeyDown(IN_FORWARD) and !self.Owner:KeyDown(IN_BACK) and !self.Owner:KeyDown(IN_MOVELEFT) and !self.Owner:KeyDown(IN_MOVERIGHT) or self.Running and !self.Owner:IsOnGround() or self.Running and self.Owner:KeyDown(IN_DUCK) then
- self.Running = false
- if !self.Reloading then
- self.Weapon:SetNextPrimaryFire( CurTime() + 0.15 )
- end
- end
- local Tr = self.Owner:GetEyeTrace()
- if Tr.Entity:IsValid() and Tr.Entity:IsNPC() or Tr.Entity:IsPlayer() then
- self.DontNearWall = true
- elseif Tr.Entity:IsValid() then
- self.DontNearWall = false
- end
- if Tr.Hit and Tr.HitPos:Distance(self.Owner:GetShootPos()) < 40 and !self.NearWall and self.SetSilencerTime == nil and !self.DontNearWall then
- self.NearWall = true
- self:SetIronsights(false)
- elseif Tr.HitPos:Distance(self.Owner:GetShootPos()) > 40 and self.NearWall or self.SetSilencerTime and self.SetSilencerTime >= CurTime() or self.NearWall and self.DontNearWall then
- self.NearWall = false
- self.Weapon:SetNextPrimaryFire(CurTime() + 0.15)
- self.Weapon:SetNextSecondaryFire(CurTime() + 0.15)
- if self.LastIron and !self.DontNearWall then
- self:SetIronsights(true)
- end
- end
- if self.IronFiremode and self.IronFiremode <= CurTime() then
- self.IronFiremode = nil
- self.Weapon:SetDTBool( 0, false )
- if self.LastIron then
- self:SetIronsights(true)
- end
- end
- if self.BurstTime and self.BurstTime > CurTime() then
- if self.NextBurstShot and self.NextBurstShot <= CurTime() and self:CanPrimaryAttack() and self.Owner and self.Owner:KeyDown(IN_ATTACK) then
- self.NextBurstShot = CurTime() + self.Primary.Delay
- self.BurstCounter = self.BurstCounter - 1
- self.Weapon:SetNextPrimaryFire(CurTime() + self.Burst.NextBurst)
- self:AttackCode()
- end
- end
- if self.MuzzleSmokeTrailTime and self.MuzzleSmokeTrailTime <= CurTime() then
- self.MuzzleSmokeTrailTime = nil
- self:MuzzleSmokeTrailEffect()
- end
- if self.EjectSmokeTrailTime and self.EjectSmokeTrailTime <= CurTime() then
- self.EjectSmokeTrailTime = nil
- self:EjectSmokeTrailEffect()
- end
- if self.Running or self:GetHolster() and !self:GetIronsights() or self.NearWall and !self:GetIronsights() then
- if self.WeaponType != "pistol" and !self.Owner:Crouching() then
- self:SetWeaponHoldType("passive")
- else
- self:SetWeaponHoldType("normal")
- end
- self.MeleeAttack = false
- self.MeleeAttackTime = nil
- else
- self:SetWeaponHoldType(self.HoldType)
- if self.WeaponType == "sniper" and self:GetIronsights() then
- self:SetWeaponHoldType("ar2")
- else
- self:SetWeaponHoldType(self.HoldType)
- end
- end
- if self.ViewModelCenterFix and self.ViewModelCenterFix <= CurTime() and self.CanIdle then
- self.ViewModelCenterFix = nil
- if self.WeaponType == "pistol" then
- if self.Weapon:Clip1() > 0 then
- if self.Silenced and self.SilencerAnim then
- self.Weapon:SendWeaponAnim(ACT_VM_IDLE_SILENCED)
- else
- self.Weapon:SendWeaponAnim(ACT_VM_IDLE)
- end
- elseif self.Weapon:Clip1() <= 0 and self.DryFireAnim then
- self.Weapon:SendWeaponAnim(ACT_VM_IDLE_EMPTY)
- end
- else
- if self.Silenced and self.SilencerAnim then
- self.Weapon:SendWeaponAnim(ACT_VM_IDLE_SILENCED)
- else
- self.Weapon:SendWeaponAnim(ACT_VM_IDLE)
- end
- end
- if self.Weapon:Clip1() > 0 then
- self.Owner:GetViewModel():SetPlaybackRate(0)
- end
- end
- self:AltThink()
- self:CalcWeaponVar()
- self:ReloadEffect()
- self:WeaponElements()
- end
- function SWEP:SetSilencer( b )
- self.Silenced = b
- if SERVER then
- if self.LastSilBool != b then
- self.LastSilBool = b
- umsg.Start("ClSendSilencer", self.Owner)
- umsg.Bool(b)
- umsg.End()
- end
- end
- end
- function SWEP:WeaponElements()
- if self.SetSilencerTime and self.SetSilencerTime <= CurTime() then
- self.SetSilencerTime = nil
- local SilBool = !self:GetSilencer()
- if SERVER then
- self:SetSilencer(SilBool)
- end
- self:ResetVar() -- make the weapon stop doing shit
- if GetConVarNumber("Lee_NewPlayerView") >= 1 then
- self.Weapon:SetNextPrimaryFire(CurTime() + 2)
- else
- self.Weapon:SetNextPrimaryFire(CurTime() + 1.5)
- end
- elseif self.SetSilencerTime and self.SetSilencerTime > CurTime() then
- self:SetIronsights(false)
- self.Weapon:SetNextPrimaryFire(CurTime() + 0.5)
- end
- if self.SetLaserPointerTime and self.SetLaserPointerTime <= CurTime() then
- self.SetLaserPointerTime = nil
- self:SetHolster( false )
- local SilBool = !self.Weapon:GetNetworkedBool( "havelaserpointer" )
- self:SetNWBool( "havelaserpointer", SilBool )
- self:ResetVar() -- make the weapon stop doing shit
- self.Weapon:SetNextPrimaryFire(CurTime() + 0.5)
- if self.LastIron then
- self:SetIronsights(true)
- end
- elseif self.SetLaserPointerTime and self.SetLaserPointerTime > CurTime() then
- self:SetHolster( true )
- self:SetIronsights(false)
- end
- end
- /*---------------------------------------------------------
- Name: SWEP:Holster( weapon_to_swap_to )
- Desc: Weapon wants to holster
- RetV: Return true to allow the weapon to holster
- ---------------------------------------------------------*/
- function SWEP:Holster( wep )
- self:ResetVar()
- return true
- end
- /*---------------------------------------------------------
- Deploy
- ---------------------------------------------------------*/
- function SWEP:Deploy()
- local vm = self.Owner:GetViewModel()
- self:ResetVar()
- if !self.Silenced then
- if self.Weapon:Clip1() <= 0 then
- self.Weapon:SendWeaponAnim(ACT_VM_DRAW_EMPTY)
- else
- self.Weapon:SendWeaponAnim(ACT_VM_DRAW)
- end
- elseif self.Silenced and self.SilencerAnim then
- self.Weapon:SendWeaponAnim(ACT_VM_DRAW_SILENCED)
- end
- vm:SetPlaybackRate ( self:GetTimeDivider() )
- self.AnimDuration = vm:SequenceDuration() / self:GetTimeDivider()
- self.Weapon:SetNextPrimaryFire(CurTime() + self.AnimDuration)
- self.Weapon:SetNextSecondaryFire(CurTime() + self.AnimDuration)
- self:DoViewAnim(self.AnimDuration)
- self.ActionDelay = CurTime() + self.AnimDuration
- if (SERVER) or (CLIENT) then
- self.Owner:EmitSound(Sound("player/deploysound.wav"))
- end
- return true
- end
- /*---------------------------------------------------------
- Name: SWEP:ShootBullet( )
- Desc: A convenience function to shoot bullets
- ---------------------------------------------------------*/
- function SWEP:ShootEffects()
- local vm = self.Owner:GetViewModel()
- local ShellEjectTime = self.EjectTime or 0.05
- if self.Weapon:Clip1() == 1 and self.DryFireAnim then
- if self.Silenced and self.SilencerAnim then
- self.Weapon:SendWeaponAnim( ACT_VM_DRYFIRE_SILENCED )
- else
- self.Weapon:SendWeaponAnim( ACT_VM_DRYFIRE )
- end
- self.ViewModelCenterFix = nil
- else
- if self.Silenced and self.SilencerAnim then
- if self.Weapon:GetClass() == "weapon_css_usp" then
- self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK_SILENCED )
- vm:SetSequence("shoot1")
- else
- self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK_SILENCED )
- end
- else
- self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK )
- end
- self.AnimDuration = vm:SequenceDuration()
- self.ViewModelCenterFix = CurTime() + self.AnimDuration
- end
- if self:GetIronsights() then
- self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK_SILENCED )
- end
- self.Owner:SetAnimation( PLAYER_ATTACK1 )
- self.ShellEjectTime = CurTime() + ShellEjectTime
- self.MuzzleTime = CurTime()
- if !self.Owner then return end
- if !IsFirstTimePredicted() then return end
- if self.ShellEject != nil and self.CanShellEject then
- if CLIENT then
- if GetViewEntity() == self.Owner then
- if SERVER then
- umsg.Start("CallShellEject", self.Owner)
- umsg.End()
- end
- end
- else
- if self.Owner:GetViewEntity() == self.Owner then
- if SERVER then
- umsg.Start("CallShellEject", self.Owner)
- umsg.End()
- end
- end
- end
- end
- if self.MuzzleEffect != nil then
- if ( self.Owner:IsNPC() ) then return end
- if self.Weapon then
- if CLIENT then
- if GetViewEntity() == self.Owner then
- if not self.Owner then return end
- if not IsFirstTimePredicted() then return end
- if SERVER then
- umsg.Start("CallMuzzleEffect", self.Owner)
- umsg.End()
- end
- end
- else
- if self.Owner:GetViewEntity() == self.Owner then
- if not self.Owner then return end
- if not IsFirstTimePredicted() then return end
- if SERVER then
- umsg.Start("CallMuzzleEffect", self.Owner)
- umsg.End()
- end
- end
- end
- end
- end
- if ( self.Owner:IsNPC() ) then return end
- if SERVER then
- umsg.Start("CallSmokeTrailEffect", self.Owner)
- umsg.Float(0)
- umsg.String(self.SmokeMuzzleAttachment)
- umsg.End()
- umsg.Start("CallSmokeTrailEffect", self.Owner)
- umsg.Float(self.EjectDelay or 0.1)
- umsg.String(self.SmokeEjectAttachment)
- umsg.End()
- end
- end
- /*---------------------------------------------------------
- Name: SWEP:ShootBullet( )
- Desc: A convenience function to shoot bullets
- ---------------------------------------------------------*/
- function SWEP:ShootBullet( damage, num_bullets, aimcone, recoil )
- local bullet = {}
- bullet.Num = num_bullets
- bullet.Src = self.Owner:GetShootPos()
- bullet.Dir = ( self.Owner:EyeAngles() + self.Owner:GetPunchAngle() ):Forward()
- bullet.Spread = Vector( aimcone, aimcone, 0 )
- bullet.Tracer = self.TracerRate
- bullet.Force = 1
- bullet.Damage = damage
- bullet.AmmoType = "Pistol"
- self.Owner:FireBullets( bullet )
- self:ShootEffects()
- if ( self.Owner:IsNPC() ) then return end
- self:CustomRecoil(recoil)
- end
- function SWEP:CustomRecoil(recoil)
- recoil = recoil * GetConVarNumber("Lee_WeaponRecoilMul")
- local SideRecoil = recoil / 1.5
- local anglo = Angle(-recoil, math.Rand(-SideRecoil,SideRecoil), 0)
- if self:GetIronsights() and self.WeaponType != "pistol" and self.WeaponType != "shotgun" then
- anglo = Angle(math.Rand(recoil * -1, 0), math.Rand(SideRecoil * -1,SideRecoil), 0)
- end
- local angle = self.Owner:EyeAngles() + anglo
- self.Owner:ViewPunchReset( 10 )
- self.Owner:ViewPunch(anglo)
- self.Owner:SetEyeAngles(angle + self.Owner:GetPunchAngle())
- end
- /*---------------------------------------------------------
- Name: SWEP:TakePrimaryAmmo( )
- Desc: A convenience function to remove ammo
- ---------------------------------------------------------*/
- function SWEP:TakePrimaryAmmo( num )
- // Doesn't use clips
- if ( self.Weapon:Clip1() <= 0 ) then
- if ( self:Ammo1() <= 0 ) then return end
- self.Owner:RemoveAmmo( num, self.Weapon:GetPrimaryAmmoType() )
- return end
- self.Weapon:SetClip1( self.Weapon:Clip1() - num )
- end
- /*---------------------------------------------------------
- Name: SWEP:TakeSecondaryAmmo( )
- Desc: A convenience function to remove ammo
- ---------------------------------------------------------*/
- function SWEP:TakeSecondaryAmmo( num )
- // Doesn't use clips
- if ( self.Weapon:Clip2() <= 0 ) then
- if ( self:Ammo2() <= 0 ) then return end
- self.Owner:RemoveAmmo( num, self.Weapon:GetSecondaryAmmoType() )
- return end
- self.Weapon:SetClip2( self.Weapon:Clip2() - num )
- end
- /*---------------------------------------------------------
- CanPrimaryAttack
- ---------------------------------------------------------*/
- function SWEP:CanPrimaryAttack()
- if self.Owner:IsPlayer() then
- if ( self.Weapon:Clip1() <= 0 ) and self.Primary.ClipSize > -1 and !self.Owner:IsNPC() then
- self.Weapon:SetNextPrimaryFire(CurTime() + (self.Primary.Delay * 2))
- local EmptySound = self.EmptySound or "weapons/clipempty_rifle.wav"
- self.Weapon:EmitSound(EmptySound)
- self.BurstTime = nil
- if GetConVarNumber("Lee_WeaponAutoReload") >= 1 then
- self:Reload()
- end
- return false
- end
- if self.Owner:WaterLevel() > 2 then
- self.Weapon:SetNextPrimaryFire(CurTime() + 0.5)
- self.Weapon:EmitSound("weapons/pistol/pistol_empty.wav")
- return false
- end
- if (self:GetHolster() and !self:GetIronsights()) or self.NearWall or (self.Running and !self:GetIronsights()) then
- self.Weapon:SetNextPrimaryFire(CurTime() + 0.1)
- return false
- end
- return true
- elseif self.Owner:IsNPC() then
- if ( self.Weapon:Clip1() <= 0 ) then
- self:EmitSound( "Weapon_Pistol.Empty" )
- self:SetNextPrimaryFire( CurTime() + 0.2 )
- self:Reload()
- return false
- end
- return true
- end
- end
- /*---------------------------------------------------------
- Name: SWEP:CanSecondaryAttack( )
- Desc: Helper function for checking for no ammo
- ---------------------------------------------------------*/
- function SWEP:CanSecondaryAttack()
- if ( self.Weapon:Clip2() <= 0 ) then
- self.Weapon:EmitSound( "Weapon_Pistol.Empty" )
- self.Weapon:SetNextSecondaryFire( CurTime() + 0.2 )
- return false
- end
- return true
- end
- /*---------------------------------------------------------
- Name: ContextScreenClick( aimvec, mousecode, pressed, ply )
- ---------------------------------------------------------*/
- function SWEP:ContextScreenClick( aimvec, mousecode, pressed, ply )
- end
- /*---------------------------------------------------------
- Name: OnRemove
- Desc: Called just before entity is deleted
- ---------------------------------------------------------*/
- function SWEP:OnRemove()
- self:ResetVar()
- end
- function SWEP:OnRestore()
- self:ResetVar()
- end
- /*---------------------------------------------------------
- Name: OwnerChanged
- Desc: When weapon is dropped or picked up by a new player
- ---------------------------------------------------------*/
- function SWEP:OwnerChanged()
- self:ResetVar()
- end
- /*---------------------------------------------------------
- Name: Ammo1
- Desc: Returns how much of ammo1 the player has
- ---------------------------------------------------------*/
- function SWEP:Ammo1()
- return self.Owner:GetAmmoCount( self.Weapon:GetPrimaryAmmoType() )
- end
- /*---------------------------------------------------------
- Name: Ammo2
- Desc: Returns how much of ammo2 the player has
- ---------------------------------------------------------*/
- function SWEP:Ammo2()
- return self.Owner:GetAmmoCount( self.Weapon:GetSecondaryAmmoType() )
- end
- /*---------------------------------------------------------
- Name: SetDeploySpeed
- Desc: Sets the weapon deploy speed.
- This value needs to match on client and server.
- ---------------------------------------------------------*/
- function SWEP:SetDeploySpeed( speed )
- self.m_WeaponDeploySpeed = tonumber( speed )
- end
- /*---------------------------------------------------------
- Name: DoImpactEffect
- Desc: Callback so the weapon can override the impact effects it makes
- return true to not do the default thing - which is to call UTIL_ImpactTrace in c++
- ---------------------------------------------------------*/
- function SWEP:DoImpactEffect( tr, nDamageType )
- return false;
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement