From 44b8e7d14beaafff2a6b65bdb129cbc822f523b1 Mon Sep 17 00:00:00 2001 From: edshot99 Date: Thu, 19 Dec 2024 15:34:42 -0600 Subject: [PATCH] fatal m9k --- .../autorun/m9k_assault_rifles_11_07_15.lua | 12 +- .../lua/weapons/bobs_gun_base/shared.lua | 2639 ++++++++--------- .../lua/weapons/bobs_scoped_base/shared.lua | 88 +- .../lua/weapons/bobs_shotty_base/shared.lua | 44 +- .../lua/weapons/m9k_acr/shared.lua | 18 +- .../lua/weapons/m9k_ak47/shared.lua | 19 +- .../lua/weapons/m9k_ak74/shared.lua | 20 +- .../lua/weapons/m9k_amd65/shared.lua | 22 +- .../lua/weapons/m9k_an94/shared.lua | 105 +- .../lua/weapons/m9k_auga3/shared.lua | 20 +- .../lua/weapons/m9k_f2000/shared.lua | 20 +- .../lua/weapons/m9k_fal/shared.lua | 20 +- .../lua/weapons/m9k_famas/shared.lua | 20 +- .../lua/weapons/m9k_g36/shared.lua | 20 +- .../lua/weapons/m9k_g3a3/shared.lua | 20 +- .../lua/weapons/m9k_l85/shared.lua | 18 +- .../lua/weapons/m9k_m14sp/shared.lua | 24 +- .../lua/weapons/m9k_m16a4_acog/shared.lua | 24 +- .../lua/weapons/m9k_m416/shared.lua | 18 +- .../lua/weapons/m9k_m4a1/shared.lua | 22 +- .../lua/weapons/m9k_scar/shared.lua | 18 +- .../lua/weapons/m9k_tar21/shared.lua | 20 +- .../lua/weapons/m9k_val/shared.lua | 20 +- .../lua/weapons/m9k_vikhr/shared.lua | 18 +- .../lua/weapons/m9k_winchester73/shared.lua | 216 +- .../lua/autorun/m9k_heavy_weaps_11_07_15.lua | 4 +- .../lua/weapons/bobs_gun_base/shared.lua | 2639 ++++++++--------- .../lua/weapons/bobs_scoped_base/shared.lua | 88 +- .../lua/weapons/bobs_shotty_base/shared.lua | 44 +- .../lua/weapons/m9k_1887winchester/shared.lua | 198 +- .../lua/weapons/m9k_1897winchester/shared.lua | 190 +- .../lua/weapons/m9k_ares_shrike/shared.lua | 16 +- .../lua/weapons/m9k_aw50/shared.lua | 180 +- .../lua/weapons/m9k_barret_m82/shared.lua | 14 +- .../lua/weapons/m9k_browningauto5/shared.lua | 34 +- .../lua/weapons/m9k_contender/shared.lua | 468 +-- .../lua/weapons/m9k_dbarrel/shared.lua | 643 ++-- .../lua/weapons/m9k_dragunov/shared.lua | 12 +- .../lua/weapons/m9k_fg42/shared.lua | 24 +- .../lua/weapons/m9k_intervention/shared.lua | 178 +- .../lua/weapons/m9k_ithacam37/shared.lua | 178 +- .../lua/weapons/m9k_jackhammer/shared.lua | 210 +- .../lua/weapons/m9k_m1918bar/shared.lua | 20 +- .../lua/weapons/m9k_m24/shared.lua | 180 +- .../lua/weapons/m9k_m249lmg/shared.lua | 18 +- .../lua/weapons/m9k_m3/shared.lua | 177 +- .../lua/weapons/m9k_m60/shared.lua | 14 +- .../lua/weapons/m9k_m98b/shared.lua | 175 +- .../lua/weapons/m9k_minigun/shared.lua | 125 - .../lua/weapons/m9k_mossberg590/shared.lua | 177 +- .../lua/weapons/m9k_pkm/shared.lua | 18 +- .../lua/weapons/m9k_psg1/shared.lua | 12 +- .../lua/weapons/m9k_remington7615p/shared.lua | 180 +- .../lua/weapons/m9k_remington870/shared.lua | 180 +- .../lua/weapons/m9k_sl8/shared.lua | 18 +- .../lua/weapons/m9k_spas12/shared.lua | 34 +- .../lua/weapons/m9k_striker12/shared.lua | 204 +- .../lua/weapons/m9k_svt40/shared.lua | 12 +- .../lua/weapons/m9k_svu/shared.lua | 12 +- .../lua/weapons/m9k_usas/shared.lua | 354 ++- 60 files changed, 5267 insertions(+), 5248 deletions(-) diff --git a/m9k_assault_rifles_fatal_edition/lua/autorun/m9k_assault_rifles_11_07_15.lua b/m9k_assault_rifles_fatal_edition/lua/autorun/m9k_assault_rifles_11_07_15.lua index 0364cc7..8661512 100644 --- a/m9k_assault_rifles_fatal_edition/lua/autorun/m9k_assault_rifles_11_07_15.lua +++ b/m9k_assault_rifles_fatal_edition/lua/autorun/m9k_assault_rifles_11_07_15.lua @@ -62,7 +62,7 @@ if GetConVar("M9KWeaponStrip") == nil then end if GetConVar("M9KDisablePenetration") == nil then - CreateConVar("M9KDisablePenetration", "0", { FCVAR_REPLICATED, FCVAR_NOTIFY, FCVAR_ARCHIVE }, "Disable Penetration and Ricochets? 1 for true, 0 for false") + CreateConVar("M9KDisablePenetration", "1", { FCVAR_REPLICATED, FCVAR_NOTIFY, FCVAR_ARCHIVE }, "Disable Penetration and Ricochets? 1 for true, 0 for false") print("Penetration/ricochet con var created") end @@ -128,6 +128,10 @@ if !game.SinglePlayer() then if GetConVar("M9KGasEffect") == nil then CreateClientConVar("M9KGasEffect", "1", true, true) print("Client-side Gas Effect Con Var created") + end + if GetConVar("M9KVisualRecoil") == nil then + CreateClientConVar("M9KVisualRecoil", "1", true, true) + print("visual recoil con var created") end end @@ -1106,6 +1110,12 @@ sound.Add({ volume = 1.0, sound = "weapons/hk_g3/draw.mp3" }) +sound.Add({ + name = "cash", + channel = CHAN_USER_BASE+10, + volume = 1.0, + sound = "weapons/dmg_m4a1/cash.mp3" +}) m9knpw = {} table.insert(m9knpw, "m9k_davy_crockett_explo") diff --git a/m9k_assault_rifles_fatal_edition/lua/weapons/bobs_gun_base/shared.lua b/m9k_assault_rifles_fatal_edition/lua/weapons/bobs_gun_base/shared.lua index ab128bb..1a05aec 100644 --- a/m9k_assault_rifles_fatal_edition/lua/weapons/bobs_gun_base/shared.lua +++ b/m9k_assault_rifles_fatal_edition/lua/weapons/bobs_gun_base/shared.lua @@ -1,1359 +1,1280 @@ --- //Variables that are used on both client and server -SWEP.Category = "" -SWEP.Gun = "" -SWEP.Author = "Generic Default, Worshipper, Clavus, and Bob" -SWEP.Contact = "" -SWEP.Purpose = "" -SWEP.Instructions = "" -SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models -SWEP.DrawCrosshair = true -- Hell no, crosshairs r 4 nubz! -SWEP.ViewModelFOV = 65 -- How big the gun will look -SWEP.ViewModelFlip = true -- True for CSS models, False for HL2 models - -SWEP.Spawnable = false -SWEP.AdminSpawnable = false - -SWEP.Primary.Sound = Sound("") -- Sound of the gun -SWEP.Primary.Round = ("") -- What kind of bullet? -SWEP.Primary.Cone = 0.2 -- Accuracy of NPCs -SWEP.Primary.Recoil = 10 -SWEP.Primary.Damage = 10 -SWEP.Primary.Spread = .01 --define from-the-hip accuracy (1 is terrible, .0001 is exact) -SWEP.Primary.NumShots = 1 -SWEP.Primary.RPM = 0 -- This is in Rounds Per Minute -SWEP.Primary.ClipSize = 0 -- Size of a clip -SWEP.Primary.DefaultClip = 0 -- Default number of bullets in a clip -SWEP.Primary.KickUp = 0 -- Maximum up recoil (rise) -SWEP.Primary.KickDown = 0 -- Maximum down recoil (skeet) -SWEP.Primary.KickHorizontal = 0 -- Maximum side recoil (koolaid) -SWEP.Primary.Automatic = true -- Automatic/Semi Auto -SWEP.Primary.Ammo = "none" -- What kind of ammo - --- SWEP.Secondary.ClipSize = 0 -- Size of a clip --- SWEP.Secondary.DefaultClip = 0 -- Default number of bullets in a clip --- SWEP.Secondary.Automatic = false -- Automatic/Semi Auto -SWEP.Secondary.Ammo = "" ---//HAHA! GOTCHA, YA BASTARD! - --- SWEP.Secondary.IronFOV = 0 -- How much you 'zoom' in. Less is more! - -SWEP.Penetration = true -SWEP.Ricochet = true -SWEP.MaxRicochet = 1 -SWEP.RicochetCoin = 1 -SWEP.BoltAction = false -SWEP.Scoped = false -SWEP.ShellTime = .35 -SWEP.Tracer = 0 -SWEP.CanBeSilenced = false -SWEP.Silenced = false -SWEP.NextSilence = 0 -SWEP.SelectiveFire = false -SWEP.NextFireSelect = 0 -SWEP.OrigCrossHair = true - -local PainMulti = 1 - -if GetConVar("M9KDamageMultiplier") == nil then - PainMulti = 1 - print("M9KDamageMultiplier is missing! You may have hit the lua limit! Reverting multiplier to 1.") -else - PainMulti = GetConVar("M9KDamageMultiplier"):GetFloat() - if PainMulti < 0 then - PainMulti = PainMulti * -1 - print("Your damage multiplier was in the negatives. It has been reverted to a positive number. Your damage multiplier is now "..PainMulti) - end -end - -function NewM9KDamageMultiplier(cvar, previous, new) - print("multiplier has been changed ") - if GetConVar("M9KDamageMultiplier") == nil then - PainMulti = 1 - print("M9KDamageMultiplier is missing! You may have hit the lua limit! Reverting multiplier to 1, you will notice no changes.") - else - PainMulti = GetConVar("M9KDamageMultiplier"):GetFloat() - if PainMulti < 0 then - PainMulti = PainMulti * -1 - print("Your damage multiplier was in the negatives. It has been reverted to a positive number. Your damage multiplier is now "..PainMulti) - end - end -end -cvars.AddChangeCallback("M9KDamageMultiplier", NewM9KDamageMultiplier) - -function NewDefClips(cvar, previous, new) - print("Default clip multiplier has changed. A server restart will be required for these changes to take effect.") -end -cvars.AddChangeCallback("M9KDefaultClip", NewDefClips) - -if GetConVar("M9KDefaultClip") == nil then - print("M9KDefaultClip is missing! You may have hit the lua limit!") -else - if GetConVar("M9KDefaultClip"):GetInt() >= 0 then - print("M9K Weapons will now spawn with "..GetConVar("M9KDefaultClip"):GetFloat().." clips.") - else - print("Default clips will be not be modified") - end -end - -SWEP.IronSightsPos = Vector (2.4537, 1.0923, 0.2696) -SWEP.IronSightsAng = Vector (0.0186, -0.0547, 0) - -SWEP.VElements = {} -SWEP.WElements = {} - -function SWEP:Initialize() - self.Reloadaftershoot = 0 -- Can't reload when firing - self:SetHoldType(self.HoldType) - self.OrigCrossHair = self.DrawCrosshair - if SERVER and self.Owner:IsNPC() then - self:SetNPCMinBurst(3) - self:SetNPCMaxBurst(10) -- None of this really matters but you need it here anyway - self:SetNPCFireRate(1/(self.Primary.RPM/60)) - -- //self:SetCurrentWeaponProficiency( WEAPON_PROFICIENCY_VERY_GOOD ) - end - - if CLIENT then - - -- // Create a new table for every weapon instance - self.VElements = table.FullCopy( self.VElements ) - self.WElements = table.FullCopy( self.WElements ) - self.ViewModelBoneMods = table.FullCopy( self.ViewModelBoneMods ) - - self:CreateModels(self.VElements) -- create viewmodels - self:CreateModels(self.WElements) -- create worldmodels - - -- // init view model bone build function - if IsValid(self.Owner) and self.Owner:IsPlayer() then - if self.Owner:Alive() then - local vm = self.Owner:GetViewModel() - if IsValid(vm) then - self:ResetBonePositions(vm) - -- // Init viewmodel visibility - if (self.ShowViewModel == nil or self.ShowViewModel) then - vm:SetColor(Color(255,255,255,255)) - else - -- // however for some reason the view model resets to render mode 0 every frame so we just apply a debug material to prevent it from drawing - vm:SetMaterial("Debug/hsv") - end - end - - end - end - - end - - if CLIENT then - local oldpath = "vgui/hud/name" -- the path goes here - local newpath = string.gsub(oldpath, "name", self.Gun) - self.WepSelectIcon = surface.GetTextureID(newpath) - end - -end - -function SWEP:Equip() - self:SetHoldType(self.HoldType) -end - -function SWEP:Deploy() - self:SetIronsights(false, self.Owner) -- Set the ironsight false - self:SetHoldType(self.HoldType) - - if self.Silenced then - self.Weapon:SendWeaponAnim( ACT_VM_DRAW_SILENCED ) - else - self.Weapon:SendWeaponAnim( ACT_VM_DRAW ) - end - - self.Weapon:SetNWBool("Reloading", false) - - if !self.Owner:IsNPC() and self.Owner != nil then - if self.ResetSights and self.Owner:GetViewModel() != nil then - self.ResetSights = CurTime() + self.Owner:GetViewModel():SequenceDuration() - end - end - return true -end - -function SWEP:Holster() - - if CLIENT and IsValid(self.Owner) and not self.Owner:IsNPC() then - local vm = self.Owner:GetViewModel() - if IsValid(vm) then - self:ResetBonePositions(vm) - end - end - - return true -end - -function SWEP:OnRemove() - - if CLIENT and IsValid(self.Owner) and not self.Owner:IsNPC() then - local vm = self.Owner:GetViewModel() - if IsValid(vm) then - self:ResetBonePositions(vm) - end - end - -end - -function SWEP:GetCapabilities() - return CAP_WEAPON_RANGE_ATTACK1, CAP_INNATE_RANGE_ATTACK1 -end - -function SWEP:Precache() - util.PrecacheSound(self.Primary.Sound) - util.PrecacheModel(self.ViewModel) - util.PrecacheModel(self.WorldModel) -end - -function SWEP:PrimaryAttack() - OkaySoFar = true - if not IsValid(self) then - OkaySoFar = false - else if not IsValid(self.Weapon) then - OkaySoFar = false - else if not IsValid(self.Owner) then - OkaySoFar = false - end end end - - if not OkaySoFar then return end - - if self:CanPrimaryAttack() and self.Owner:IsPlayer() then - if !self.Owner:KeyDown(IN_SPEED) and !self.Owner:KeyDown(IN_RELOAD) then - self:ShootBulletInformation() - self.Weapon:TakePrimaryAmmo(1) - - if self.Silenced then - self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK_SILENCED ) - self.Weapon:EmitSound(self.Primary.SilencedSound) - else - self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK ) - self.Weapon:EmitSound(self.Primary.Sound) - end - - local fx = EffectData() - fx:SetEntity(self.Weapon) - fx:SetOrigin(self.Owner:GetShootPos()) - fx:SetNormal(self.Owner:GetAimVector()) - fx:SetAttachment(self.MuzzleAttachment) - if GetConVar("M9KGasEffect") != nil then - if GetConVar("M9KGasEffect"):GetBool() then - util.Effect("m9k_rg_muzzle_rifle",fx) - end - end - self.Owner:SetAnimation( PLAYER_ATTACK1 ) - self.Owner:MuzzleFlash() - self.Weapon:SetNextPrimaryFire(CurTime()+1/(self.Primary.RPM/60)) - self:CheckWeaponsAndAmmo() - self.RicochetCoin = (math.random(1,4)) - if self.BoltAction then self:BoltBack() end - end - elseif self:CanPrimaryAttack() and self.Owner:IsNPC() then - self:ShootBulletInformation() - self.Weapon:TakePrimaryAmmo(1) - self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK ) - self.Weapon:EmitSound(self.Primary.Sound) - self.Owner:SetAnimation( PLAYER_ATTACK1 ) - self.Owner:MuzzleFlash() - self.Weapon:SetNextPrimaryFire(CurTime()+1/(self.Primary.RPM/60)) - self.RicochetCoin = (math.random(1,4)) - end -end - -function SWEP:CheckWeaponsAndAmmo() - if SERVER and self.Weapon != nil and (GetConVar("M9KWeaponStrip"):GetBool()) then - if self.Weapon:Clip1() == 0 && self.Owner:GetAmmoCount( self.Weapon:GetPrimaryAmmoType() ) == 0 then - timer.Simple(.1, function() if SERVER then if not IsValid(self) then return end - if self.Owner == nil then return end - self.Owner:StripWeapon(self.Gun) - end end) - end - end -end - - -/*--------------------------------------------------------- - Name: SWEP:ShootBulletInformation() - Desc: This func add the damage, the recoil, the number of shots and the cone on the bullet. ------------------------------------------------------*/ -function SWEP:ShootBulletInformation() - - local CurrentDamage - local CurrentRecoil - local CurrentCone - local basedamage - - if (self:GetIronsights() == true) and self.Owner:KeyDown(IN_ATTACK2) then - CurrentCone = self.Primary.IronAccuracy - else - CurrentCone = self.Primary.Spread - end - local damagedice = math.Rand(.85,1.3) - - basedamage = PainMulti * self.Primary.Damage - CurrentDamage = basedamage * damagedice - CurrentRecoil = self.Primary.Recoil - - -- //Player is aiming - if (self:GetIronsights() == true) and self.Owner:KeyDown(IN_ATTACK2) then - self:ShootBullet(CurrentDamage, CurrentRecoil / 6, self.Primary.NumShots, CurrentCone) - -- //Player is not aiming - else - if IsValid(self) then - if IsValid(self.Weapon) then - if IsValid(self.Owner) then - self:ShootBullet(CurrentDamage, CurrentRecoil, self.Primary.NumShots, CurrentCone) - end - end - end - end - -end - -/*--------------------------------------------------------- - Name: SWEP:ShootBullet() - Desc: A convenience func to shoot bullets. ------------------------------------------------------*/ -local TracerName = "Tracer" - -function SWEP:ShootBullet(damage, recoil, num_bullets, aimcone) - - num_bullets = num_bullets or 1 - aimcone = aimcone or 0 - - self:ShootEffects() - - if self.Tracer == 1 then - TracerName = "Ar2Tracer" - elseif self.Tracer == 2 then - TracerName = "AirboatGunHeavyTracer" - else - TracerName = "Tracer" - end - - local bullet = {} - bullet.Num = num_bullets - bullet.Src = self.Owner:GetShootPos() -- Source - bullet.Dir = self.Owner:GetAimVector() -- Dir of bullet - bullet.Spread = Vector(aimcone, aimcone, 0) -- Aim Cone - bullet.Tracer = 3 -- Show a tracer on every x bullets - bullet.TracerName = TracerName - bullet.Force = damage * 0.25 -- Amount of force to give to phys objects - bullet.Damage = damage - bullet.Callback = function(attacker, tracedata, dmginfo) - return self:RicochetCallback(0, attacker, tracedata, dmginfo) - end - if IsValid(self) then - if IsValid(self.Weapon) then - if IsValid(self.Owner) then - self.Owner:FireBullets(bullet) - end - end - end - -- //if SERVER and !self.Owner:IsNPC() then - -- // local anglo = Angle(math.Rand(-self.Primary.KickDown,-self.Primary.KickUp), math.Rand(-self.Primary.KickHorizontal,self.Primary.KickHorizontal), 0) - -- // self.Owner:ViewPunch(anglo) - - -- // local eyes = self.Owner:EyeAngles() - -- // eyes.pitch = eyes.pitch + anglo.pitch - -- // eyes.yaw = eyes.yaw + anglo.yaw - -- // if game.SinglePlayer() then self.Owner:SetEyeAngles(eyes) end - -- //end - - local anglo1 = Angle(math.Rand(-self.Primary.KickDown,-self.Primary.KickUp), math.Rand(-self.Primary.KickHorizontal,self.Primary.KickHorizontal), 0) - self.Owner:ViewPunch(anglo1) - - if SERVER and game.SinglePlayer() and !self.Owner:IsNPC() then - local offlineeyes = self.Owner:EyeAngles() - offlineeyes.pitch = offlineeyes.pitch + anglo1.pitch - offlineeyes.yaw = offlineeyes.yaw + anglo1.yaw - if GetConVar("M9KDynamicRecoil"):GetBool() then - self.Owner:SetEyeAngles(offlineeyes) - end - end - - if CLIENT and !game.SinglePlayer() and !self.Owner:IsNPC() then - local anglo = Angle(math.Rand(-self.Primary.KickDown,-self.Primary.KickUp), math.Rand(-self.Primary.KickHorizontal,self.Primary.KickHorizontal), 0) - - local eyes = self.Owner:EyeAngles() - eyes.pitch = eyes.pitch + (anglo.pitch/3) - eyes.yaw = eyes.yaw + (anglo.yaw/3) - if GetConVar("M9KDynamicRecoil"):GetBool() then - self.Owner:SetEyeAngles(eyes) - end - end - -end - -/*--------------------------------------------------------- - Name: SWEP:RicochetCallback() ------------------------------------------------------*/ - -function SWEP:RicochetCallback(bouncenum, attacker, tr, dmginfo) - - if not IsFirstTimePredicted() then - return {damage = false, effects = false} - end - - local PenetrationChecker = false - - if GetConVar("M9KDisablePenetration") == nil then - PenetrationChecker = false - else - PenetrationChecker = GetConVar("M9KDisablePenetration"):GetBool() - end - - if PenetrationChecker then return {damage = true, effects = DoDefaultEffect} end - - bulletmiss = {} - bulletmiss[1]=Sound("weapons/fx/nearmiss/bulletLtoR03.wav") - bulletmiss[2]=Sound("weapons/fx/nearmiss/bulletLtoR04.wav") - bulletmiss[3]=Sound("weapons/fx/nearmiss/bulletLtoR06.wav") - bulletmiss[4]=Sound("weapons/fx/nearmiss/bulletLtoR07.wav") - bulletmiss[5]=Sound("weapons/fx/nearmiss/bulletLtoR09.wav") - bulletmiss[6]=Sound("weapons/fx/nearmiss/bulletLtoR10.wav") - bulletmiss[7]=Sound("weapons/fx/nearmiss/bulletLtoR13.wav") - bulletmiss[8]=Sound("weapons/fx/nearmiss/bulletLtoR14.wav") - - local DoDefaultEffect = true - if (tr.HitSky) then return end - - // -- Can we go through whatever we hit? - if (self.Penetration) and (self:BulletPenetrate(bouncenum, attacker, tr, dmginfo)) then - return {damage = true, effects = DoDefaultEffect} - end - - // -- Your screen will shake and you'll hear the savage hiss of an approaching bullet which passing if someone is shooting at you. - if (tr.MatType != MAT_METAL) then - if (SERVER) then - util.ScreenShake(tr.HitPos, 5, 0.1, 0.5, 64) - sound.Play(table.Random(bulletmiss), tr.HitPos, 75, math.random(75,150), 1) - end - - if self.Tracer == 0 or self.Tracer == 1 or self.Tracer == 2 then - local effectdata = EffectData() - effectdata:SetOrigin(tr.HitPos) - effectdata:SetNormal(tr.HitNormal) - effectdata:SetScale(20) - util.Effect("AR2Impact", effectdata) - elseif self.Tracer == 3 then - local effectdata = EffectData() - effectdata:SetOrigin(tr.HitPos) - effectdata:SetNormal(tr.HitNormal) - effectdata:SetScale(20) - util.Effect("StunstickImpact", effectdata) - end - - return - end - - if (self.Ricochet == false) then return {damage = true, effects = DoDefaultEffect} end - - if self.Primary.Ammo == "SniperPenetratedRound" then -- .50 Ammo - self.MaxRicochet = 12 - elseif self.Primary.Ammo == "pistol" then -- pistols - self.MaxRicochet = 2 - elseif self.Primary.Ammo == "357" then -- revolvers with big ass bullets - self.MaxRicochet = 4 - elseif self.Primary.Ammo == "smg1" then -- smgs - self.MaxRicochet = 5 - elseif self.Primary.Ammo == "ar2" then -- assault rifles - self.MaxRicochet = 8 - elseif self.Primary.Ammo == "buckshot" then -- shotguns - self.MaxRicochet = 1 - elseif self.Primary.Ammo == "slam" then -- secondary shotguns - self.MaxRicochet = 1 - elseif self.Primary.Ammo == "AirboatGun" then -- metal piercing shotgun pellet - self.MaxRicochet = 8 - end - - if (bouncenum > self.MaxRicochet) then return end - - // -- Bounce vector - local trace = {} - trace.start = tr.HitPos - trace.endpos = trace.start + (tr.HitNormal * 16384) - - local trace = util.TraceLine(trace) - - local DotProduct = tr.HitNormal:Dot(tr.Normal * -1) - - local ricochetbullet = {} - ricochetbullet.Num = 1 - ricochetbullet.Src = tr.HitPos + (tr.HitNormal * 5) - ricochetbullet.Dir = ((2 * tr.HitNormal * DotProduct) + tr.Normal) + (VectorRand() * 0.05) - ricochetbullet.Spread = Vector(0, 0, 0) - ricochetbullet.Tracer = 1 - ricochetbullet.TracerName = "m9k_effect_mad_ricochet_trace" - ricochetbullet.Force = dmginfo:GetDamage() * 0.15 - ricochetbullet.Damage = dmginfo:GetDamage() * 0.5 - ricochetbullet.Callback = function(a, b, c) - if (self.Ricochet) then - local impactnum - if tr.MatType == MAT_GLASS then impactnum = 0 else impactnum = 1 end - return self:RicochetCallback(bouncenum + impactnum, a, b, c) end - end - - timer.Simple(0, function() attacker:FireBullets(ricochetbullet) end) - - return {damage = true, effects = DoDefaultEffect} -end - - -/*--------------------------------------------------------- - Name: SWEP:BulletPenetrate() ------------------------------------------------------*/ -function SWEP:BulletPenetrate(bouncenum, attacker, tr, paininfo) - - local MaxPenetration - - if self.Primary.Ammo == "SniperPenetratedRound" then -- .50 Ammo - MaxPenetration = 20 - elseif self.Primary.Ammo == "pistol" then -- pistols - MaxPenetration = 9 - elseif self.Primary.Ammo == "357" then -- revolvers with big ass bullets - MaxPenetration = 12 - elseif self.Primary.Ammo == "smg1" then -- smgs - MaxPenetration = 14 - elseif self.Primary.Ammo == "ar2" then -- assault rifles - MaxPenetration = 16 - elseif self.Primary.Ammo == "buckshot" then -- shotguns - MaxPenetration = 5 - elseif self.Primary.Ammo == "slam" then -- secondary shotguns - MaxPenetration = 5 - elseif self.Primary.Ammo == "AirboatGun" then -- metal piercing shotgun pellet - MaxPenetration = 17 - else - MaxPenetration = 14 - end - - local DoDefaultEffect = true - // -- Don't go through metal, sand or player - - if self.Primary.Ammo == "pistol" or - self.Primary.Ammo == "buckshot" or - self.Primary.Ammo == "slam" then self.Ricochet = true - else - if self.RicochetCoin == 1 then - self.Ricochet = true - elseif self.RicochetCoin >= 2 then - self.Ricochet = false - end - end - - if self.Primary.Ammo == "SniperPenetratedRound" then self.Ricochet = true end - - if self.Primary.Ammo == "SniperPenetratedRound" then -- .50 Ammo - self.MaxRicochet = 10 - elseif self.Primary.Ammo == "pistol" then -- pistols - self.MaxRicochet = 2 - elseif self.Primary.Ammo == "357" then -- revolvers with big ass bullets - self.MaxRicochet = 5 - elseif self.Primary.Ammo == "smg1" then -- smgs - self.MaxRicochet = 4 - elseif self.Primary.Ammo == "ar2" then -- assault rifles - self.MaxRicochet = 5 - elseif self.Primary.Ammo == "buckshot" then -- shotguns - self.MaxRicochet = 0 - elseif self.Primary.Ammo == "slam" then -- secondary shotguns - self.MaxRicochet = 0 - elseif self.Primary.Ammo == "AirboatGun" then -- metal piercing shotgun pellet - self.MaxRicochet = 8 - end - - if (tr.MatType == MAT_METAL and self.Ricochet == true and self.Primary.Ammo != "SniperPenetratedRound" ) then return false end - - // -- Don't go through more than 3 times - if (bouncenum > self.MaxRicochet) then return false end - - // -- Direction (and length) that we are going to penetrate - local PenetrationDirection = tr.Normal * MaxPenetration - - if (tr.MatType == MAT_GLASS or tr.MatType == MAT_PLASTIC or tr.MatType == MAT_WOOD or tr.MatType == MAT_FLESH or tr.MatType == MAT_ALIENFLESH) then - PenetrationDirection = tr.Normal * (MaxPenetration * 2) - end - - local trace = {} - trace.endpos = tr.HitPos - trace.start = tr.HitPos + PenetrationDirection - trace.mask = MASK_SHOT - trace.filter = {self.Owner} - - local trace = util.TraceLine(trace) - - // -- Bullet didn't penetrate. - if (trace.StartSolid or trace.Fraction >= 1.0 or tr.Fraction <= 0.0) then return false end - - // -- Damage multiplier depending on surface - local fDamageMulti = 0.5 - - if self.Primary.Ammo == "SniperPenetratedRound" then - fDamageMulti = 1 - elseif(tr.MatType == MAT_CONCRETE or tr.MatType == MAT_METAL) then - fDamageMulti = 0.3 - elseif (tr.MatType == MAT_WOOD or tr.MatType == MAT_PLASTIC or tr.MatType == MAT_GLASS) then - fDamageMulti = 0.8 - elseif (tr.MatType == MAT_FLESH or tr.MatType == MAT_ALIENFLESH) then - fDamageMulti = 0.9 - end - - local damagedice = math.Rand(.85,1.3) - local newdamage = self.Primary.Damage * damagedice - - // -- Fire bullet from the exit point using the original trajectory - local penetratedbullet = {} - penetratedbullet.Num = 1 - penetratedbullet.Src = trace.HitPos - penetratedbullet.Dir = tr.Normal - penetratedbullet.Spread = Vector(0, 0, 0) - penetratedbullet.Tracer = 2 - penetratedbullet.TracerName = "m9k_effect_mad_penetration_trace" - penetratedbullet.Force = 5 - penetratedbullet.Damage = paininfo:GetDamage() * fDamageMulti - penetratedbullet.Callback = function(a, b, c) if (self.Ricochet) then - local impactnum - if tr.MatType == MAT_GLASS then impactnum = 0 else impactnum = 1 end - return self:RicochetCallback(bouncenum + impactnum, a,b,c) end end - - timer.Simple(0, function() if attacker != nil then attacker:FireBullets(penetratedbullet) end end) - - return true -end - - -function SWEP:SecondaryAttack() - return false -end - -function SWEP:Reload() - if not IsValid(self) then return end if not IsValid(self.Owner) then return end - - if self.Owner:IsNPC() then - self.Weapon:DefaultReload(ACT_VM_RELOAD) - return end - - if self.Owner:KeyDown(IN_USE) then return end - - if self.Silenced then - self.Weapon:DefaultReload(ACT_VM_RELOAD_SILENCED) - else - self.Weapon:DefaultReload(ACT_VM_RELOAD) - end - - if !self.Owner:IsNPC() then - if self.Owner:GetViewModel() == nil then self.ResetSights = CurTime() + 3 else - self.ResetSights = CurTime() + self.Owner:GetViewModel():SequenceDuration() - end - end - - if SERVER and self.Weapon != nil then - if ( self.Weapon:Clip1() < self.Primary.ClipSize ) and !self.Owner:IsNPC() then - -- //When the current clip < full clip and the rest of your ammo > 0, then - self.Owner:SetFOV( 0, 0.3 ) - -- //Zoom = 0 - self:SetIronsights(false) - -- //Set the ironsight to false - self.Weapon:SetNWBool("Reloading", true) - end - local waitdammit = (self.Owner:GetViewModel():SequenceDuration()) - timer.Simple(waitdammit + .1, - function() - if self.Weapon == nil then return end - self.Weapon:SetNWBool("Reloading", false) - if self.Owner:KeyDown(IN_ATTACK2) and self.Weapon:GetClass() == self.Gun then - if CLIENT then return end - if self.Scoped == false then - self.Owner:SetFOV( self.Secondary.IronFOV, 0.3 ) - self.IronSightsPos = self.SightsPos -- Bring it up - self.IronSightsAng = self.SightsAng -- Bring it up - self:SetIronsights(true, self.Owner) - self.DrawCrosshair = false - else return end - elseif self.Owner:KeyDown(IN_SPEED) and self.Weapon:GetClass() == self.Gun then - if self.Weapon:GetNextPrimaryFire() <= (CurTime() + .03) then - self.Weapon:SetNextPrimaryFire(CurTime()+0.3) -- Make it so you can't shoot for another quarter second - end - self.IronSightsPos = self.RunSightsPos -- Hold it down - self.IronSightsAng = self.RunSightsAng -- Hold it down - self:SetIronsights(true, self.Owner) -- Set the ironsight true - self.Owner:SetFOV( 0, 0.3 ) - else return end - end) - end -end - -function SWEP:PostReloadScopeCheck() - if self.Weapon == nil then return end - self.Weapon:SetNWBool("Reloading", false) - if self.Owner:KeyDown(IN_ATTACK2) and self.Weapon:GetClass() == self.Gun then - if CLIENT then return end - if self.Scoped == false then - self.Owner:SetFOV( self.Secondary.IronFOV, 0.3 ) - self.IronSightsPos = self.SightsPos -- Bring it up - self.IronSightsAng = self.SightsAng -- Bring it up - self:SetIronsights(true, self.Owner) - self.DrawCrosshair = false - else return end - elseif self.Owner:KeyDown(IN_SPEED) and self.Weapon:GetClass() == self.Gun then - if self.Weapon:GetNextPrimaryFire() <= (CurTime() + .03) then - self.Weapon:SetNextPrimaryFire(CurTime()+0.3) -- Make it so you can't shoot for another quarter second - end - self.IronSightsPos = self.RunSightsPos -- Hold it down - self.IronSightsAng = self.RunSightsAng -- Hold it down - self:SetIronsights(true, self.Owner) -- Set the ironsight true - self.Owner:SetFOV( 0, 0.3 ) - else return end -end - -function SWEP:Silencer() - - if self.NextSilence > CurTime() then return end - - if self.Weapon != nil then - self.Owner:SetFOV( 0, 0.3 ) - self:SetIronsights(false) - self.Weapon:SetNWBool("Reloading", true) -- i know we're not reloading but it works - end - - if self.Silenced then - self:SendWeaponAnim(ACT_VM_DETACH_SILENCER) - self.Silenced = false - elseif not self.Silenced then - self:SendWeaponAnim(ACT_VM_ATTACH_SILENCER) - self.Silenced = true - end - - siltimer = CurTime() + (self.Owner:GetViewModel():SequenceDuration()) + 0.1 - if self.Weapon:GetNextPrimaryFire() <= siltimer then - self.Weapon:SetNextPrimaryFire(siltimer) - end - self.NextSilence = siltimer - - timer.Simple( ((self.Owner:GetViewModel():SequenceDuration()) + 0.1), - function() - if self.Weapon != nil then - self.Weapon:SetNWBool("Reloading", false) - if self.Owner:KeyDown(IN_ATTACK2) and self.Weapon:GetClass() == self.Gun then - if CLIENT then return end - if self.Scoped == false then - self.Owner:SetFOV( self.Secondary.IronFOV, 0.3 ) - self.IronSightsPos = self.SightsPos -- Bring it up - self.IronSightsAng = self.SightsAng -- Bring it up - self:SetIronsights(true, self.Owner) - self.DrawCrosshair = false - else return end - elseif self.Owner:KeyDown(IN_SPEED) and self.Weapon:GetClass() == self.Gun then - if self.Weapon:GetNextPrimaryFire() <= (CurTime()+0.3) then - self.Weapon:SetNextPrimaryFire(CurTime()+0.3) -- Make it so you can't shoot for another quarter second - end - self.IronSightsPos = self.RunSightsPos -- Hold it down - self.IronSightsAng = self.RunSightsAng -- Hold it down - self:SetIronsights(true, self.Owner) -- Set the ironsight true - self.Owner:SetFOV( 0, 0.3 ) - else return end - end - end) - -end - -function SWEP:SelectFireMode() - - if self.Primary.Automatic then - self.Primary.Automatic = false - self.NextFireSelect = CurTime() + .5 - if CLIENT then - self.Owner:PrintMessage(HUD_PRINTTALK, "Semi-automatic selected.") - end - self.Weapon:EmitSound("Weapon_AR2.Empty") - else - self.Primary.Automatic = true - self.NextFireSelect = CurTime() + .5 - if CLIENT then - self.Owner:PrintMessage(HUD_PRINTTALK, "Automatic selected.") - end - self.Weapon:EmitSound("Weapon_AR2.Empty") - end -end - - -/*--------------------------------------------------------- -IronSight ------------------------------------------------------*/ -function SWEP:IronSight() - - if not IsValid(self) then return end - if not IsValid(self.Owner) then return end - - if !self.Owner:IsNPC() then - if self.ResetSights and CurTime() >= self.ResetSights then - self.ResetSights = nil - - if self.Silenced then - self:SendWeaponAnim(ACT_VM_IDLE_SILENCED) - else - self:SendWeaponAnim(ACT_VM_IDLE) - end - end end - - if self.CanBeSilenced and self.NextSilence < CurTime() then - if self.Owner:KeyDown(IN_USE) and self.Owner:KeyPressed(IN_ATTACK2) then - self:Silencer() - end - end - - if self.SelectiveFire and self.NextFireSelect < CurTime() and not (self.Weapon:GetNWBool("Reloading")) then - if self.Owner:KeyDown(IN_USE) and self.Owner:KeyPressed(IN_RELOAD) then - self:SelectFireMode() - end - end - --- //copy this... - if self.Owner:KeyPressed(IN_SPEED) and not (self.Weapon:GetNWBool("Reloading")) then -- If you are running - if self.Weapon:GetNextPrimaryFire() <= (CurTime()+0.3) then - self.Weapon:SetNextPrimaryFire(CurTime()+0.3) -- Make it so you can't shoot for another quarter second - end - self.IronSightsPos = self.RunSightsPos -- Hold it down - self.IronSightsAng = self.RunSightsAng -- Hold it down - self:SetIronsights(true, self.Owner) -- Set the ironsight true - self.Owner:SetFOV( 0, 0.3 ) - self.DrawCrosshair = false - end - - if self.Owner:KeyReleased (IN_SPEED) then -- If you release run then - self:SetIronsights(false, self.Owner) -- Set the ironsight true - self.Owner:SetFOV( 0, 0.3 ) - self.DrawCrosshair = self.OrigCrossHair - end -- Shoulder the gun - --- //down to this - if !self.Owner:KeyDown(IN_USE) and !self.Owner:KeyDown(IN_SPEED) then - -- //If the key E (Use Key) is not pressed, then - - if self.Owner:KeyPressed(IN_ATTACK2) and not (self.Weapon:GetNWBool("Reloading")) then - self.Owner:SetFOV( self.Secondary.IronFOV, 0.3 ) - self.IronSightsPos = self.SightsPos -- Bring it up - self.IronSightsAng = self.SightsAng -- Bring it up - self:SetIronsights(true, self.Owner) - self.DrawCrosshair = false - -- //Set the ironsight true - - if CLIENT then return end - end - end - - if self.Owner:KeyReleased(IN_ATTACK2) and !self.Owner:KeyDown(IN_USE) and !self.Owner:KeyDown(IN_SPEED) then - -- //If the right click is released, then - self.Owner:SetFOV( 0, 0.3 ) - self.DrawCrosshair = self.OrigCrossHair - self:SetIronsights(false, self.Owner) - -- //Set the ironsight false - - if CLIENT then return end - end - - if self.Owner:KeyDown(IN_ATTACK2) and !self.Owner:KeyDown(IN_USE) and !self.Owner:KeyDown(IN_SPEED) then - self.SwayScale = 0.05 - self.BobScale = 0.05 - else - self.SwayScale = 1.0 - self.BobScale = 1.0 - end -end - -/*--------------------------------------------------------- -Think ------------------------------------------------------*/ -function SWEP:Think() - -self:IronSight() - -end - -/*--------------------------------------------------------- -GetViewModelPosition ------------------------------------------------------*/ -local IRONSIGHT_TIME = 0.3 --- //Time to enter in the ironsight mod - -function SWEP:GetViewModelPosition(pos, ang) - - if (not self.IronSightsPos) then return pos, ang end - - local bIron = self.Weapon:GetNWBool("M9K_Ironsights") - - if (bIron != self.bLastIron) then - self.bLastIron = bIron - self.fIronTime = CurTime() - - end - - local fIronTime = self.fIronTime or 0 - - if (not bIron and fIronTime < CurTime() - IRONSIGHT_TIME) then - return pos, ang - end - - local Mul = 1.0 - - if (fIronTime > CurTime() - IRONSIGHT_TIME) then - Mul = math.Clamp((CurTime() - fIronTime) / IRONSIGHT_TIME, 0, 1) - - if not bIron then Mul = 1 - Mul end - end - - local Offset = self.IronSightsPos - - if (self.IronSightsAng) then - ang = ang * 1 - ang:RotateAroundAxis(ang:Right(), self.IronSightsAng.x * Mul) - ang:RotateAroundAxis(ang:Up(), self.IronSightsAng.y * Mul) - ang:RotateAroundAxis(ang:Forward(), self.IronSightsAng.z * Mul) - end - - local Right = ang:Right() - local Up = ang:Up() - local Forward = ang:Forward() - - pos = pos + Offset.x * Right * Mul - pos = pos + Offset.y * Forward * Mul - pos = pos + Offset.z * Up * Mul - - return pos, ang -end - -/*--------------------------------------------------------- -SetIronsights ------------------------------------------------------*/ -function SWEP:SetIronsights(b) - self.Weapon:SetNWBool("M9K_Ironsights", b) -end - -function SWEP:GetIronsights() - return self.Weapon:GetNWBool("M9K_Ironsights") -end - - -if CLIENT then - - SWEP.vRenderOrder = nil - function SWEP:ViewModelDrawn() - - if not IsValid(self) then return end - if not IsValid(self.Owner) then return end - local vm = self.Owner:GetViewModel() - if !IsValid(vm) then return end - - if (!self.VElements) then return end - - self:UpdateBonePositions(vm) - - if (!self.vRenderOrder) then - - -- // we build a render order because sprites need to be drawn after models - self.vRenderOrder = {} - - for k, v in pairs( self.VElements ) do - if (v.type == "Model") then - table.insert(self.vRenderOrder, 1, k) - elseif (v.type == "Sprite" or v.type == "Quad") then - table.insert(self.vRenderOrder, k) - end - end - - end - - for k, name in ipairs( self.vRenderOrder ) do - - local v = self.VElements[name] - if (!v) then self.vRenderOrder = nil break end - if (v.hide) then continue end - - local model = v.modelEnt - local sprite = v.spriteMaterial - - if (!v.bone) then continue end - - local pos, ang = self:GetBoneOrientation( self.VElements, v, vm ) - - if (!pos) then continue end - - if (v.type == "Model" and IsValid(model)) then - - model:SetPos(pos + ang:Forward() * v.pos.x + ang:Right() * v.pos.y + ang:Up() * v.pos.z ) - ang:RotateAroundAxis(ang:Up(), v.angle.y) - ang:RotateAroundAxis(ang:Right(), v.angle.p) - ang:RotateAroundAxis(ang:Forward(), v.angle.r) - - model:SetAngles(ang) - -- //model:SetModelScale(v.size) - local matrix = Matrix() - matrix:Scale(v.size) - model:EnableMatrix( "RenderMultiply", matrix ) - - if (v.material == "") then - model:SetMaterial("") - elseif (model:GetMaterial() != v.material) then - model:SetMaterial( v.material ) - end - - if (v.skin and v.skin != model:GetSkin()) then - model:SetSkin(v.skin) - end - - if (v.bodygroup) then - for k, v in pairs( v.bodygroup ) do - if (model:GetBodygroup(k) != v) then - model:SetBodygroup(k, v) - end - end - end - - if (v.surpresslightning) then - render.SuppressEngineLighting(true) - end - - render.SetColorModulation(v.color.r/255, v.color.g/255, v.color.b/255) - render.SetBlend(v.color.a/255) - model:DrawModel() - render.SetBlend(1) - render.SetColorModulation(1, 1, 1) - - if (v.surpresslightning) then - render.SuppressEngineLighting(false) - end - - elseif (v.type == "Sprite" and sprite) then - - local drawpos = pos + ang:Forward() * v.pos.x + ang:Right() * v.pos.y + ang:Up() * v.pos.z - render.SetMaterial(sprite) - render.DrawSprite(drawpos, v.size.x, v.size.y, v.color) - - elseif (v.type == "Quad" and v.draw_func) then - - local drawpos = pos + ang:Forward() * v.pos.x + ang:Right() * v.pos.y + ang:Up() * v.pos.z - ang:RotateAroundAxis(ang:Up(), v.angle.y) - ang:RotateAroundAxis(ang:Right(), v.angle.p) - ang:RotateAroundAxis(ang:Forward(), v.angle.r) - - cam.Start3D2D(drawpos, ang, v.size) - v.draw_func( self ) - cam.End3D2D() - - end - - end - - end - - SWEP.wRenderOrder = nil - function SWEP:DrawWorldModel() - - if (self.ShowWorldModel == nil or self.ShowWorldModel) then - self:DrawModel() - end - - if (!self.WElements) then return end - - if (!self.wRenderOrder) then - - self.wRenderOrder = {} - - for k, v in pairs( self.WElements ) do - if (v.type == "Model") then - table.insert(self.wRenderOrder, 1, k) - elseif (v.type == "Sprite" or v.type == "Quad") then - table.insert(self.wRenderOrder, k) - end - end - - end - - if (IsValid(self.Owner)) then - bone_ent = self.Owner - else - -- // when the weapon is dropped - bone_ent = self - end - - for k, name in pairs( self.wRenderOrder ) do - - local v = self.WElements[name] - if (!v) then self.wRenderOrder = nil break end - if (v.hide) then continue end - - local pos, ang - - if (v.bone) then - pos, ang = self:GetBoneOrientation( self.WElements, v, bone_ent ) - else - pos, ang = self:GetBoneOrientation( self.WElements, v, bone_ent, "ValveBiped.Bip01_R_Hand" ) - end - - if (!pos) then continue end - - local model = v.modelEnt - local sprite = v.spriteMaterial - - if (v.type == "Model" and IsValid(model)) then - - model:SetPos(pos + ang:Forward() * v.pos.x + ang:Right() * v.pos.y + ang:Up() * v.pos.z ) - ang:RotateAroundAxis(ang:Up(), v.angle.y) - ang:RotateAroundAxis(ang:Right(), v.angle.p) - ang:RotateAroundAxis(ang:Forward(), v.angle.r) - - model:SetAngles(ang) - -- //model:SetModelScale(v.size) - local matrix = Matrix() - matrix:Scale(v.size) - model:EnableMatrix( "RenderMultiply", matrix ) - - if (v.material == "") then - model:SetMaterial("") - elseif (model:GetMaterial() != v.material) then - model:SetMaterial( v.material ) - end - - if (v.skin and v.skin != model:GetSkin()) then - model:SetSkin(v.skin) - end - - if (v.bodygroup) then - for k, v in pairs( v.bodygroup ) do - if (model:GetBodygroup(k) != v) then - model:SetBodygroup(k, v) - end - end - end - - if (v.surpresslightning) then - render.SuppressEngineLighting(true) - end - - render.SetColorModulation(v.color.r/255, v.color.g/255, v.color.b/255) - render.SetBlend(v.color.a/255) - model:DrawModel() - render.SetBlend(1) - render.SetColorModulation(1, 1, 1) - - if (v.surpresslightning) then - render.SuppressEngineLighting(false) - end - - elseif (v.type == "Sprite" and sprite) then - - local drawpos = pos + ang:Forward() * v.pos.x + ang:Right() * v.pos.y + ang:Up() * v.pos.z - render.SetMaterial(sprite) - render.DrawSprite(drawpos, v.size.x, v.size.y, v.color) - - elseif (v.type == "Quad" and v.draw_func) then - - local drawpos = pos + ang:Forward() * v.pos.x + ang:Right() * v.pos.y + ang:Up() * v.pos.z - ang:RotateAroundAxis(ang:Up(), v.angle.y) - ang:RotateAroundAxis(ang:Right(), v.angle.p) - ang:RotateAroundAxis(ang:Forward(), v.angle.r) - - cam.Start3D2D(drawpos, ang, v.size) - v.draw_func( self ) - cam.End3D2D() - - end - - end - - end - - function SWEP:GetBoneOrientation( basetab, tab, ent, bone_override ) - - local bone, pos, ang - if (tab.rel and tab.rel != "") then - - local v = basetab[tab.rel] - - if (!v) then return end - - -- // Technically, if there exists an element with the same name as a bone - -- // you can get in an infinite loop. Let's just hope nobody's that stupid. - pos, ang = self:GetBoneOrientation( basetab, v, ent ) - - if (!pos) then return end - - pos = pos + ang:Forward() * v.pos.x + ang:Right() * v.pos.y + ang:Up() * v.pos.z - ang:RotateAroundAxis(ang:Up(), v.angle.y) - ang:RotateAroundAxis(ang:Right(), v.angle.p) - ang:RotateAroundAxis(ang:Forward(), v.angle.r) - - else - - bone = ent:LookupBone(bone_override or tab.bone) - - if (!bone) then return end - - pos, ang = Vector(0,0,0), Angle(0,0,0) - local m = ent:GetBoneMatrix(bone) - if (m) then - pos, ang = m:GetTranslation(), m:GetAngles() - end - - if (IsValid(self.Owner) and self.Owner:IsPlayer() and - ent == self.Owner:GetViewModel() and self.ViewModelFlip) then - ang.r = -ang.r --// Fixes mirrored models - end - - end - - return pos, ang - end - - function SWEP:CreateModels( tab ) - - if (!tab) then return end - - -- // Create the clientside models here because Garry says we can't do it in the render hook - for k, v in pairs( tab ) do - if (v.type == "Model" and v.model and v.model != "" and (!IsValid(v.modelEnt) or v.createdModel != v.model) and - string.find(v.model, ".mdl") and file.Exists (v.model, "GAME") ) then - - v.modelEnt = ClientsideModel(v.model, RENDER_GROUP_VIEW_MODEL_OPAQUE) - if (IsValid(v.modelEnt)) then - v.modelEnt:SetPos(self:GetPos()) - v.modelEnt:SetAngles(self:GetAngles()) - v.modelEnt:SetParent(self) - v.modelEnt:SetNoDraw(true) - v.createdModel = v.model - else - v.modelEnt = nil - end - - elseif (v.type == "Sprite" and v.sprite and v.sprite != "" and (!v.spriteMaterial or v.createdSprite != v.sprite) - and file.Exists ("materials/"..v.sprite..".vmt", "GAME")) then - - local name = v.sprite.."-" - local params = { ["$basetexture"] = v.sprite } - -- // make sure we create a unique name based on the selected options - local tocheck = { "nocull", "additive", "vertexalpha", "vertexcolor", "ignorez" } - for i, j in pairs( tocheck ) do - if (v[j]) then - params["$"..j] = 1 - name = name.."1" - else - name = name.."0" - end - end - - v.createdSprite = v.sprite - v.spriteMaterial = CreateMaterial(name,"UnlitGeneric",params) - - end - end - - end - - local allbones - local hasGarryFixedBoneScalingYet = false - - function SWEP:UpdateBonePositions(vm) - - if self.ViewModelBoneMods then - - if (!vm:GetBoneCount()) then return end - - -- // !! WORKAROUND !! --// - -- // We need to check all model names :/ - local loopthrough = self.ViewModelBoneMods - if (!hasGarryFixedBoneScalingYet) then - allbones = {} - for i=0, vm:GetBoneCount() do - local bonename = vm:GetBoneName(i) - if (self.ViewModelBoneMods[bonename]) then - allbones[bonename] = self.ViewModelBoneMods[bonename] - else - allbones[bonename] = { - scale = Vector(1,1,1), - pos = Vector(0,0,0), - angle = Angle(0,0,0) - } - end - end - - loopthrough = allbones - end - //!! ----------- !! -- - - for k, v in pairs( loopthrough ) do - local bone = vm:LookupBone(k) - if (!bone) then continue end - - -- // !! WORKAROUND !! --// - local s = Vector(v.scale.x,v.scale.y,v.scale.z) - local p = Vector(v.pos.x,v.pos.y,v.pos.z) - local ms = Vector(1,1,1) - if (!hasGarryFixedBoneScalingYet) then - local cur = vm:GetBoneParent(bone) - while(cur >= 0) do - local pscale = loopthrough[vm:GetBoneName(cur)].scale - ms = ms * pscale - cur = vm:GetBoneParent(cur) - end - end - - s = s * ms - //!! ----------- !! -- - - if vm:GetManipulateBoneScale(bone) != s then - vm:ManipulateBoneScale( bone, s ) - end - if vm:GetManipulateBoneAngles(bone) != v.angle then - vm:ManipulateBoneAngles( bone, v.angle ) - end - if vm:GetManipulateBonePosition(bone) != p then - vm:ManipulateBonePosition( bone, p ) - end - end - else - self:ResetBonePositions(vm) - end - - end - - function SWEP:ResetBonePositions(vm) - - if (!vm:GetBoneCount()) then return end - for i=0, vm:GetBoneCount() do - vm:ManipulateBoneScale( i, Vector(1, 1, 1) ) - vm:ManipulateBoneAngles( i, Angle(0, 0, 0) ) - vm:ManipulateBonePosition( i, Vector(0, 0, 0) ) - end - - end - - /************************** - Global utility code - **************************/ - - -- // Fully copies the table, meaning all tables inside this table are copied too and so on (normal table.Copy copies only their reference). - -- // Does not copy entities of course, only copies their reference. - -- // WARNING: do not use on tables that contain themselves somewhere down the line or you'll get an infinite loop - function table.FullCopy( tab ) - - if (!tab) then return nil end - - local res = {} - for k, v in pairs( tab ) do - if (type(v) == "table") then - res[k] = table.FullCopy(v) --// recursion ho! - elseif (type(v) == "Vector") then - res[k] = Vector(v.x, v.y, v.z) - elseif (type(v) == "Angle") then - res[k] = Angle(v.p, v.y, v.r) - else - res[k] = v - end - end - - return res - - end - -end - +-- //Variables that are used on both client and server +SWEP.Category = "" +SWEP.Gun = "" +SWEP.Author = "Generic Default, Worshipper, Clavus, and Bob" +SWEP.Contact = "" +SWEP.Purpose = "" +SWEP.Instructions = "" +SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models +SWEP.DrawCrosshair = true -- Hell no, crosshairs r 4 nubz! +SWEP.ViewModelFOV = 65 -- How big the gun will look +SWEP.ViewModelFlip = true -- True for CSS models, False for HL2 models + +SWEP.Spawnable = false +SWEP.AdminSpawnable = false + +SWEP.Primary.Sound = Sound("") -- Sound of the gun +SWEP.Primary.Round = ("") -- What kind of bullet? +SWEP.Primary.Cone = 0.2 -- Accuracy of NPCs +SWEP.Primary.Recoil = 10 +SWEP.Primary.Damage = 10 +SWEP.Primary.Spread = .01 --define from-the-hip accuracy (1 is terrible, .0001 is exact) +SWEP.Primary.NumShots = 1 +SWEP.Primary.RPM = 0 -- This is in Rounds Per Minute +SWEP.Primary.ClipSize = 0 -- Size of a clip +SWEP.Primary.DefaultClip = 0 -- Default number of bullets in a clip +SWEP.Primary.KickUp = 0 -- Maximum up recoil (rise) +SWEP.Primary.KickDown = 0 -- Maximum down recoil (skeet) +SWEP.Primary.KickHorizontal = 0 -- Maximum side recoil (koolaid) +SWEP.Primary.Automatic = true -- Automatic/Semi Auto +SWEP.Primary.Ammo = "none" -- What kind of ammo + +-- SWEP.Secondary.ClipSize = 0 -- Size of a clip +-- SWEP.Secondary.DefaultClip = 0 -- Default number of bullets in a clip +-- SWEP.Secondary.Automatic = false -- Automatic/Semi Auto +SWEP.Secondary.Ammo = "" +--//HAHA! GOTCHA, YA BASTARD! + +-- SWEP.Secondary.IronFOV = 0 -- How much you 'zoom' in. Less is more! + +SWEP.Penetration = true +SWEP.Ricochet = true +SWEP.MaxRicochet = 1 +SWEP.RicochetCoin = 1 +SWEP.BoltAction = false +SWEP.Scoped = false +SWEP.ShellTime = .35 +SWEP.Tracer = 0 +SWEP.CanBeSilenced = false +SWEP.Silenced = false +SWEP.NextSilence = 0 +SWEP.SelectiveFire = false +SWEP.NextFireSelect = 0 +SWEP.OrigCrossHair = true + +local PainMulti = 1 + +if GetConVar("M9KDamageMultiplier") == nil then + PainMulti = 1 + print("M9KDamageMultiplier is missing! You may have hit the lua limit! Reverting multiplier to 1.") +else + PainMulti = GetConVar("M9KDamageMultiplier"):GetFloat() + if PainMulti < 0 then + PainMulti = PainMulti * -1 + print("Your damage multiplier was in the negatives. It has been reverted to a positive number. Your damage multiplier is now "..PainMulti) + end +end + +function NewM9KDamageMultiplier(cvar, previous, new) + print("multiplier has been changed ") + if GetConVar("M9KDamageMultiplier") == nil then + PainMulti = 1 + print("M9KDamageMultiplier is missing! You may have hit the lua limit! Reverting multiplier to 1, you will notice no changes.") + else + PainMulti = GetConVar("M9KDamageMultiplier"):GetFloat() + if PainMulti < 0 then + PainMulti = PainMulti * -1 + print("Your damage multiplier was in the negatives. It has been reverted to a positive number. Your damage multiplier is now "..PainMulti) + end + end +end +cvars.AddChangeCallback("M9KDamageMultiplier", NewM9KDamageMultiplier) + +function NewDefClips(cvar, previous, new) + print("Default clip multiplier has changed. A server restart will be required for these changes to take effect.") +end +cvars.AddChangeCallback("M9KDefaultClip", NewDefClips) + +if GetConVar("M9KDefaultClip") == nil then + print("M9KDefaultClip is missing! You may have hit the lua limit!") +else + if GetConVar("M9KDefaultClip"):GetInt() >= 0 then + print("M9K Weapons will now spawn with "..GetConVar("M9KDefaultClip"):GetFloat().." clips.") + else + print("Default clips will be not be modified") + end +end + +SWEP.VElements = {} +SWEP.WElements = {} + +function SWEP:Initialize() + self.Reloadaftershoot = 0 -- Can't reload when firing + self:SetHoldType(self.HoldType) + self.OrigCrossHair = self.DrawCrosshair + if SERVER and self.Owner:IsNPC() then + self:SetNPCMinBurst(3) + self:SetNPCMaxBurst(10) -- None of this really matters but you need it here anyway + self:SetNPCFireRate(1/(self.Primary.RPM/60)) + -- //self:SetCurrentWeaponProficiency( WEAPON_PROFICIENCY_VERY_GOOD ) + end + + if CLIENT then + + -- // Create a new table for every weapon instance + self.VElements = table.FullCopy( self.VElements ) + self.WElements = table.FullCopy( self.WElements ) + self.ViewModelBoneMods = table.FullCopy( self.ViewModelBoneMods ) + + self:CreateModels(self.VElements) -- create viewmodels + self:CreateModels(self.WElements) -- create worldmodels + + -- // init view model bone build function + if IsValid(self.Owner) and self.Owner:IsPlayer() then + if self.Owner:Alive() then + local vm = self.Owner:GetViewModel() + if IsValid(vm) then + self:ResetBonePositions(vm) + -- // Init viewmodel visibility + if (self.ShowViewModel == nil or self.ShowViewModel) then + vm:SetColor(Color(255,255,255,255)) + else + -- // however for some reason the view model resets to render mode 0 every frame so we just apply a debug material to prevent it from drawing + vm:SetMaterial("Debug/hsv") + end + end + + end + end + + end + + if CLIENT then + local oldpath = "vgui/hud/name" -- the path goes here + local newpath = string.gsub(oldpath, "name", self.Gun) + self.WepSelectIcon = surface.GetTextureID(newpath) + end + +end + +function SWEP:Equip() + self:SetHoldType(self.HoldType) + self:SetIronsights(false, self.Owner) +end + +function SWEP:Deploy() + self:SetHoldType(self.HoldType) + + if self.Silenced then + self.Weapon:SendWeaponAnim( ACT_VM_DRAW_SILENCED ) + else + self.Weapon:SendWeaponAnim( ACT_VM_DRAW ) + end + self:SetIronsights(false, self.Owner) + + self.Weapon:SetNWBool("Reloading", false) + + if !self.Owner:IsNPC() and self.Owner != nil then + if self.ResetSights and self.Owner:GetViewModel() != nil then + self.ResetSights = CurTime() + self.Owner:GetViewModel():SequenceDuration() + end + end + return true +end + +function SWEP:Holster() + + if CLIENT and IsValid(self.Owner) and not self.Owner:IsNPC() then + local vm = self.Owner:GetViewModel() + if IsValid(vm) then + self:ResetBonePositions(vm) + end + end + self:SetIronsights(false, self.Owner) + + return true +end + +function SWEP:OnRemove() + + if CLIENT and IsValid(self.Owner) and not self.Owner:IsNPC() then + local vm = self.Owner:GetViewModel() + if IsValid(vm) then + self:ResetBonePositions(vm) + end + end + +end + +function SWEP:GetCapabilities() + return CAP_WEAPON_RANGE_ATTACK1, CAP_INNATE_RANGE_ATTACK1 +end + +function SWEP:Precache() + util.PrecacheSound(self.Primary.Sound) + util.PrecacheModel(self.ViewModel) + util.PrecacheModel(self.WorldModel) +end + +function SWEP:PrimaryAttack() + OkaySoFar = true + if not IsValid(self) then + OkaySoFar = false + else if not IsValid(self.Weapon) then + OkaySoFar = false + else if not IsValid(self.Owner) then + OkaySoFar = false + end end end + + if not OkaySoFar then return end + + if self:CanPrimaryAttack() and self.Owner:IsPlayer() then + if !self.Owner:KeyDown(IN_RELOAD) then + self:ShootBulletInformation() + self.Weapon:TakePrimaryAmmo(1) + + if self.Silenced then + self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK_SILENCED ) + self.Weapon:EmitSound(self.Primary.SilencedSound) + else + self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK ) + self.Weapon:EmitSound(self.Primary.Sound) + end + + local fx = EffectData() + fx:SetEntity(self.Weapon) + fx:SetOrigin(self.Owner:GetShootPos()) + fx:SetNormal(self.Owner:GetAimVector()) + fx:SetAttachment(self.MuzzleAttachment) + if GetConVar("M9KGasEffect") != nil then + if GetConVar("M9KGasEffect"):GetBool() then + util.Effect("m9k_rg_muzzle_rifle",fx) + end + end + self.Owner:SetAnimation( PLAYER_ATTACK1 ) + self.Owner:MuzzleFlash() + self.Weapon:SetNextPrimaryFire(CurTime()+1/(self.Primary.RPM/60)) + self:CheckWeaponsAndAmmo() + self.RicochetCoin = (1) + if self.BoltAction then self:BoltBack() end + end + elseif self:CanPrimaryAttack() and self.Owner:IsNPC() then + self:ShootBulletInformation() + self.Weapon:TakePrimaryAmmo(1) + self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK ) + self.Weapon:EmitSound(self.Primary.Sound) + self.Owner:SetAnimation( PLAYER_ATTACK1 ) + self.Owner:MuzzleFlash() + self.Weapon:SetNextPrimaryFire(CurTime()+1/(self.Primary.RPM/60)) + self.RicochetCoin = (1) + end + end + +function SWEP:CheckWeaponsAndAmmo() + if SERVER and self.Weapon != nil and (GetConVar("M9KWeaponStrip"):GetBool()) then + if self.Weapon:Clip1() == 0 && self.Owner:GetAmmoCount( self.Weapon:GetPrimaryAmmoType() ) == 0 then + timer.Simple(.1, function() if SERVER then if not IsValid(self) then return end + if self.Owner == nil then return end + self.Owner:StripWeapon(self.Gun) + end end) + end + end +end + + +/*--------------------------------------------------------- + Name: SWEP:ShootBulletInformation() + Desc: This func add the damage, the recoil, the number of shots and the cone on the bullet. +-----------------------------------------------------*/ +function SWEP:ShootBulletInformation() + + local CurrentDamage + local CurrentRecoil + local CurrentCone + local basedamage + local damagedice = 1 + + basedamage = PainMulti * self.Primary.Damage + CurrentDamage = basedamage * damagedice + CurrentRecoil = self.Primary.Recoil + + -- //Player is aiming + if (self:GetIronsights() == true) and self.Owner:KeyDown(IN_ATTACK2) then + self:ShootBullet(CurrentDamage, CurrentRecoil, self.Primary.NumShots, self.Primary.IronAccuracy) + -- //Player is not aiming + else + if IsValid(self) then + if IsValid(self.Weapon) then + if IsValid(self.Owner) then + self:ShootBullet(CurrentDamage, CurrentRecoil, self.Primary.NumShots, self.Primary.Spread) + end + end + end + end + +end + +/*--------------------------------------------------------- + Name: SWEP:ShootBullet() + Desc: A convenience func to shoot bullets. +-----------------------------------------------------*/ +local TracerName = "Tracer" + +function SWEP:ShootBullet(damage, recoil, num_bullets, aimcone) + + num_bullets = num_bullets or 1 + aimcone = aimcone or 0 + + self:ShootEffects() + + if self.Tracer == 1 then + TracerName = "Ar2Tracer" + elseif self.Tracer == 2 then + TracerName = "AirboatGunHeavyTracer" + else + TracerName = "Tracer" + end + + local bullet = {} + bullet.Num = num_bullets + bullet.Src = self.Owner:GetShootPos() -- Source + bullet.Dir = self.Owner:GetAimVector() -- Dir of bullet + bullet.Spread = Vector(aimcone, aimcone, 0) -- Aim Cone + bullet.Tracer = 3 -- Show a tracer on every x bullets + bullet.TracerName = TracerName + bullet.Force = damage * 0.25 -- Amount of force to give to phys objects + bullet.Damage = damage + bullet.Callback = function(attacker, tracedata, dmginfo) + return self:RicochetCallback(0, attacker, tracedata, dmginfo) + end + if IsValid(self) then + if IsValid(self.Weapon) then + if IsValid(self.Owner) then + self.Owner:FireBullets(bullet) + end + end + end + -- //if SERVER and !self.Owner:IsNPC() then + -- // local anglo = Angle(math.Rand(-self.Primary.KickDown,-self.Primary.KickUp), math.Rand(-self.Primary.KickHorizontal,self.Primary.KickHorizontal), 0) + -- // self.Owner:ViewPunch(anglo) + + -- // local eyes = self.Owner:EyeAngles() + -- // eyes.pitch = eyes.pitch + anglo.pitch + -- // eyes.yaw = eyes.yaw + anglo.yaw + -- // if game.SinglePlayer() then self.Owner:SetEyeAngles(eyes) end + -- //end + + + + if !self.Owner:IsNPC() then + + local anglo = Angle(-self.Primary.Recoil) + local eyes = self.Owner:EyeAngles() + eyes.pitch = eyes.pitch + (anglo.pitch/3) + eyes.yaw = eyes.yaw + (anglo.yaw/3) + self.Owner:SetEyeAngles(eyes) + end + +end + +/*--------------------------------------------------------- + Name: SWEP:RicochetCallback() +-----------------------------------------------------*/ + +function SWEP:RicochetCallback(bouncenum, attacker, tr, dmginfo) + + if not IsFirstTimePredicted() then + return {damage = false, effects = false} + end + + local PenetrationChecker = false + + if GetConVar("M9KDisablePenetration") == nil then + PenetrationChecker = false + else + PenetrationChecker = GetConVar("M9KDisablePenetration"):GetBool() + end + + if PenetrationChecker then return {damage = true, effects = DoDefaultEffect} end + + bulletmiss = {} + bulletmiss[1]=Sound("weapons/fx/nearmiss/bulletLtoR03.wav") + bulletmiss[2]=Sound("weapons/fx/nearmiss/bulletLtoR04.wav") + bulletmiss[3]=Sound("weapons/fx/nearmiss/bulletLtoR06.wav") + bulletmiss[4]=Sound("weapons/fx/nearmiss/bulletLtoR07.wav") + bulletmiss[5]=Sound("weapons/fx/nearmiss/bulletLtoR09.wav") + bulletmiss[6]=Sound("weapons/fx/nearmiss/bulletLtoR10.wav") + bulletmiss[7]=Sound("weapons/fx/nearmiss/bulletLtoR13.wav") + bulletmiss[8]=Sound("weapons/fx/nearmiss/bulletLtoR14.wav") + + local DoDefaultEffect = true + if (tr.HitSky) then return end + + // -- Can we go through whatever we hit? + if (self.Penetration) and (self:BulletPenetrate(bouncenum, attacker, tr, dmginfo)) then + return {damage = true, effects = DoDefaultEffect} + end + + // -- Your screen will shake and you'll hear the savage hiss of an approaching bullet which passing if someone is shooting at you. + if (tr.MatType != MAT_METAL) then + if (SERVER) then + util.ScreenShake(tr.HitPos, 5, 0.1, 0.5, 64) + sound.Play(table.Random(bulletmiss), tr.HitPos, 75, math.random(75,150), 1) + end + + if self.Tracer == 0 or self.Tracer == 1 or self.Tracer == 2 then + local effectdata = EffectData() + effectdata:SetOrigin(tr.HitPos) + effectdata:SetNormal(tr.HitNormal) + effectdata:SetScale(20) + util.Effect("AR2Impact", effectdata) + elseif self.Tracer == 3 then + local effectdata = EffectData() + effectdata:SetOrigin(tr.HitPos) + effectdata:SetNormal(tr.HitNormal) + effectdata:SetScale(20) + util.Effect("StunstickImpact", effectdata) + end + + return + end + + if (self.Ricochet == false) then return {damage = true, effects = DoDefaultEffect} end + + if self.Primary.Ammo == "SniperPenetratedRound" then -- .50 Ammo + self.MaxRicochet = 12 + elseif self.Primary.Ammo == "pistol" then -- pistols + self.MaxRicochet = 2 + elseif self.Primary.Ammo == "357" then -- revolvers with big ass bullets + self.MaxRicochet = 4 + elseif self.Primary.Ammo == "smg1" then -- smgs + self.MaxRicochet = 5 + elseif self.Primary.Ammo == "ar2" then -- assault rifles + self.MaxRicochet = 8 + elseif self.Primary.Ammo == "buckshot" then -- shotguns + self.MaxRicochet = 1 + elseif self.Primary.Ammo == "slam" then -- secondary shotguns + self.MaxRicochet = 1 + elseif self.Primary.Ammo == "AirboatGun" then -- metal piercing shotgun pellet + self.MaxRicochet = 8 + end + + if (bouncenum > self.MaxRicochet) then return end + + // -- Bounce vector + local trace = {} + trace.start = tr.HitPos + trace.endpos = trace.start + (tr.HitNormal * 16384) + + local trace = util.TraceLine(trace) + + local DotProduct = tr.HitNormal:Dot(tr.Normal * -1) + + local ricochetbullet = {} + ricochetbullet.Num = 1 + ricochetbullet.Src = tr.HitPos + (tr.HitNormal * 5) + ricochetbullet.Dir = ((2 * tr.HitNormal * DotProduct) + tr.Normal) + (VectorRand() * 0.05) + ricochetbullet.Spread = Vector(0, 0, 0) + ricochetbullet.Tracer = 1 + ricochetbullet.TracerName = "m9k_effect_mad_ricochet_trace" + ricochetbullet.Force = dmginfo:GetDamage() * 0.15 + ricochetbullet.Damage = dmginfo:GetDamage() * 0.5 + ricochetbullet.Callback = function(a, b, c) + if (self.Ricochet) then + local impactnum + if tr.MatType == MAT_GLASS then impactnum = 0 else impactnum = 1 end + return self:RicochetCallback(bouncenum + impactnum, a, b, c) end + end + + timer.Simple(0, function() attacker:FireBullets(ricochetbullet) end) + + return {damage = true, effects = DoDefaultEffect} +end + + +/*--------------------------------------------------------- + Name: SWEP:BulletPenetrate() +-----------------------------------------------------*/ +function SWEP:BulletPenetrate(bouncenum, attacker, tr, paininfo) + + local MaxPenetration + + if self.Primary.Ammo == "SniperPenetratedRound" then -- .50 Ammo + MaxPenetration = 20 + elseif self.Primary.Ammo == "pistol" then -- pistols + MaxPenetration = 9 + elseif self.Primary.Ammo == "357" then -- revolvers with big ass bullets + MaxPenetration = 12 + elseif self.Primary.Ammo == "smg1" then -- smgs + MaxPenetration = 14 + elseif self.Primary.Ammo == "ar2" then -- assault rifles + MaxPenetration = 16 + elseif self.Primary.Ammo == "buckshot" then -- shotguns + MaxPenetration = 5 + elseif self.Primary.Ammo == "slam" then -- secondary shotguns + MaxPenetration = 5 + elseif self.Primary.Ammo == "AirboatGun" then -- metal piercing shotgun pellet + MaxPenetration = 17 + else + MaxPenetration = 14 + end + + local DoDefaultEffect = true + // -- Don't go through metal, sand or player + + if self.Primary.Ammo == "pistol" or + self.Primary.Ammo == "buckshot" or + self.Primary.Ammo == "slam" then self.Ricochet = true + else + if self.RicochetCoin == 1 then + self.Ricochet = true + elseif self.RicochetCoin >= 2 then + self.Ricochet = false + end + end + + if self.Primary.Ammo == "SniperPenetratedRound" then self.Ricochet = true end + + if self.Primary.Ammo == "SniperPenetratedRound" then -- .50 Ammo + self.MaxRicochet = 10 + elseif self.Primary.Ammo == "pistol" then -- pistols + self.MaxRicochet = 2 + elseif self.Primary.Ammo == "357" then -- revolvers with big ass bullets + self.MaxRicochet = 5 + elseif self.Primary.Ammo == "smg1" then -- smgs + self.MaxRicochet = 4 + elseif self.Primary.Ammo == "ar2" then -- assault rifles + self.MaxRicochet = 5 + elseif self.Primary.Ammo == "buckshot" then -- shotguns + self.MaxRicochet = 0 + elseif self.Primary.Ammo == "slam" then -- secondary shotguns + self.MaxRicochet = 0 + elseif self.Primary.Ammo == "AirboatGun" then -- metal piercing shotgun pellet + self.MaxRicochet = 8 + end + + if (tr.MatType == MAT_METAL and self.Ricochet == true and self.Primary.Ammo != "SniperPenetratedRound" ) then return false end + + // -- Don't go through more than 3 times + if (bouncenum > self.MaxRicochet) then return false end + + // -- Direction (and length) that we are going to penetrate + local PenetrationDirection = tr.Normal * MaxPenetration + + if (tr.MatType == MAT_GLASS or tr.MatType == MAT_PLASTIC or tr.MatType == MAT_WOOD or tr.MatType == MAT_FLESH or tr.MatType == MAT_ALIENFLESH) then + PenetrationDirection = tr.Normal * (MaxPenetration * 2) + end + + local trace = {} + trace.endpos = tr.HitPos + trace.start = tr.HitPos + PenetrationDirection + trace.mask = MASK_SHOT + trace.filter = {self.Owner} + + local trace = util.TraceLine(trace) + + // -- Bullet didn't penetrate. + if (trace.StartSolid or trace.Fraction >= 1.0 or tr.Fraction <= 0.0) then return false end + + // -- Damage multiplier depending on surface + local fDamageMulti = 0.5 + + if self.Primary.Ammo == "SniperPenetratedRound" then + fDamageMulti = 1 + elseif(tr.MatType == MAT_CONCRETE or tr.MatType == MAT_METAL) then + fDamageMulti = 0.3 + elseif (tr.MatType == MAT_WOOD or tr.MatType == MAT_PLASTIC or tr.MatType == MAT_GLASS) then + fDamageMulti = 0.8 + elseif (tr.MatType == MAT_FLESH or tr.MatType == MAT_ALIENFLESH) then + fDamageMulti = 0.9 + end + + local damagedice = math.Rand(.85,1.3) + local newdamage = self.Primary.Damage * damagedice + + // -- Fire bullet from the exit point using the original trajectory + local penetratedbullet = {} + penetratedbullet.Num = 1 + penetratedbullet.Src = trace.HitPos + penetratedbullet.Dir = tr.Normal + penetratedbullet.Spread = Vector(0, 0, 0) + penetratedbullet.Tracer = 2 + penetratedbullet.TracerName = "m9k_effect_mad_penetration_trace" + penetratedbullet.Force = 5 + penetratedbullet.Damage = paininfo:GetDamage() * fDamageMulti + penetratedbullet.Callback = function(a, b, c) if (self.Ricochet) then + local impactnum + if tr.MatType == MAT_GLASS then impactnum = 0 else impactnum = 1 end + return self:RicochetCallback(bouncenum + impactnum, a,b,c) end end + + timer.Simple(0, function() if attacker != nil then attacker:FireBullets(penetratedbullet) end end) + + return true +end + + +function SWEP:SecondaryAttack() + return false +end + +function SWEP:Reload() + if not IsValid(self) then return end if not IsValid(self.Owner) then return end + + if self.Owner:IsNPC() then + self.Weapon:DefaultReload(ACT_VM_RELOAD) + return end + + if self.Owner:KeyDown(IN_USE) then return end + + if self.Silenced then + self.Weapon:DefaultReload(ACT_VM_RELOAD_SILENCED) + else + self.Weapon:DefaultReload(ACT_VM_RELOAD) + end + + if !self.Owner:IsNPC() then + if self.Owner:GetViewModel() == nil then self.ResetSights = CurTime() + 3 else + self.ResetSights = CurTime() + self.Owner:GetViewModel():SequenceDuration() + end + end + + if SERVER and self.Weapon != nil then + if ( self.Weapon:Clip1() < self.Primary.ClipSize ) and !self.Owner:IsNPC() then + -- //When the current clip < full clip and the rest of your ammo > 0, then + -- //Zoom = 0 + -- //Set the ironsight to false + self.Weapon:SetNWBool("Reloading", true) + end + local waitdammit = (self.Owner:GetViewModel():SequenceDuration()) + timer.Simple(waitdammit + .1, + function() + if self.Weapon == nil then return end + self.Weapon:SetNWBool("Reloading", false) + if self.Owner:KeyDown(IN_ATTACK2) and self.Weapon:GetClass() == self.Gun then + if CLIENT then return end + if self.Scoped == false then + self.DrawCrosshair = false + else return end + else return end + end) + end +end + +function SWEP:PostReloadScopeCheck() + if self.Weapon == nil then return end + self.Weapon:SetNWBool("Reloading", false) + if self.Owner:KeyDown(IN_ATTACK2) and self.Weapon:GetClass() == self.Gun then + if CLIENT then return end + if self.Scoped == false then + self.DrawCrosshair = false + else return end + else return end +end + +function SWEP:Silencer() + + if self.NextSilence > CurTime() then return end + + if self.Weapon != nil then + self.Weapon:SetNWBool("Reloading", true) -- i know we're not reloading but it works + end + + if self.Silenced then + self:SendWeaponAnim(ACT_VM_DETACH_SILENCER) + self.Silenced = false + elseif not self.Silenced then + self:SendWeaponAnim(ACT_VM_ATTACH_SILENCER) + self.Silenced = true + end + + siltimer = CurTime() + (self.Owner:GetViewModel():SequenceDuration()) + 0.1 + if self.Weapon:GetNextPrimaryFire() <= siltimer then + self.Weapon:SetNextPrimaryFire(siltimer) + end + self.NextSilence = siltimer + + timer.Simple( ((self.Owner:GetViewModel():SequenceDuration()) + 0.1), + function() + if self.Weapon != nil then + self.Weapon:SetNWBool("Reloading", false) + if self.Owner:KeyDown(IN_ATTACK2) and self.Weapon:GetClass() == self.Gun then + if CLIENT then return end + if self.Scoped == false then + self.DrawCrosshair = false + else return end + else return end + end + end) + +end + +function SWEP:SelectFireMode() + + if self.Primary.Automatic then + self.Primary.Automatic = false + self.NextFireSelect = CurTime() + .5 + if CLIENT then + self.Owner:PrintMessage(HUD_PRINTTALK, "Semi-automatic selected.") + end + self.Weapon:EmitSound("Weapon_AR2.Empty") + else + self.Primary.Automatic = true + self.NextFireSelect = CurTime() + .5 + if CLIENT then + self.Owner:PrintMessage(HUD_PRINTTALK, "Automatic selected.") + end + self.Weapon:EmitSound("Weapon_AR2.Empty") + end +end + + +/*--------------------------------------------------------- +IronSight +-----------------------------------------------------*/ +function SWEP:IronSight() + + if not IsValid(self) then return end + if not IsValid(self.Owner) then return end + + if !self.Owner:IsNPC() then + if self.ResetSights and CurTime() >= self.ResetSights then + self.ResetSights = nil + + if self.Silenced then + self:SendWeaponAnim(ACT_VM_IDLE_SILENCED) + else + self:SendWeaponAnim(ACT_VM_IDLE) + end + end end + + if self.CanBeSilenced and self.NextSilence < CurTime() then + if self.Owner:KeyDown(IN_USE) and self.Owner:KeyPressed(IN_ATTACK2) then + self:Silencer() + end + end + + if self.SelectiveFire and self.NextFireSelect < CurTime() and not (self.Weapon:GetNWBool("Reloading")) then + if self.Owner:KeyDown(IN_USE) and self.Owner:KeyPressed(IN_RELOAD) then + self:SelectFireMode() + end + end + +-- //copy this... + if self.Owner:KeyPressed(IN_SPEED) and not (self.Weapon:GetNWBool("Reloading")) then -- If you are running + if self.Weapon:GetNextPrimaryFire() <= (CurTime()+0.3) then --r second + end + self.DrawCrosshair = false + end + + if self.Owner:KeyReleased (IN_SPEED) then -- If you release run then + self.DrawCrosshair = self.OrigCrossHair + end -- Shoulder the gun + +-- //down to this + if !self.Owner:KeyDown(IN_USE) and !self.Owner:KeyDown(IN_SPEED) then + -- //If the key E (Use Key) is not pressed, then + + if self.Owner:KeyPressed(IN_ATTACK2) and not (self.Weapon:GetNWBool("Reloading")) then + self.DrawCrosshair = false + -- //Set the ironsight true + + if CLIENT then return end + end + end + + if self.Owner:KeyReleased(IN_ATTACK2) and !self.Owner:KeyDown(IN_USE) and !self.Owner:KeyDown(IN_SPEED) then + -- //If the right click is released, then + self.DrawCrosshair = self.OrigCrossHair + -- //Set the ironsight false + + if CLIENT then return end + end + + +end + +/*--------------------------------------------------------- +Think +-----------------------------------------------------*/ +function SWEP:Think() + +self:IronSight() + +end + +/*--------------------------------------------------------- +GetViewModelPosition +-----------------------------------------------------*/ +local IRONSIGHT_TIME = 0.3 +-- //Time to enter in the ironsight mod + +function SWEP:GetViewModelPosition(pos, ang) + + if (not self.IronSightsPos) then return pos, ang end + + local bIron = self.Weapon:GetNWBool("M9K_Ironsights") + + if (bIron != self.bLastIron) then + self.bLastIron = bIron + self.fIronTime = CurTime() + + end + + local fIronTime = self.fIronTime or 0 + + if (not bIron and fIronTime < CurTime() - IRONSIGHT_TIME) then + return pos, ang + end + + local Mul = 1.0 + + if (fIronTime > CurTime() - IRONSIGHT_TIME) then + Mul = math.Clamp((CurTime() - fIronTime) / IRONSIGHT_TIME, 0, 1) + + if not bIron then Mul = 1 - Mul end + end + + local Offset = self.IronSightsPos + + if (self.IronSightsAng) then + ang = ang * 1 + ang:RotateAroundAxis(ang:Right(), self.IronSightsAng.x * Mul) + ang:RotateAroundAxis(ang:Up(), self.IronSightsAng.y * Mul) + ang:RotateAroundAxis(ang:Forward(), self.IronSightsAng.z * Mul) + end + + local Right = ang:Right() + local Up = ang:Up() + local Forward = ang:Forward() + + pos = pos + Offset.x * Right * Mul + pos = pos + Offset.y * Forward * Mul + pos = pos + Offset.z * Up * Mul + + return pos, ang +end + +/*--------------------------------------------------------- +SetIronsights +-----------------------------------------------------*/ +function SWEP:SetIronsights(b) + self.Weapon:SetNWBool("M9K_Ironsights", b) +end + +function SWEP:GetIronsights() + return self.Weapon:GetNWBool("M9K_Ironsights") +end + + +if CLIENT then + + SWEP.vRenderOrder = nil + function SWEP:ViewModelDrawn() + + if not IsValid(self) then return end + if not IsValid(self.Owner) then return end + local vm = self.Owner:GetViewModel() + if !IsValid(vm) then return end + + if (!self.VElements) then return end + + self:UpdateBonePositions(vm) + + if (!self.vRenderOrder) then + + -- // we build a render order because sprites need to be drawn after models + self.vRenderOrder = {} + + for k, v in pairs( self.VElements ) do + if (v.type == "Model") then + table.insert(self.vRenderOrder, 1, k) + elseif (v.type == "Sprite" or v.type == "Quad") then + table.insert(self.vRenderOrder, k) + end + end + + end + + for k, name in ipairs( self.vRenderOrder ) do + + local v = self.VElements[name] + if (!v) then self.vRenderOrder = nil break end + if (v.hide) then continue end + + local model = v.modelEnt + local sprite = v.spriteMaterial + + if (!v.bone) then continue end + + local pos, ang = self:GetBoneOrientation( self.VElements, v, vm ) + + if (!pos) then continue end + + if (v.type == "Model" and IsValid(model)) then + + model:SetPos(pos + ang:Forward() * v.pos.x + ang:Right() * v.pos.y + ang:Up() * v.pos.z ) + ang:RotateAroundAxis(ang:Up(), v.angle.y) + ang:RotateAroundAxis(ang:Right(), v.angle.p) + ang:RotateAroundAxis(ang:Forward(), v.angle.r) + + model:SetAngles(ang) + -- //model:SetModelScale(v.size) + local matrix = Matrix() + matrix:Scale(v.size) + model:EnableMatrix( "RenderMultiply", matrix ) + + if (v.material == "") then + model:SetMaterial("") + elseif (model:GetMaterial() != v.material) then + model:SetMaterial( v.material ) + end + + if (v.skin and v.skin != model:GetSkin()) then + model:SetSkin(v.skin) + end + + if (v.bodygroup) then + for k, v in pairs( v.bodygroup ) do + if (model:GetBodygroup(k) != v) then + model:SetBodygroup(k, v) + end + end + end + + if (v.surpresslightning) then + render.SuppressEngineLighting(true) + end + + render.SetColorModulation(v.color.r/255, v.color.g/255, v.color.b/255) + render.SetBlend(v.color.a/255) + model:DrawModel() + render.SetBlend(1) + render.SetColorModulation(1, 1, 1) + + if (v.surpresslightning) then + render.SuppressEngineLighting(false) + end + + elseif (v.type == "Sprite" and sprite) then + + local drawpos = pos + ang:Forward() * v.pos.x + ang:Right() * v.pos.y + ang:Up() * v.pos.z + render.SetMaterial(sprite) + render.DrawSprite(drawpos, v.size.x, v.size.y, v.color) + + elseif (v.type == "Quad" and v.draw_func) then + + local drawpos = pos + ang:Forward() * v.pos.x + ang:Right() * v.pos.y + ang:Up() * v.pos.z + ang:RotateAroundAxis(ang:Up(), v.angle.y) + ang:RotateAroundAxis(ang:Right(), v.angle.p) + ang:RotateAroundAxis(ang:Forward(), v.angle.r) + + cam.Start3D2D(drawpos, ang, v.size) + v.draw_func( self ) + cam.End3D2D() + + end + + end + + end + + SWEP.wRenderOrder = nil + function SWEP:DrawWorldModel() + + if (self.ShowWorldModel == nil or self.ShowWorldModel) then + self:DrawModel() + end + + if (!self.WElements) then return end + + if (!self.wRenderOrder) then + + self.wRenderOrder = {} + + for k, v in pairs( self.WElements ) do + if (v.type == "Model") then + table.insert(self.wRenderOrder, 1, k) + elseif (v.type == "Sprite" or v.type == "Quad") then + table.insert(self.wRenderOrder, k) + end + end + + end + + if (IsValid(self.Owner)) then + bone_ent = self.Owner + else + -- // when the weapon is dropped + bone_ent = self + end + + for k, name in pairs( self.wRenderOrder ) do + + local v = self.WElements[name] + if (!v) then self.wRenderOrder = nil break end + if (v.hide) then continue end + + local pos, ang + + if (v.bone) then + pos, ang = self:GetBoneOrientation( self.WElements, v, bone_ent ) + else + pos, ang = self:GetBoneOrientation( self.WElements, v, bone_ent, "ValveBiped.Bip01_R_Hand" ) + end + + if (!pos) then continue end + + local model = v.modelEnt + local sprite = v.spriteMaterial + + if (v.type == "Model" and IsValid(model)) then + + model:SetPos(pos + ang:Forward() * v.pos.x + ang:Right() * v.pos.y + ang:Up() * v.pos.z ) + ang:RotateAroundAxis(ang:Up(), v.angle.y) + ang:RotateAroundAxis(ang:Right(), v.angle.p) + ang:RotateAroundAxis(ang:Forward(), v.angle.r) + + model:SetAngles(ang) + -- //model:SetModelScale(v.size) + local matrix = Matrix() + matrix:Scale(v.size) + model:EnableMatrix( "RenderMultiply", matrix ) + + if (v.material == "") then + model:SetMaterial("") + elseif (model:GetMaterial() != v.material) then + model:SetMaterial( v.material ) + end + + if (v.skin and v.skin != model:GetSkin()) then + model:SetSkin(v.skin) + end + + if (v.bodygroup) then + for k, v in pairs( v.bodygroup ) do + if (model:GetBodygroup(k) != v) then + model:SetBodygroup(k, v) + end + end + end + + if (v.surpresslightning) then + render.SuppressEngineLighting(true) + end + + render.SetColorModulation(v.color.r/255, v.color.g/255, v.color.b/255) + render.SetBlend(v.color.a/255) + model:DrawModel() + render.SetBlend(1) + render.SetColorModulation(1, 1, 1) + + if (v.surpresslightning) then + render.SuppressEngineLighting(false) + end + + elseif (v.type == "Sprite" and sprite) then + + local drawpos = pos + ang:Forward() * v.pos.x + ang:Right() * v.pos.y + ang:Up() * v.pos.z + render.SetMaterial(sprite) + render.DrawSprite(drawpos, v.size.x, v.size.y, v.color) + + elseif (v.type == "Quad" and v.draw_func) then + + local drawpos = pos + ang:Forward() * v.pos.x + ang:Right() * v.pos.y + ang:Up() * v.pos.z + ang:RotateAroundAxis(ang:Up(), v.angle.y) + ang:RotateAroundAxis(ang:Right(), v.angle.p) + ang:RotateAroundAxis(ang:Forward(), v.angle.r) + + cam.Start3D2D(drawpos, ang, v.size) + v.draw_func( self ) + cam.End3D2D() + + end + + end + + end + + function SWEP:GetBoneOrientation( basetab, tab, ent, bone_override ) + + local bone, pos, ang + if (tab.rel and tab.rel != "") then + + local v = basetab[tab.rel] + + if (!v) then return end + + -- // Technically, if there exists an element with the same name as a bone + -- // you can get in an infinite loop. Let's just hope nobody's that stupid. + pos, ang = self:GetBoneOrientation( basetab, v, ent ) + + if (!pos) then return end + + pos = pos + ang:Forward() * v.pos.x + ang:Right() * v.pos.y + ang:Up() * v.pos.z + ang:RotateAroundAxis(ang:Up(), v.angle.y) + ang:RotateAroundAxis(ang:Right(), v.angle.p) + ang:RotateAroundAxis(ang:Forward(), v.angle.r) + + else + + bone = ent:LookupBone(bone_override or tab.bone) + + if (!bone) then return end + + pos, ang = Vector(0,0,0), Angle(0,0,0) + local m = ent:GetBoneMatrix(bone) + if (m) then + pos, ang = m:GetTranslation(), m:GetAngles() + end + + if (IsValid(self.Owner) and self.Owner:IsPlayer() and + ent == self.Owner:GetViewModel() and self.ViewModelFlip) then + ang.r = -ang.r --// Fixes mirrored models + end + + end + + return pos, ang + end + + function SWEP:CreateModels( tab ) + + if (!tab) then return end + + -- // Create the clientside models here because Garry says we can't do it in the render hook + for k, v in pairs( tab ) do + if (v.type == "Model" and v.model and v.model != "" and (!IsValid(v.modelEnt) or v.createdModel != v.model) and + string.find(v.model, ".mdl") and file.Exists (v.model, "GAME") ) then + + v.modelEnt = ClientsideModel(v.model, RENDER_GROUP_VIEW_MODEL_OPAQUE) + if (IsValid(v.modelEnt)) then + v.modelEnt:SetPos(self:GetPos()) + v.modelEnt:SetAngles(self:GetAngles()) + v.modelEnt:SetParent(self) + v.modelEnt:SetNoDraw(true) + v.createdModel = v.model + else + v.modelEnt = nil + end + + elseif (v.type == "Sprite" and v.sprite and v.sprite != "" and (!v.spriteMaterial or v.createdSprite != v.sprite) + and file.Exists ("materials/"..v.sprite..".vmt", "GAME")) then + + local name = v.sprite.."-" + local params = { ["$basetexture"] = v.sprite } + -- // make sure we create a unique name based on the selected options + local tocheck = { "nocull", "additive", "vertexalpha", "vertexcolor", "ignorez" } + for i, j in pairs( tocheck ) do + if (v[j]) then + params["$"..j] = 1 + name = name.."1" + else + name = name.."0" + end + end + + v.createdSprite = v.sprite + v.spriteMaterial = CreateMaterial(name,"UnlitGeneric",params) + + end + end + + end + + local allbones + local hasGarryFixedBoneScalingYet = false + + function SWEP:UpdateBonePositions(vm) + + if self.ViewModelBoneMods then + + if (!vm:GetBoneCount()) then return end + + -- // !! WORKAROUND !! --// + -- // We need to check all model names :/ + local loopthrough = self.ViewModelBoneMods + if (!hasGarryFixedBoneScalingYet) then + allbones = {} + for i=0, vm:GetBoneCount() do + local bonename = vm:GetBoneName(i) + if (self.ViewModelBoneMods[bonename]) then + allbones[bonename] = self.ViewModelBoneMods[bonename] + else + allbones[bonename] = { + scale = Vector(1,1,1), + pos = Vector(0,0,0), + angle = Angle(0,0,0) + } + end + end + + loopthrough = allbones + end + //!! ----------- !! -- + + for k, v in pairs( loopthrough ) do + local bone = vm:LookupBone(k) + if (!bone) then continue end + + -- // !! WORKAROUND !! --// + local s = Vector(v.scale.x,v.scale.y,v.scale.z) + local p = Vector(v.pos.x,v.pos.y,v.pos.z) + local ms = Vector(1,1,1) + if (!hasGarryFixedBoneScalingYet) then + local cur = vm:GetBoneParent(bone) + while(cur >= 0) do + local pscale = loopthrough[vm:GetBoneName(cur)].scale + ms = ms * pscale + cur = vm:GetBoneParent(cur) + end + end + + s = s * ms + //!! ----------- !! -- + + if vm:GetManipulateBoneScale(bone) != s then + vm:ManipulateBoneScale( bone, s ) + end + if vm:GetManipulateBoneAngles(bone) != v.angle then + vm:ManipulateBoneAngles( bone, v.angle ) + end + if vm:GetManipulateBonePosition(bone) != p then + vm:ManipulateBonePosition( bone, p ) + end + end + else + self:ResetBonePositions(vm) + end + + end + + function SWEP:ResetBonePositions(vm) + + if (!vm:GetBoneCount()) then return end + for i=0, vm:GetBoneCount() do + vm:ManipulateBoneScale( i, Vector(1, 1, 1) ) + vm:ManipulateBoneAngles( i, Angle(0, 0, 0) ) + vm:ManipulateBonePosition( i, Vector(0, 0, 0) ) + end + + end + + /************************** + Global utility code + **************************/ + + -- // Fully copies the table, meaning all tables inside this table are copied too and so on (normal table.Copy copies only their reference). + -- // Does not copy entities of course, only copies their reference. + -- // WARNING: do not use on tables that contain themselves somewhere down the line or you'll get an infinite loop + function table.FullCopy( tab ) + + if (!tab) then return nil end + + local res = {} + for k, v in pairs( tab ) do + if (type(v) == "table") then + res[k] = table.FullCopy(v) --// recursion ho! + elseif (type(v) == "Vector") then + res[k] = Vector(v.x, v.y, v.z) + elseif (type(v) == "Angle") then + res[k] = Angle(v.p, v.y, v.r) + else + res[k] = v + end + end + + return res + + end + +end \ No newline at end of file diff --git a/m9k_assault_rifles_fatal_edition/lua/weapons/bobs_scoped_base/shared.lua b/m9k_assault_rifles_fatal_edition/lua/weapons/bobs_scoped_base/shared.lua index 00bf9ea..91b4412 100644 --- a/m9k_assault_rifles_fatal_edition/lua/weapons/bobs_scoped_base/shared.lua +++ b/m9k_assault_rifles_fatal_edition/lua/weapons/bobs_scoped_base/shared.lua @@ -58,10 +58,11 @@ SWEP.data = {} -- The starting firemode SWEP.data.ironsights = 1 SWEP.ScopeScale = 0.5 SWEP.ReticleScale = 0.5 -SWEP.IronSightsPos = Vector (2.4537, 1.0923, 0.2696) -SWEP.IronSightsAng = Vector (0.0186, -0.0547, 0) +SWEP.IronSightsPos = Vector (0,0,0) +SWEP.IronSightsAng = Vector (0,0,0) function SWEP:Initialize() + self:SetIronsights(false, self.Owner) self.Weapon:SetNWBool("Reloading", false) util.PrecacheSound(self.Primary.Sound) if CLIENT then @@ -191,8 +192,6 @@ function SWEP:BoltBack() self.Weapon:SetNWBool("Reloading", false) if self.Owner:KeyDown(IN_ATTACK2) and self.Weapon:GetClass() == self.Gun then self.Owner:SetFOV( 75/self.Secondary.ScopeZoom, 0.15 ) - self.IronSightsPos = self.SightsPos -- Bring it up - self.IronSightsAng = self.SightsAng -- Bring it up self.DrawCrosshair = false self:SetIronsights(true, self.Owner) self.Owner:DrawViewModel(false) @@ -205,8 +204,6 @@ function SWEP:BoltBack() end function SWEP:Reload() - - if self.Owner:KeyDown(IN_USE) then return end self.Weapon:DefaultReload(ACT_VM_RELOAD) if !self.Owner:IsNPC() then @@ -237,17 +234,9 @@ function SWEP:Reload() if self.Owner:KeyDown(IN_ATTACK2) and self.Weapon:GetClass() == self.Gun then if CLIENT then return end self.Owner:SetFOV( 75/self.Secondary.ScopeZoom, 0.15 ) - self.IronSightsPos = self.SightsPos -- Bring it up - self.IronSightsAng = self.SightsAng -- Bring it up self.DrawCrosshair = false self:SetIronsights(true, self.Owner) self.Owner:DrawViewModel(false) - elseif self.Owner:KeyDown(IN_SPEED) and self.Weapon:GetClass() == self.Gun then - if self.Weapon:GetNextPrimaryFire() <= (CurTime()+0.3) then - self.Weapon:SetNextPrimaryFire(CurTime()+0.3) -- Make it so you can't shoot for another quarter second - end - self.IronSightsPos = self.RunSightsPos -- Hold it down - self.IronSightsAng = self.RunSightsAng -- Hold it down self:SetIronsights(true, self.Owner) -- Set the ironsight true self.Owner:SetFOV( 0, 0.2 ) else return end @@ -260,17 +249,9 @@ function SWEP:PostReloadScopeCheck() if self.Owner:KeyDown(IN_ATTACK2) and self.Weapon:GetClass() == self.Gun then if CLIENT then return end self.Owner:SetFOV( 75/self.Secondary.ScopeZoom, 0.15 ) - self.IronSightsPos = self.SightsPos -- Bring it up - self.IronSightsAng = self.SightsAng -- Bring it up self.DrawCrosshair = false self:SetIronsights(true, self.Owner) self.Owner:DrawViewModel(false) - elseif self.Owner:KeyDown(IN_SPEED) and self.Weapon:GetClass() == self.Gun then - if self.Weapon:GetNextPrimaryFire() <= (CurTime()+0.3) then - self.Weapon:SetNextPrimaryFire(CurTime()+0.3) -- Make it so you can't shoot for another quarter second - end - self.IronSightsPos = self.RunSightsPos -- Hold it down - self.IronSightsAng = self.RunSightsAng -- Hold it down self:SetIronsights(true, self.Owner) -- Set the ironsight true self.Owner:SetFOV( 0, 0.2 ) else return end @@ -291,57 +272,16 @@ function SWEP:IronSight() self:SelectFireMode() end end - - if self.Owner:KeyDown(IN_USE) and self.Owner:KeyPressed(IN_ATTACK2) then return end - - if self.Owner:KeyPressed(IN_SPEED) and not (self.Weapon:GetNWBool("Reloading")) then -- If you hold E and you can shoot then - if self.Weapon:GetNextPrimaryFire() <= (CurTime()+0.3) then - self.Weapon:SetNextPrimaryFire(CurTime()+0.3) -- Make it so you can't shoot for another quarter second - end - self.IronSightsPos = self.RunSightsPos -- Hold it down - self.IronSightsAng = self.RunSightsAng -- Hold it down - self:SetIronsights(true, self.Owner) -- Set the ironsight true - self.Owner:SetFOV( 0, 0.2 ) - end - - if self.Owner:KeyDown(IN_SPEED) and not (self.Weapon:GetNWBool("Reloading")) then -- If you hold E or run then - if self.Weapon:GetNextPrimaryFire() <= (CurTime()+0.3) then - self.Weapon:SetNextPrimaryFire(CurTime()+0.3) -- Make it so you can't shoot for another quarter second - end -- Lower the gun - end - - if self.Owner:KeyReleased(IN_USE) || self.Owner:KeyReleased (IN_SPEED) then -- If you release E then - self:SetIronsights(false, self.Owner) -- Set the ironsight true - self.DrawCrosshair = self.XHair - end - - if self.Owner:KeyPressed(IN_SPEED) || self.Owner:KeyPressed(IN_USE) then -- If you run then - self.Owner:SetFOV( 0, 0.2 ) - self.DrawCrosshair = false - if CLIENT then return end - self.Owner:DrawViewModel(true) - end - - if self.Owner:KeyPressed(IN_ATTACK2) and !self.Owner:KeyDown(IN_SPEED) and not (self.Weapon:GetNWBool("Reloading")) then - self.Owner:SetFOV( 75/self.Secondary.ScopeZoom, 0.15 ) - self.IronSightsPos = self.SightsPos -- Bring it up - self.IronSightsAng = self.SightsAng -- Bring it up + if self.Owner:KeyPressed(IN_ATTACK2) and not (self.Weapon:GetNWBool("Reloading")) then + self.Owner:SetFOV( 75/self.Secondary.ScopeZoom, 0.15 ) self.DrawCrosshair = false self:SetIronsights(true, self.Owner) if CLIENT then return end self.Owner:DrawViewModel(false) - elseif self.Owner:KeyPressed(IN_ATTACK2) and not (self.Weapon:GetNWBool("Reloading")) and self.Owner:KeyDown(IN_SPEED) then - if self.Weapon:GetNextPrimaryFire() <= (CurTime()+0.3) then - self.Weapon:SetNextPrimaryFire(CurTime()+0.3) -- Make it so you can't shoot for another quarter second - end - self.IronSightsPos = self.RunSightsPos -- Hold it down - self.IronSightsAng = self.RunSightsAng -- Hold it down - self:SetIronsights(true, self.Owner) -- Set the ironsight true - self.Owner:SetFOV( 0, 0.2 ) end - if (self.Owner:KeyReleased(IN_ATTACK2) || self.Owner:KeyDown(IN_SPEED)) and !self.Owner:KeyDown(IN_USE) and !self.Owner:KeyDown(IN_SPEED) then + if (self.Owner:KeyReleased(IN_ATTACK2)) then self.Owner:SetFOV( 0, 0.2 ) self:SetIronsights(false, self.Owner) self.DrawCrosshair = self.XHair @@ -349,20 +289,12 @@ function SWEP:IronSight() if CLIENT then return end self.Owner:DrawViewModel(true) end - - if self.Owner:KeyDown(IN_ATTACK2) and !self.Owner:KeyDown(IN_USE) and !self.Owner:KeyDown(IN_SPEED) then - self.SwayScale = 0.05 - self.BobScale = 0.05 - else - self.SwayScale = 1.0 - self.BobScale = 1.0 - end end function SWEP:DrawHUD() - if self.Owner:KeyDown(IN_ATTACK2) and (self:GetIronsights() == true) and (!self.Owner:KeyDown(IN_SPEED) and !self.Owner:KeyDown(IN_USE)) then + if self.Owner:KeyDown(IN_ATTACK2) and (self:GetIronsights() == true) then if self.Secondary.UseACOG then -- Draw the FAKE SCOPE THANG @@ -451,11 +383,11 @@ function SWEP:DrawHUD() end end + function SWEP:AdjustMouseSensitivity() - if self.Owner:KeyDown(IN_ATTACK2) then return (1/(self.Secondary.ScopeZoom/2)) else - return 1 - end + return 1 + end end \ No newline at end of file diff --git a/m9k_assault_rifles_fatal_edition/lua/weapons/bobs_shotty_base/shared.lua b/m9k_assault_rifles_fatal_edition/lua/weapons/bobs_shotty_base/shared.lua index c8b9531..2f1ce7f 100644 --- a/m9k_assault_rifles_fatal_edition/lua/weapons/bobs_shotty_base/shared.lua +++ b/m9k_assault_rifles_fatal_edition/lua/weapons/bobs_shotty_base/shared.lua @@ -23,7 +23,7 @@ SWEP.Primary.DefaultClip = 0 // Default number of bullets in a clip SWEP.Primary.KickUp = 0 // Maximum up recoil (rise) SWEP.Primary.KickDown = 0 // Maximum down recoil (skeet) SWEP.Primary.KickHorizontal = 0 // Maximum side recoil (koolaid) -SWEP.Primary.Automatic = true // Automatic/Semi Auto +SWEP.Primary.Automatic = false // Automatic/Semi Auto SWEP.Primary.Ammo = "none" // What kind of ammo SWEP.Primary.Reloading = false // Reloading func @@ -95,7 +95,7 @@ function SWEP:Deploy() self.Weapon:SendWeaponAnim(ACT_VM_DRAW) - self.Weapon:SetNextPrimaryFire(CurTime() + .25) + self.Weapon:SetNextPrimaryFire(CurTime() + .13) self.Weapon:SetNextSecondaryFire(CurTime() + .25) self.ActionDelay = (CurTime() + .25) @@ -103,7 +103,7 @@ function SWEP:Deploy() self:SetIronsights(false) end - self.Owner.NextReload = CurTime() + 1 + self.Owner.NextReload = CurTime() return true end @@ -127,7 +127,7 @@ function SWEP:Reload() if self.Owner:IsPlayer() then if self.Weapon:GetNextPrimaryFire() <= (CurTime()+2) then - self.Weapon:SetNextPrimaryFire(CurTime() + 2) -- wait TWO seconds before you can shoot again + self.Weapon:SetNextPrimaryFire(CurTime()) -- wait TWO seconds before you can shoot again end self.Weapon:SendWeaponAnim(ACT_SHOTGUN_RELOAD_START) -- sending start reload anim self.Owner:SetAnimation( PLAYER_RELOAD ) @@ -190,3 +190,39 @@ end function SWEP:ShellAnimCaller() self.Weapon:SendWeaponAnim(ACT_VM_RELOAD) end + +function SWEP:PrimaryAttack() + + -- Make sure we can shoot first + if ( !self:CanPrimaryAttack() ) then return end + + -- Play shoot sound + self:EmitSound(self.Primary.Sound) + + self:ShootBullet(0,0,0) + self:ShootBullet(0,0,0) + self:ShootBullet(0.015,0,0) + self:ShootBullet(-0.015,0,0) + self:ShootBullet(0,0.015,0) + self:ShootBullet(0,-0.015,0) + self:ShootBullet(0.015,0.015,0) + self:ShootBullet(-0.015,0.015,0) + self:ShootBullet(-0.015,-0.015,0) + self:ShootBullet(0.015,-0.015,0) + + -- Remove 1 bullet from our clip + self:TakePrimaryAmmo( 1 ) + + + + if CLIENT and !game.SinglePlayer() and !self.Owner:IsNPC() then + + local anglo = Angle(-self.Primary.Recoil) + local eyes = self.Owner:EyeAngles() + eyes.pitch = eyes.pitch + (anglo.pitch/3) + eyes.yaw = eyes.yaw + (anglo.yaw/3) + self.Owner:SetEyeAngles(eyes) + end + + self.Weapon:SetNextPrimaryFire(CurTime()+1/(self.Primary.RPM/60)) +end \ No newline at end of file diff --git a/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_acr/shared.lua b/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_acr/shared.lua index 73f694d..852f7c9 100644 --- a/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_acr/shared.lua +++ b/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_acr/shared.lua @@ -11,7 +11,7 @@ SWEP.Instructions = "" SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models SWEP.PrintName = "ACR" -- Weapon name (Shown on HUD) -SWEP.Slot = 2 -- Slot in the weapon selection menu +SWEP.Slot = 1 -- Slot in the weapon selection menu SWEP.SlotPos = 21 -- Position in the slot SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box @@ -36,12 +36,12 @@ SWEP.AdminSpawnable = true SWEP.FiresUnderwater = false SWEP.Primary.Sound = Sound("Masada.Single") -- Script that calls the primary fire sound -SWEP.Primary.RPM = 825 -- This is in Rounds Per Minute +SWEP.Primary.RPM = 1000 -- This is in Rounds Per Minute SWEP.Primary.ClipSize = 30 -- Size of a clip SWEP.Primary.DefaultClip = 60 -- Bullets you start with SWEP.Primary.KickUp = 0.3 -- Maximum up recoil (rise) -SWEP.Primary.KickDown = 0.3 -- Maximum down recoil (skeet) -SWEP.Primary.KickHorizontal = 0.3 -- Maximum up recoil (stock) +SWEP.Primary.KickDown = 0 -- Maximum down recoil (skeet) +SWEP.Primary.KickHorizontal = 0 -- Maximum up recoil (stock) SWEP.Primary.Automatic = true -- Automatic = true; Semi Auto = false SWEP.Primary.Ammo = "ar2" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun -- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets @@ -52,9 +52,9 @@ SWEP.data = {} --The starting firemode SWEP.data.ironsights = 1 SWEP.Primary.NumShots = 1 -- How many bullets to shoot per trigger pull -SWEP.Primary.Damage = 30 -- Base damage per bullet -SWEP.Primary.Spread = .025 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .015 -- Ironsight accuracy, should be the same for shotguns +SWEP.Primary.Damage = 25 -- Base damage per bullet +SWEP.Primary.Spread = 0 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = 0 -- Ironsight accuracy, should be the same for shotguns -- Enter iron sight info and bone mod info below SWEP.IronSightsPos = Vector(2.668, 0, 0.675) @@ -76,4 +76,6 @@ if GetConVar("M9KUniqueSlots") != nil then if not (GetConVar("M9KUniqueSlots"):GetBool()) then SWEP.SlotPos = 2 end -end \ No newline at end of file +end +SWEP.Primary.KickUp = 0.5 +SWEP.Primary.Recoil = 0.3 \ No newline at end of file diff --git a/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_ak47/shared.lua b/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_ak47/shared.lua index 0ed9543..6f4049f 100644 --- a/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_ak47/shared.lua +++ b/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_ak47/shared.lua @@ -11,7 +11,7 @@ SWEP.Instructions = "" SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models SWEP.PrintName = "AK-47" -- Weapon name (Shown on HUD) -SWEP.Slot = 2 -- Slot in the weapon selection menu +SWEP.Slot = 1 -- Slot in the weapon selection menu SWEP.SlotPos = 22 -- Position in the slot SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box @@ -37,12 +37,12 @@ SWEP.AdminSpawnable = true SWEP.FiresUnderwater = false SWEP.Primary.Sound = Sound("47ak.Single") -- Script that calls the primary fire sound -SWEP.Primary.RPM = 600 -- This is in Rounds Per Minute +SWEP.Primary.RPM = 650 -- This is in Rounds Per Minute SWEP.Primary.ClipSize = 30 -- Size of a clip SWEP.Primary.DefaultClip = 60 -- Bullets you start with -SWEP.Primary.KickUp = 0.3 -- Maximum up recoil (rise) -SWEP.Primary.KickDown = 0.3 -- Maximum down recoil (skeet) -SWEP.Primary.KickHorizontal = 0.3 -- Maximum up recoil (stock) +SWEP.Primary.KickUp = 1 -- Maximum up recoil (rise) +SWEP.Primary.KickDown = 1 -- Maximum down recoil (skeet) +SWEP.Primary.KickHorizontal = 0.5 -- Maximum up recoil (stock) SWEP.Primary.Automatic = true -- Automatic = true; Semi Auto = false SWEP.Primary.Ammo = "ar2" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun -- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets @@ -54,8 +54,8 @@ SWEP.data.ironsights = 1 SWEP.Primary.NumShots = 1 -- How many bullets to shoot per trigger pull SWEP.Primary.Damage = 30 -- Base damage per bullet -SWEP.Primary.Spread = .023 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .013 -- Ironsight accuracy, should be the same for shotguns +SWEP.Primary.Spread = 0 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = 0 -- Ironsight accuracy, should be the same for shotguns -- Enter iron sight info and bone mod info below -- SWEP.IronSightsPos = Vector(4.394, -3.75, 1.48) @@ -83,4 +83,7 @@ if GetConVar("M9KUniqueSlots") != nil then if not (GetConVar("M9KUniqueSlots"):GetBool()) then SWEP.SlotPos = 2 end -end \ No newline at end of file +end +SWEP.Primary.KickUp = 0.5 +SWEP.Primary.Recoil = 0.3 + diff --git a/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_ak74/shared.lua b/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_ak74/shared.lua index 81d19da..7a0a52c 100644 --- a/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_ak74/shared.lua +++ b/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_ak74/shared.lua @@ -11,7 +11,7 @@ SWEP.Instructions = "" SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models SWEP.PrintName = "AK-74" -- Weapon name (Shown on HUD) -SWEP.Slot = 2 -- Slot in the weapon selection menu +SWEP.Slot = 1 -- Slot in the weapon selection menu SWEP.SlotPos = 23 -- Position in the slot SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box @@ -36,12 +36,12 @@ SWEP.AdminSpawnable = true SWEP.FiresUnderwater = false SWEP.Primary.Sound = Sound("Tactic_AK47.Single") -- Script that calls the primary fire sound -SWEP.Primary.RPM = 600 -- This is in Rounds Per Minute +SWEP.Primary.RPM = 1000 -- This is in Rounds Per Minute SWEP.Primary.ClipSize = 30 -- Size of a clip SWEP.Primary.DefaultClip = 60 -- Bullets you start with -SWEP.Primary.KickUp = 0.4 -- Maximum up recoil (rise) -SWEP.Primary.KickDown = 0.4 -- Maximum down recoil (skeet) -SWEP.Primary.KickHorizontal = 0.4 -- Maximum up recoil (stock) +SWEP.Primary.KickUp = 0.5 -- Maximum up recoil (rise) +SWEP.Primary.KickDown = 0.5 -- Maximum down recoil (skeet) +SWEP.Primary.KickHorizontal = 0.5 -- Maximum up recoil (stock) SWEP.Primary.Automatic = true -- Automatic = true; Semi Auto = false SWEP.Primary.Ammo = "ar2" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun -- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets @@ -52,9 +52,9 @@ SWEP.data = {} --The starting firemode SWEP.data.ironsights = 1 SWEP.Primary.NumShots = 1 -- How many bullets to shoot per trigger pull -SWEP.Primary.Damage = 31 -- Base damage per bullet -SWEP.Primary.Spread = .02 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .01 -- Ironsight accuracy, should be the same for shotguns +SWEP.Primary.Damage = 25 -- Base damage per bullet +SWEP.Primary.Spread = 0 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = 0 -- Ironsight accuracy, should be the same for shotguns -- Enter iron sight info and bone mod info below SWEP.IronSightsPos = Vector (2.0378, -3.8941, 0.8809) @@ -76,4 +76,6 @@ if GetConVar("M9KUniqueSlots") != nil then if not (GetConVar("M9KUniqueSlots"):GetBool()) then SWEP.SlotPos = 2 end -end \ No newline at end of file +end +SWEP.Primary.KickUp = 0.5 +SWEP.Primary.Recoil = 0.3 \ No newline at end of file diff --git a/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_amd65/shared.lua b/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_amd65/shared.lua index 2be3dc2..8f0df7e 100644 --- a/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_amd65/shared.lua +++ b/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_amd65/shared.lua @@ -11,7 +11,7 @@ SWEP.Instructions = "" SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models SWEP.PrintName = "AMD 65" -- Weapon name (Shown on HUD) -SWEP.Slot = 2 -- Slot in the weapon selection menu +SWEP.Slot = 1 -- Slot in the weapon selection menu SWEP.SlotPos = 24 -- Position in the slot SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box @@ -32,12 +32,12 @@ SWEP.AdminSpawnable = true SWEP.FiresUnderwater = false SWEP.Primary.Sound = Sound("amd65.single") -- Script that calls the primary fire sound -SWEP.Primary.RPM = 750 -- This is in Rounds Per Minute -SWEP.Primary.ClipSize = 20 -- Size of a clip +SWEP.Primary.RPM = 1000 -- This is in Rounds Per Minute +SWEP.Primary.ClipSize = 30 -- Size of a clip SWEP.Primary.DefaultClip = 60 -- Bullets you start with -SWEP.Primary.KickUp = .7 -- Maximum up recoil (rise) -SWEP.Primary.KickDown = 0.2 -- Maximum down recoil (skeet) -SWEP.Primary.KickHorizontal = 0.4 -- Maximum up recoil (stock) +SWEP.Primary.KickUp = 0.5 -- Maximum up recoil (rise) +SWEP.Primary.KickDown = 0.5 -- Maximum down recoil (skeet) +SWEP.Primary.KickHorizontal = 0.5 -- Maximum up recoil (stock) SWEP.Primary.Automatic = true -- Automatic = true; Semi Auto = false SWEP.Primary.Ammo = "ar2" @@ -47,9 +47,9 @@ SWEP.data = {} --The starting firemode SWEP.data.ironsights = 1 SWEP.Primary.NumShots = 1 -- How many bullets to shoot per trigger pull -SWEP.Primary.Damage = 31 -- Base damage per bullet -SWEP.Primary.Spread = .021 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .011 -- Ironsight accuracy, should be the same for shotguns +SWEP.Primary.Damage = 25 -- Base damage per bullet +SWEP.Primary.Spread = 0 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = 0 -- Ironsight accuracy, should be the same for shotguns SWEP.SelectiveFire = true @@ -79,4 +79,6 @@ if GetConVar("M9KUniqueSlots") != nil then if not (GetConVar("M9KUniqueSlots"):GetBool()) then SWEP.SlotPos = 2 end -end \ No newline at end of file +end +SWEP.Primary.KickUp = 0.5 +SWEP.Primary.Recoil = 0.3 \ No newline at end of file diff --git a/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_an94/shared.lua b/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_an94/shared.lua index 6b5d242..7bf278f 100644 --- a/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_an94/shared.lua +++ b/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_an94/shared.lua @@ -11,7 +11,7 @@ SWEP.Instructions = "" SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models SWEP.PrintName = "AN-94" -- Weapon name (Shown on HUD) -SWEP.Slot = 2 -- Slot in the weapon selection menu +SWEP.Slot = 1 -- Slot in the weapon selection menu SWEP.SlotPos = 25 -- Position in the slot SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box @@ -35,17 +35,17 @@ SWEP.AdminSpawnable = true SWEP.FiresUnderwater = false SWEP.Primary.Sound = Sound("an94.Single") -- Script that calls the primary fire sound -SWEP.Primary.RPM = 600 -- This is in Rounds Per Minute +SWEP.Primary.RPM = 650 -- This is in Rounds Per Minute SWEP.Primary.ClipSize = 30 -- Size of a clip SWEP.Primary.DefaultClip = 60 -- Bullets you start with -SWEP.Primary.KickUp = 0.3 -- Maximum up recoil (rise) -SWEP.Primary.KickDown = 0.1 -- Maximum down recoil (skeet) -SWEP.Primary.KickHorizontal = 0.3 -- Maximum up recoil (stock) +SWEP.Primary.KickUp = 1 -- Maximum up recoil (rise) +SWEP.Primary.KickDown = 1 -- Maximum down recoil (skeet) +SWEP.Primary.KickHorizontal = 0.5 -- Maximum up recoil (stock) SWEP.Primary.Automatic = true -- Automatic = true; Semi Auto = false SWEP.Primary.Ammo = "ar2" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun -- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets -SWEP.SelectiveFire = true +SWEP.SelectiveFire = false SWEP.Secondary.IronFOV = 55 -- How much you 'zoom' in. Less is more! @@ -53,9 +53,9 @@ SWEP.data = {} --The starting firemode SWEP.data.ironsights = 1 SWEP.Primary.NumShots = 1 -- How many bullets to shoot per trigger pull -SWEP.Primary.Damage = 31 -- Base damage per bullet -SWEP.Primary.Spread = .015 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .005 -- Ironsight accuracy, should be the same for shotguns +SWEP.Primary.Damage = 30 -- Base damage per bullet +SWEP.Primary.Spread = 0 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = 0 -- Ironsight accuracy, should be the same for shotguns -- Enter iron sight info and bone mod info below SWEP.IronSightsPos = Vector(4.552, 0, 3.062) @@ -67,90 +67,7 @@ SWEP.RunSightsAng = Vector(-12.954, -52.088, 0) SWEP.Primary.Burst = false -function SWEP:SelectFireMode() - if self.Primary.Burst then - self.Primary.Burst = false - self.NextFireSelect = CurTime() + .5 - if CLIENT then - self.Owner:PrintMessage(HUD_PRINTTALK, "Automatic selected.") - end - self.Weapon:EmitSound("Weapon_AR2.Empty") - self.Primary.NumShots = 1 - self.Primary.Sound = Sound("an94.single") - self.Primary.Automatic = true - else - self.Primary.Burst = true - self.NextFireSelect = CurTime() + .5 - if CLIENT then - self.Owner:PrintMessage(HUD_PRINTTALK, "Burst fire selected.") - end - self.Weapon:EmitSound("Weapon_AR2.Empty") - self.Primary.NumShots = 2 - self.Primary.Sound = Sound("an94.double") - self.Primary.Automatic = false - end -end - -SWEP.Primary.PrevShots = SWEP.Primary.NumShots - -function SWEP:PrimaryAttack() - if self:CanPrimaryAttack() and self.Owner:IsPlayer() then - self.ShootThese = self.Primary.NumShots - - if self.Primary.Burst then - if self.Primary.NumShots > self.Owner:GetActiveWeapon():Clip1() then - self.Primary.NumShots = 1 - self.ShootThese = 1 - self.Primary.Sound = Sound("an94.single") - else - self.Primary.NumShots = 2 - self.ShootThese = 2 - self.Primary.Sound = Sound("an94.double") - end - end - - - if !self.Owner:KeyDown(IN_SPEED) and !self.Owner:KeyDown(IN_RELOAD) then - self:ShootBulletInformation() - self.Weapon:TakePrimaryAmmo(self.ShootThese) - - if self.Silenced then - self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK_SILENCED ) - self.Weapon:EmitSound(self.Primary.SilencedSound) - else - self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK ) - self.Weapon:EmitSound(self.Primary.Sound) - end - - local fx = EffectData() - fx:SetEntity(self.Weapon) - fx:SetOrigin(self.Owner:GetShootPos()) - fx:SetNormal(self.Owner:GetAimVector()) - fx:SetAttachment(self.MuzzleAttachment) - if GetConVar("M9KGasEffect") != nil then - if GetConVar("M9KGasEffect"):GetBool() then - util.Effect("m9k_rg_muzzle_rifle",fx) - end - end - self.Owner:SetAnimation( PLAYER_ATTACK1 ) - self.Owner:MuzzleFlash() - self.Weapon:SetNextPrimaryFire(CurTime()+1/(self.Primary.RPM/60)) - self:CheckWeaponsAndAmmo() - self.RicochetCoin = (math.random(1,4)) - if self.BoltAction then self:BoltBack() end - end - elseif self:CanPrimaryAttack() and self.Owner:IsNPC() then - self:ShootBulletInformation() - self.Weapon:TakePrimaryAmmo(self.ShootThese) - self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK ) - self.Weapon:EmitSound(self.Primary.Sound) - self.Owner:SetAnimation( PLAYER_ATTACK1 ) - self.Owner:MuzzleFlash() - self.Weapon:SetNextPrimaryFire(CurTime()+1/(self.Primary.RPM/60)) - self.RicochetCoin = (math.random(1,4)) - end -end if GetConVar("M9KDefaultClip") == nil then print("M9KDefaultClip is missing! You may have hit the lua limit!") @@ -164,4 +81,6 @@ if GetConVar("M9KUniqueSlots") != nil then if not (GetConVar("M9KUniqueSlots"):GetBool()) then SWEP.SlotPos = 2 end -end \ No newline at end of file +end +SWEP.Primary.KickUp = 0.5 +SWEP.Primary.Recoil = 0.3 \ No newline at end of file diff --git a/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_auga3/shared.lua b/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_auga3/shared.lua index ebfbe6f..0b39b9c 100644 --- a/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_auga3/shared.lua +++ b/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_auga3/shared.lua @@ -11,7 +11,7 @@ SWEP.Instructions = "" SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models SWEP.PrintName = "Steyr AUG A3" -- Weapon name (Shown on HUD) -SWEP.Slot = 2 -- Slot in the weapon selection menu +SWEP.Slot = 1 -- Slot in the weapon selection menu SWEP.SlotPos = 26 -- Position in the slot SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box @@ -35,12 +35,12 @@ SWEP.Spawnable = true SWEP.AdminSpawnable = true SWEP.Primary.Sound = Sound("aug_a3.Single") -- script that calls the primary fire sound -SWEP.Primary.RPM = 700 -- This is in Rounds Per Minute +SWEP.Primary.RPM = 650 -- This is in Rounds Per Minute SWEP.Primary.ClipSize = 30 -- Size of a clip SWEP.Primary.DefaultClip = 60 -- Bullets you start with -SWEP.Primary.KickUp = .4 -- Maximum up recoil (rise) -SWEP.Primary.KickDown = .4 -- Maximum down recoil (skeet) -SWEP.Primary.KickHorizontal = .5 -- Maximum up recoil (stock) +SWEP.Primary.KickUp = .1 -- Maximum up recoil (rise) +SWEP.Primary.KickDown = .1 -- Maximum down recoil (skeet) +SWEP.Primary.KickHorizontal = .1 -- Maximum up recoil (stock) SWEP.Primary.Automatic = true -- Automatic/Semi Auto SWEP.Primary.Ammo = "ar2" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun -- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets @@ -62,9 +62,9 @@ SWEP.ScopeScale = 0.5 SWEP.ReticleScale = 0.6 SWEP.Primary.NumShots = 1 --how many bullets to shoot per trigger pull -SWEP.Primary.Damage = 22 --base damage per bullet -SWEP.Primary.Spread = .025 --define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .02 -- ironsight accuracy, should be the same for shotguns +SWEP.Primary.Damage = 30 --base damage per bullet +SWEP.Primary.Spread = 0 --define from-the-hip accuracy 1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = 0 -- ironsight accuracy, should be the same for shotguns -- enter iron sight info and bone mod info below @@ -87,4 +87,6 @@ if GetConVar("M9KUniqueSlots") != nil then if not (GetConVar("M9KUniqueSlots"):GetBool()) then SWEP.SlotPos = 2 end -end \ No newline at end of file +end +SWEP.Primary.KickUp = 0.5 +SWEP.Primary.Recoil = 0.3 \ No newline at end of file diff --git a/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_f2000/shared.lua b/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_f2000/shared.lua index 7f80688..2ba5963 100644 --- a/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_f2000/shared.lua +++ b/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_f2000/shared.lua @@ -11,7 +11,7 @@ SWEP.Instructions = "" SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models SWEP.PrintName = "F2000" -- Weapon name (Shown on HUD) -SWEP.Slot = 2 -- Slot in the weapon selection menu +SWEP.Slot = 1 -- Slot in the weapon selection menu SWEP.SlotPos = 27 -- Position in the slot SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box @@ -35,12 +35,12 @@ SWEP.Spawnable = true SWEP.AdminSpawnable = true SWEP.Primary.Sound = Sound("Weapon_F2000.Single") -- script that calls the primary fire sound -SWEP.Primary.RPM = 850 -- This is in Rounds Per Minute +SWEP.Primary.RPM = 1000 -- This is in Rounds Per Minute SWEP.Primary.ClipSize = 30 -- Size of a clip SWEP.Primary.DefaultClip = 60 -- Bullets you start with -SWEP.Primary.KickUp = .4 -- Maximum up recoil (rise) -SWEP.Primary.KickDown = .4 -- Maximum down recoil (skeet) -SWEP.Primary.KickHorizontal = .4 -- Maximum up recoil (stock) +SWEP.Primary.KickUp = .5 -- Maximum up recoil (rise) +SWEP.Primary.KickDown = .5 -- Maximum down recoil (skeet) +SWEP.Primary.KickHorizontal = .5 -- Maximum up recoil (stock) SWEP.Primary.Automatic = true -- Automatic/Semi Auto SWEP.Primary.Ammo = "smg1" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun -- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets @@ -62,9 +62,9 @@ SWEP.ScopeScale = 0.5 SWEP.ReticleScale = 0.6 SWEP.Primary.NumShots = 1 --how many bullets to shoot per trigger pull -SWEP.Primary.Damage = 23 --base damage per bullet -SWEP.Primary.Spread = .025 --define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .015 -- ironsight accuracy, should be the same for shotguns +SWEP.Primary.Damage = 25 --base damage per bullet +SWEP.Primary.Spread = 0 --define from-the-hip accuracy 1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = 0 -- ironsight accuracy, should be the same for shotguns -- enter iron sight info and bone mod info below @@ -87,4 +87,6 @@ if GetConVar("M9KUniqueSlots") != nil then if not (GetConVar("M9KUniqueSlots"):GetBool()) then SWEP.SlotPos = 2 end -end \ No newline at end of file +end +SWEP.Primary.KickUp = 0.5 +SWEP.Primary.Recoil = 0.3 \ No newline at end of file diff --git a/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_fal/shared.lua b/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_fal/shared.lua index 3b19b0f..1d6259a 100644 --- a/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_fal/shared.lua +++ b/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_fal/shared.lua @@ -11,7 +11,7 @@ SWEP.Instructions = "" SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models SWEP.PrintName = "FN FAL" -- Weapon name (Shown on HUD) -SWEP.Slot = 2 -- Slot in the weapon selection menu +SWEP.Slot = 1 -- Slot in the weapon selection menu SWEP.SlotPos = 28 -- Position in the slot SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box @@ -35,13 +35,13 @@ SWEP.AdminSpawnable = true SWEP.FiresUnderwater = false SWEP.Primary.Sound = Sound("fnfal.Single") -- Script that calls the primary fire sound -SWEP.Primary.RPM = 750 -- This is in Rounds Per Minute -SWEP.Primary.ClipSize = 20 -- Size of a clip +SWEP.Primary.RPM = 1000 -- This is in Rounds Per Minute +SWEP.Primary.ClipSize = 30 -- Size of a clip SWEP.Primary.DefaultClip = 60 -- Bullets you start with SWEP.Primary.KickUp = 0.5 -- Maximum up recoil (rise) -SWEP.Primary.KickDown = 0.3 -- Maximum down recoil (skeet) +SWEP.Primary.KickDown = 0.5 -- Maximum down recoil (skeet) SWEP.Primary.KickHorizontal = 0.5 -- Maximum up recoil (stock) -SWEP.Primary.Automatic = false -- Automatic = true; Semi Auto = false +SWEP.Primary.Automatic = true -- Automatic = true; Semi Auto = false SWEP.Primary.Ammo = "ar2" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun -- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets @@ -53,9 +53,9 @@ SWEP.data = {} --The starting firemode SWEP.data.ironsights = 1 SWEP.Primary.NumShots = 1 -- How many bullets to shoot per trigger pull -SWEP.Primary.Damage = 30 -- Base damage per bullet -SWEP.Primary.Spread = .02 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .01 -- Ironsight accuracy, should be the same for shotguns +SWEP.Primary.Damage = 25 -- Base damage per bullet +SWEP.Primary.Spread = 0 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = 0 -- Ironsight accuracy, should be the same for shotguns -- Enter iron sight info and bone mod info below SWEP.IronSightsPos = Vector(-3.161, -1.068, 1.24) @@ -77,4 +77,6 @@ if GetConVar("M9KUniqueSlots") != nil then if not (GetConVar("M9KUniqueSlots"):GetBool()) then SWEP.SlotPos = 2 end -end \ No newline at end of file +end +SWEP.Primary.KickUp = 0.5 +SWEP.Primary.Recoil = 0.3 \ No newline at end of file diff --git a/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_famas/shared.lua b/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_famas/shared.lua index 82e7973..2c1be58 100644 --- a/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_famas/shared.lua +++ b/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_famas/shared.lua @@ -11,7 +11,7 @@ SWEP.Instructions = "" SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models SWEP.PrintName = "FAMAS" -- Weapon name (Shown on HUD) -SWEP.Slot = 2 -- Slot in the weapon selection menu +SWEP.Slot = 1 -- Slot in the weapon selection menu SWEP.SlotPos = 29 -- Position in the slot SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box @@ -34,12 +34,12 @@ SWEP.AdminSpawnable = true SWEP.FiresUnderwater = false SWEP.Primary.Sound = Sound("Weapon_FAMTC.Single") -- Script that calls the primary fire sound -SWEP.Primary.RPM = 950 -- This is in Rounds Per Minute +SWEP.Primary.RPM = 1000 -- This is in Rounds Per Minute SWEP.Primary.ClipSize = 30 -- Size of a clip SWEP.Primary.DefaultClip = 60 -- Bullets you start with -SWEP.Primary.KickUp = 0.4 -- Maximum up recoil (rise) -SWEP.Primary.KickDown = 0.4 -- Maximum down recoil (skeet) -SWEP.Primary.KickHorizontal = 0.4 -- Maximum up recoil (stock) +SWEP.Primary.KickUp = 0.5 -- Maximum up recoil (rise) +SWEP.Primary.KickDown = 0.5 -- Maximum down recoil (skeet) +SWEP.Primary.KickHorizontal = 0.5 -- Maximum up recoil (stock) SWEP.Primary.Automatic = true -- Automatic = true; Semi Auto = false SWEP.Primary.Ammo = "ar2" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun -- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets @@ -52,9 +52,9 @@ SWEP.data = {} --The starting firemode SWEP.data.ironsights = 1 SWEP.Primary.NumShots = 1 -- How many bullets to shoot per trigger pull -SWEP.Primary.Damage = 29 -- Base damage per bullet -SWEP.Primary.Spread = .025 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .015 -- Ironsight accuracy, should be the same for shotguns +SWEP.Primary.Damage = 25 -- Base damage per bullet +SWEP.Primary.Spread = 0 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = 0 -- Ironsight accuracy, should be the same for shotguns -- Enter iron sight info and bone mod info below SWEP.IronSightsPos = Vector(-3.342, 0, 0.247) @@ -76,4 +76,6 @@ if GetConVar("M9KUniqueSlots") != nil then if not (GetConVar("M9KUniqueSlots"):GetBool()) then SWEP.SlotPos = 2 end -end \ No newline at end of file +end +SWEP.Primary.KickUp = 0.5 +SWEP.Primary.Recoil = 0.3 \ No newline at end of file diff --git a/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_g36/shared.lua b/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_g36/shared.lua index e092c82..0315a2e 100644 --- a/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_g36/shared.lua +++ b/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_g36/shared.lua @@ -11,7 +11,7 @@ SWEP.Instructions = "" SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models SWEP.PrintName = "G36" -- Weapon name (Shown on HUD) -SWEP.Slot = 2 -- Slot in the weapon selection menu +SWEP.Slot = 1 -- Slot in the weapon selection menu SWEP.SlotPos = 31 -- Position in the slot SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box @@ -35,12 +35,12 @@ SWEP.AdminSpawnable = true SWEP.FiresUnderwater = false SWEP.Primary.Sound = Sound("G36.single") -- Script that calls the primary fire sound -SWEP.Primary.RPM = 750 -- This is in Rounds Per Minute +SWEP.Primary.RPM = 1000 -- This is in Rounds Per Minute SWEP.Primary.ClipSize = 30 -- Size of a clip SWEP.Primary.DefaultClip = 60 -- Bullets you start with -SWEP.Primary.KickUp = 0.3 -- Maximum up recoil (rise) -SWEP.Primary.KickDown = 0.3 -- Maximum down recoil (skeet) -SWEP.Primary.KickHorizontal = 0.3 -- Maximum up recoil (stock) +SWEP.Primary.KickUp = 0.5 -- Maximum up recoil (rise) +SWEP.Primary.KickDown = 0.5 -- Maximum down recoil (skeet) +SWEP.Primary.KickHorizontal = 0.5 -- Maximum up recoil (stock) SWEP.Primary.Automatic = true -- Automatic = true; Semi Auto = false SWEP.Primary.Ammo = "ar2" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun -- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets @@ -53,9 +53,9 @@ SWEP.data = {} --The starting firemode SWEP.data.ironsights = 1 SWEP.Primary.NumShots = 1 -- How many bullets to shoot per trigger pull -SWEP.Primary.Damage = 28 -- Base damage per bullet -SWEP.Primary.Spread = .02 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .01 -- Ironsight accuracy, should be the same for shotguns +SWEP.Primary.Damage = 25 -- Base damage per bullet +SWEP.Primary.Spread = 0 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = 0 -- Ironsight accuracy, should be the same for shotguns -- Enter iron sight info and bone mod info below SWEP.IronSightsPos = Vector(2.865, -0.857, 1.06) @@ -77,4 +77,6 @@ if GetConVar("M9KUniqueSlots") != nil then if not (GetConVar("M9KUniqueSlots"):GetBool()) then SWEP.SlotPos = 2 end -end \ No newline at end of file +end +SWEP.Primary.KickUp = 0.5 +SWEP.Primary.Recoil = 0.3 \ No newline at end of file diff --git a/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_g3a3/shared.lua b/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_g3a3/shared.lua index 5f3fcab..306a3c0 100644 --- a/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_g3a3/shared.lua +++ b/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_g3a3/shared.lua @@ -11,7 +11,7 @@ SWEP.Instructions = "" SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models SWEP.PrintName = "HK G3A3" -- Weapon name (Shown on HUD) -SWEP.Slot = 2 -- Slot in the weapon selection menu +SWEP.Slot = 1 -- Slot in the weapon selection menu SWEP.SlotPos = 30 -- Position in the slot SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box @@ -35,11 +35,11 @@ SWEP.AdminSpawnable = true SWEP.FiresUnderwater = false SWEP.Primary.Sound = Sound("hk_g3_weapon.Single") -- Script that calls the primary fire sound -SWEP.Primary.RPM = 550 -- This is in Rounds Per Minute -SWEP.Primary.ClipSize = 20 -- Size of a clip +SWEP.Primary.RPM = 650 -- This is in Rounds Per Minute +SWEP.Primary.ClipSize = 30 -- Size of a clip SWEP.Primary.DefaultClip = 60 -- Bullets you start with -SWEP.Primary.KickUp = 0.4 -- Maximum up recoil (rise) -SWEP.Primary.KickDown = 0.3 -- Maximum down recoil (skeet) +SWEP.Primary.KickUp = 1 -- Maximum up recoil (rise) +SWEP.Primary.KickDown = 1 -- Maximum down recoil (skeet) SWEP.Primary.KickHorizontal = 0.5 -- Maximum up recoil (stock) SWEP.Primary.Automatic = true -- Automatic = true; Semi Auto = false SWEP.Primary.Ammo = "ar2" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun @@ -53,9 +53,9 @@ SWEP.data = {} --The starting firemode SWEP.data.ironsights = 1 SWEP.Primary.NumShots = 1 -- How many bullets to shoot per trigger pull -SWEP.Primary.Damage = 33 -- Base damage per bullet -SWEP.Primary.Spread = .026 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .016 -- Ironsight accuracy, should be the same for shotguns +SWEP.Primary.Damage = 30 -- Base damage per bullet +SWEP.Primary.Spread = 0 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = 0 -- Ironsight accuracy, should be the same for shotguns -- Enter iron sight info and bone mod info below SWEP.IronSightsPos = Vector(-2.419, -2.069, 1.498) @@ -78,4 +78,6 @@ if GetConVar("M9KUniqueSlots") != nil then if not (GetConVar("M9KUniqueSlots"):GetBool()) then SWEP.SlotPos = 2 end -end \ No newline at end of file +end +SWEP.Primary.KickUp = 0.5 +SWEP.Primary.Recoil = 0.3 \ No newline at end of file diff --git a/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_l85/shared.lua b/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_l85/shared.lua index 3c2e895..f1e2553 100644 --- a/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_l85/shared.lua +++ b/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_l85/shared.lua @@ -11,7 +11,7 @@ SWEP.Instructions = "" SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models SWEP.PrintName = "L85" -- Weapon name (Shown on HUD) -SWEP.Slot = 2 -- Slot in the weapon selection menu +SWEP.Slot = 1 -- Slot in the weapon selection menu SWEP.SlotPos = 32 -- Position in the slot SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box @@ -35,11 +35,11 @@ SWEP.Spawnable = true SWEP.AdminSpawnable = true SWEP.Primary.Sound = Sound("Weapon_l85.Single") -- script that calls the primary fire sound -SWEP.Primary.RPM = 675 -- This is in Rounds Per Minute +SWEP.Primary.RPM = 1000 -- This is in Rounds Per Minute SWEP.Primary.ClipSize = 30 -- Size of a clip SWEP.Primary.DefaultClip = 60 -- Bullets you start with -SWEP.Primary.KickUp = .4 -- Maximum up recoil (rise) -SWEP.Primary.KickDown = .4 -- Maximum down recoil (skeet) +SWEP.Primary.KickUp = .5 -- Maximum up recoil (rise) +SWEP.Primary.KickDown = .5 -- Maximum down recoil (skeet) SWEP.Primary.KickHorizontal = .5 -- Maximum up recoil (stock) SWEP.Primary.Automatic = true -- Automatic/Semi Auto SWEP.Primary.Ammo = "ar2" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun @@ -63,9 +63,9 @@ SWEP.ScopeScale = 0.5 SWEP.ReticleScale = 0.6 SWEP.Primary.NumShots = 1 --how many bullets to shoot per trigger pull -SWEP.Primary.Damage = 29 --base damage per bullet -SWEP.Primary.Spread = .023 --define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .015 -- ironsight accuracy, should be the same for shotguns +SWEP.Primary.Damage = 25 --base damage per bullet +SWEP.Primary.Spread = 0 --define from-the-hip accuracy 1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = 0 -- ironsight accuracy, should be the same for shotguns -- enter iron sight info and bone mod info below @@ -88,4 +88,6 @@ if GetConVar("M9KUniqueSlots") != nil then if not (GetConVar("M9KUniqueSlots"):GetBool()) then SWEP.SlotPos = 2 end -end \ No newline at end of file +end +SWEP.Primary.KickUp = 0.5 +SWEP.Primary.Recoil = 0.3 \ No newline at end of file diff --git a/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_m14sp/shared.lua b/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_m14sp/shared.lua index fed2c99..cc51fae 100644 --- a/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_m14sp/shared.lua +++ b/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_m14sp/shared.lua @@ -11,7 +11,7 @@ SWEP.Instructions = "" SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models SWEP.PrintName = "M14" -- Weapon name (Shown on HUD) -SWEP.Slot = 2 -- Slot in the weapon selection menu +SWEP.Slot = 1 -- Slot in the weapon selection menu SWEP.SlotPos = 34 -- Position in the slot SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box @@ -34,13 +34,13 @@ SWEP.AdminSpawnable = true SWEP.FiresUnderwater = false SWEP.Primary.Sound = Sound("Weapon_M14SP.Single") -- Script that calls the primary fire sound -SWEP.Primary.RPM = 750 -- This is in Rounds Per Minute -SWEP.Primary.ClipSize = 20 -- Size of a clip +SWEP.Primary.RPM = 1000 -- This is in Rounds Per Minute +SWEP.Primary.ClipSize = 30 -- Size of a clip SWEP.Primary.DefaultClip = 60 -- Bullets you start with -SWEP.Primary.KickUp = 0.6 -- Maximum up recoil (rise) -SWEP.Primary.KickDown = 0.6 -- Maximum down recoil (skeet) -SWEP.Primary.KickHorizontal = 0.6 -- Maximum up recoil (stock) -SWEP.Primary.Automatic = false -- Automatic = true; Semi Auto = false +SWEP.Primary.KickUp = 0.5 -- Maximum up recoil (rise) +SWEP.Primary.KickDown = 0.5 -- Maximum down recoil (skeet) +SWEP.Primary.KickHorizontal = 0.5 -- Maximum up recoil (stock) +SWEP.Primary.Automatic = true -- Automatic = true; Semi Auto = false SWEP.Primary.Ammo = "ar2" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun -- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets @@ -52,9 +52,9 @@ SWEP.data = {} --The starting firemode SWEP.data.ironsights = 1 SWEP.Primary.NumShots = 1 -- How many bullets to shoot per trigger pull -SWEP.Primary.Damage = 32 -- Base damage per bullet -SWEP.Primary.Spread = .01 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .001 -- Ironsight accuracy, should be the same for shotguns +SWEP.Primary.Damage = 25 -- Base damage per bullet +SWEP.Primary.Spread = 0 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = 0 -- Ironsight accuracy, should be the same for shotguns -- Enter iron sight info and bone mod info below SWEP.IronSightsPos = Vector (-2.7031, -1.0539, 1.6562) @@ -76,4 +76,6 @@ if GetConVar("M9KUniqueSlots") != nil then if not (GetConVar("M9KUniqueSlots"):GetBool()) then SWEP.SlotPos = 2 end -end \ No newline at end of file +end +SWEP.Primary.KickUp = 0.5 +SWEP.Primary.Recoil = 0.3 \ No newline at end of file diff --git a/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_m16a4_acog/shared.lua b/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_m16a4_acog/shared.lua index 21ee2cb..e02831e 100644 --- a/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_m16a4_acog/shared.lua +++ b/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_m16a4_acog/shared.lua @@ -11,7 +11,7 @@ SWEP.Instructions = "" SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models SWEP.PrintName = "M16A4 ACOG" -- Weapon name (Shown on HUD) -SWEP.Slot = 2 -- Slot in the weapon selection menu +SWEP.Slot = 1 -- Slot in the weapon selection menu SWEP.SlotPos = 35 -- Position in the slot SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box @@ -35,13 +35,13 @@ SWEP.Spawnable = true SWEP.AdminSpawnable = true SWEP.Primary.Sound = Sound("Dmgfok_M16A4.Single") -- script that calls the primary fire sound -SWEP.Primary.RPM = 850 -- This is in Rounds Per Minute +SWEP.Primary.RPM = 1000 -- This is in Rounds Per Minute SWEP.Primary.ClipSize = 30 -- Size of a clip SWEP.Primary.DefaultClip = 60 -- Bullets you start with -SWEP.Primary.KickUp = .4 -- Maximum up recoil (rise) -SWEP.Primary.KickDown = .4 -- Maximum down recoil (skeet) -SWEP.Primary.KickHorizontal = .6 -- Maximum up recoil (stock) -SWEP.Primary.Automatic = false -- Automatic/Semi Auto +SWEP.Primary.KickUp = .5 -- Maximum up recoil (rise) +SWEP.Primary.KickDown = .5 -- Maximum down recoil (skeet) +SWEP.Primary.KickHorizontal = .5 -- Maximum up recoil (stock) +SWEP.Primary.Automatic = true -- Automatic/Semi Auto SWEP.Primary.Ammo = "ar2" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun -- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets SWEP.SelectiveFire = true @@ -60,13 +60,13 @@ SWEP.ScopeScale = 0.5 SWEP.ReticleScale = 0.6 SWEP.Primary.NumShots = 1 --how many bullets to shoot per trigger pull -SWEP.Primary.Damage = 30 --base damage per bullet -SWEP.Primary.Spread = .015 --define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .01 -- ironsight accuracy, should be the same for shotguns +SWEP.Primary.Damage = 25 --base damage per bullet +SWEP.Primary.Spread = 0 --define from-the-hip accuracy 1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = 0 -- ironsight accuracy, should be the same for shotguns -- enter iron sight info and bone mod info below -SWEP.IronSightsPos = Vector (2.275, -2.9708, 0.5303) +SWEP.IronSightsPos = Vector (2.275, 2.9708, 0.5303) SWEP.IronSightsAng = Vector (0, 0, 0) SWEP.SightsPos = Vector (2.275, -2.9708, 0.5303) SWEP.SightsAng = Vector (0, 0, 0) @@ -85,4 +85,6 @@ if GetConVar("M9KUniqueSlots") != nil then if not (GetConVar("M9KUniqueSlots"):GetBool()) then SWEP.SlotPos = 2 end -end \ No newline at end of file +end +SWEP.Primary.KickUp = 0.5 +SWEP.Primary.Recoil = 0.3 \ No newline at end of file diff --git a/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_m416/shared.lua b/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_m416/shared.lua index 63eb45a..93222bd 100644 --- a/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_m416/shared.lua +++ b/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_m416/shared.lua @@ -11,7 +11,7 @@ SWEP.Instructions = "" SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models SWEP.PrintName = "HK 416" -- Weapon name (Shown on HUD) -SWEP.Slot = 2 -- Slot in the weapon selection menu +SWEP.Slot = 1 -- Slot in the weapon selection menu SWEP.SlotPos = 36 -- Position in the slot SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box @@ -36,14 +36,14 @@ SWEP.FiresUnderwater = false SWEP.Primary.Sound = Sound("hk416weapon.UnsilSingle") -- Script that calls the primary fire sound SWEP.Primary.SilencedSound = Sound("hk416weapon.SilencedSingle") -SWEP.Primary.RPM = 800 -- This is in Rounds Per Minute +SWEP.Primary.RPM = 1000 -- This is in Rounds Per Minute SWEP.Primary.ClipSize = 30 -- Size of a clip SWEP.Primary.DefaultClip = 60 -- Bullets you start with -SWEP.Primary.KickUp = 0.4 -- Maximum up recoil (rise) -SWEP.Primary.KickDown = 0.4 -- Maximum down recoil (skeet) -SWEP.Primary.KickHorizontal = 0.6 -- Maximum up recoil (stock) +SWEP.Primary.KickUp = 0.5 +SWEP.Primary.Recoil = 0.3 SWEP.Primary.Automatic = true -- Automatic = true; Semi Auto = false SWEP.CanBeSilenced = true +SWEP.Silenced = true SWEP.Primary.Ammo = "ar2" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun -- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets @@ -53,9 +53,10 @@ SWEP.data = {} --The starting firemode SWEP.data.ironsights = 1 SWEP.Primary.NumShots = 1 -- How many bullets to shoot per trigger pull -SWEP.Primary.Damage = 30 -- Base damage per bullet -SWEP.Primary.Spread = .025 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .015 -- Ironsight accuracy, should be the same for shotguns +SWEP.Primary.Damage = 25 -- Base damage per bullet +SWEP.Primary.Spread = 0 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = 0 -- Ironsight accuracy, should be the same for shotguns + -- Enter iron sight info and bone mod info below SWEP.IronSightsPos = Vector(-2.892, -2.132, 0.5) @@ -67,6 +68,7 @@ SWEP.RunSightsAng = Vector(-18.08, 30.59, 0) SWEP.SelectiveFire = true + if GetConVar("M9KDefaultClip") == nil then print("M9KDefaultClip is missing! You may have hit the lua limit!") else diff --git a/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_m4a1/shared.lua b/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_m4a1/shared.lua index 77ff97d..7055dc3 100644 --- a/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_m4a1/shared.lua +++ b/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_m4a1/shared.lua @@ -11,7 +11,7 @@ SWEP.Instructions = "" SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models SWEP.PrintName = "M4A1 Iron" -- Weapon name (Shown on HUD) -SWEP.Slot = 2 -- Slot in the weapon selection menu +SWEP.Slot = 1 -- Slot in the weapon selection menu SWEP.SlotPos = 33 -- Position in the slot SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box @@ -33,13 +33,13 @@ SWEP.Spawnable = true SWEP.AdminSpawnable = true SWEP.FiresUnderwater = false -SWEP.Primary.Sound = Sound("Dmgfok_M4A1.Single") -- Script that calls the primary fire sound -SWEP.Primary.RPM = 800 -- This is in Rounds Per Minute +SWEP.Primary.Sound = Sound("Dmgfok_M4A1.Single") -- Script that calls the primary fire sound -- This is in Rounds Per Minute +SWEP.Primary.RPM = 1000 SWEP.Primary.ClipSize = 30 -- Size of a clip SWEP.Primary.DefaultClip = 60 -- Bullets you start with -SWEP.Primary.KickUp = 0.4 -- Maximum up recoil (rise) -SWEP.Primary.KickDown = 0.4 -- Maximum down recoil (skeet) -SWEP.Primary.KickHorizontal = 0.5 -- Maximum up recoil (stock) +SWEP.Primary.KickUp = 0.5 -- Maximum up recoil (rise) +SWEP.Primary.KickDown = 0.5 -- Maximum down recoil (skeet) +SWEP.Primary.KickHorizontal = 0.5 -- Maximum up recoil (stock) SWEP.Primary.Automatic = true -- Automatic = true; Semi Auto = false SWEP.Primary.Ammo = "ar2" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun -- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets @@ -52,9 +52,9 @@ SWEP.data = {} --The starting firemode SWEP.data.ironsights = 1 SWEP.Primary.NumShots = 1 -- How many bullets to shoot per trigger pull -SWEP.Primary.Damage = 30 -- Base damage per bullet -SWEP.Primary.Spread = .02 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .01 -- Ironsight accuracy, should be the same for shotguns +SWEP.Primary.Damage = 25 -- Base damage per bullet +SWEP.Primary.Spread = 0 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = 0 -- Ironsight accuracy, should be the same for shotguns -- Enter iron sight info and bone mod info below SWEP.IronSightsPos = Vector (2.4537, 1.0923, 0.2696) @@ -76,4 +76,6 @@ if GetConVar("M9KUniqueSlots") != nil then if not (GetConVar("M9KUniqueSlots"):GetBool()) then SWEP.SlotPos = 2 end -end \ No newline at end of file +end +SWEP.Primary.KickUp = 0.5 +SWEP.Primary.Recoil = 0.3 \ No newline at end of file diff --git a/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_scar/shared.lua b/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_scar/shared.lua index 3d09e61..30085f7 100644 --- a/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_scar/shared.lua +++ b/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_scar/shared.lua @@ -11,7 +11,7 @@ SWEP.Instructions = "" SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models SWEP.PrintName = "SCAR" -- Weapon name (Shown on HUD) -SWEP.Slot = 2 -- Slot in the weapon selection menu +SWEP.Slot = 1 -- Slot in the weapon selection menu SWEP.SlotPos = 37 -- Position in the slot SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box @@ -35,12 +35,12 @@ SWEP.AdminSpawnable = true SWEP.FiresUnderwater = false SWEP.Primary.Sound = Sound("Wep_fnscarh.single") -- Script that calls the primary fire sound -SWEP.Primary.RPM = 625 -- This is in Rounds Per Minute +SWEP.Primary.RPM = 650 -- This is in Rounds Per Minute SWEP.Primary.ClipSize = 30 -- Size of a clip SWEP.Primary.DefaultClip = 60 -- Bullets you start with -SWEP.Primary.KickUp = 0.4 -- Maximum up recoil (rise) -SWEP.Primary.KickDown = 0.3 -- Maximum down recoil (skeet) -SWEP.Primary.KickHorizontal = 0.3 -- Maximum up recoil (stock) +SWEP.Primary.KickUp = 1 -- Maximum up recoil (rise) +SWEP.Primary.KickDown = 1 -- Maximum down recoil (skeet) +SWEP.Primary.KickHorizontal = 0.5 -- Maximum up recoil (stock) SWEP.Primary.Automatic = true -- Automatic = true; Semi Auto = false SWEP.Primary.Ammo = "ar2" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun -- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets @@ -52,8 +52,8 @@ SWEP.data.ironsights = 1 SWEP.Primary.NumShots = 1 -- How many bullets to shoot per trigger pull SWEP.Primary.Damage = 30 -- Base damage per bullet -SWEP.Primary.Spread = .02 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .01 -- Ironsight accuracy, should be the same for shotguns +SWEP.Primary.Spread = 0 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = 0 -- Ironsight accuracy, should be the same for shotguns SWEP.SelectiveFire = true @@ -81,4 +81,6 @@ if GetConVar("M9KUniqueSlots") != nil then if not (GetConVar("M9KUniqueSlots"):GetBool()) then SWEP.SlotPos = 2 end -end \ No newline at end of file +end +SWEP.Primary.KickUp = 0.5 +SWEP.Primary.Recoil = 0.3 \ No newline at end of file diff --git a/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_tar21/shared.lua b/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_tar21/shared.lua index bbd0e73..46a698a 100644 --- a/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_tar21/shared.lua +++ b/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_tar21/shared.lua @@ -11,7 +11,7 @@ SWEP.Instructions = "" SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models SWEP.PrintName = "TAR-21" -- Weapon name (Shown on HUD) -SWEP.Slot = 2 -- Slot in the weapon selection menu +SWEP.Slot = 1 -- Slot in the weapon selection menu SWEP.SlotPos = 38 -- Position in the slot SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box @@ -35,12 +35,12 @@ SWEP.AdminSpawnable = true SWEP.FiresUnderwater = false SWEP.Primary.Sound = Sound("Wep_imitavor.single") -- Script that calls the primary fire sound -SWEP.Primary.RPM = 900 -- This is in Rounds Per Minute +SWEP.Primary.RPM = 1000 -- This is in Rounds Per Minute SWEP.Primary.ClipSize = 30 -- Size of a clip SWEP.Primary.DefaultClip = 60 -- Bullets you start with -SWEP.Primary.KickUp = 0.3 -- Maximum up recoil (rise) -SWEP.Primary.KickDown = 0.3 -- Maximum down recoil (skeet) -SWEP.Primary.KickHorizontal = 0.3 -- Maximum up recoil (stock) +SWEP.Primary.KickUp = 0.5 -- Maximum up recoil (rise) +SWEP.Primary.KickDown = 0.5 -- Maximum down recoil (skeet) +SWEP.Primary.KickHorizontal = 0.5 -- Maximum up recoil (stock) SWEP.Primary.Automatic = true -- Automatic = true; Semi Auto = false SWEP.Primary.Ammo = "ar2" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun -- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets @@ -51,9 +51,9 @@ SWEP.data = {} --The starting firemode SWEP.data.ironsights = 1 SWEP.Primary.NumShots = 1 -- How many bullets to shoot per trigger pull -SWEP.Primary.Damage = 30 -- Base damage per bullet -SWEP.Primary.Spread = .027 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .016 -- Ironsight accuracy, should be the same for shotguns +SWEP.Primary.Damage = 25 -- Base damage per bullet +SWEP.Primary.Spread = 0 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = 0 -- Ironsight accuracy, should be the same for shotguns SWEP.SelectiveFire = true @@ -78,4 +78,6 @@ if GetConVar("M9KUniqueSlots") != nil then if not (GetConVar("M9KUniqueSlots"):GetBool()) then SWEP.SlotPos = 2 end -end \ No newline at end of file +end +SWEP.Primary.KickUp = 0.5 +SWEP.Primary.Recoil = 0.3 \ No newline at end of file diff --git a/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_val/shared.lua b/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_val/shared.lua index 792d46a..f348222 100644 --- a/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_val/shared.lua +++ b/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_val/shared.lua @@ -11,7 +11,7 @@ SWEP.Instructions = "" SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models SWEP.PrintName = "AS VAL" -- Weapon name (Shown on HUD) -SWEP.Slot = 2 -- Slot in the weapon selection menu +SWEP.Slot = 1 -- Slot in the weapon selection menu SWEP.SlotPos = 39 -- Position in the slot SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box @@ -34,11 +34,11 @@ SWEP.AdminSpawnable = true SWEP.FiresUnderwater = false SWEP.Primary.Sound = Sound("Dmgfok_vally.Single") -- Script that calls the primary fire sound -SWEP.Primary.RPM = 900 -- This is in Rounds Per Minute -SWEP.Primary.ClipSize = 20 -- Size of a clip +SWEP.Primary.RPM = 1000 -- This is in Rounds Per Minute +SWEP.Primary.ClipSize = 30 -- Size of a clip SWEP.Primary.DefaultClip = 60 -- Bullets you start with -SWEP.Primary.KickUp = 0.3 -- Maximum up recoil (rise) -SWEP.Primary.KickDown = 0.3 -- Maximum down recoil (skeet) +SWEP.Primary.KickUp = 0.5 -- Maximum up recoil (rise) +SWEP.Primary.KickDown = 0.5 -- Maximum down recoil (skeet) SWEP.Primary.KickHorizontal = 0.5 -- Maximum up recoil (stock) SWEP.Primary.Automatic = true -- Automatic = true; Semi Auto = false SWEP.Primary.Ammo = "ar2" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun @@ -50,9 +50,9 @@ SWEP.data = {} --The starting firemode SWEP.data.ironsights = 1 SWEP.Primary.NumShots = 1 -- How many bullets to shoot per trigger pull -SWEP.Primary.Damage = 27 -- Base damage per bullet -SWEP.Primary.Spread = .019 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .008 -- Ironsight accuracy, should be the same for shotguns +SWEP.Primary.Damage = 25 -- Base damage per bullet +SWEP.Primary.Spread = 0 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = 0 -- Ironsight accuracy, should be the same for shotguns -- Enter iron sight info and bone mod info below SWEP.IronSightsPos = Vector (-2.2442, -1.8353, 1.0599) @@ -74,4 +74,6 @@ if GetConVar("M9KUniqueSlots") != nil then if not (GetConVar("M9KUniqueSlots"):GetBool()) then SWEP.SlotPos = 2 end -end \ No newline at end of file +end +SWEP.Primary.KickUp = 0.5 +SWEP.Primary.Recoil = 0.3 \ No newline at end of file diff --git a/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_vikhr/shared.lua b/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_vikhr/shared.lua index 87bc825..5c897f7 100644 --- a/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_vikhr/shared.lua +++ b/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_vikhr/shared.lua @@ -11,7 +11,7 @@ SWEP.Instructions = "" SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models SWEP.PrintName = "SR-3M Vikhr" -- Weapon name (Shown on HUD) -SWEP.Slot = 2 -- Slot in the weapon selection menu +SWEP.Slot = 1 -- Slot in the weapon selection menu SWEP.SlotPos = 40 -- Position in the slot SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box @@ -34,11 +34,11 @@ SWEP.AdminSpawnable = true SWEP.FiresUnderwater = false SWEP.Primary.Sound = Sound("Dmgfok_vikhr.Single") -- Script that calls the primary fire sound -SWEP.Primary.RPM = 900 -- This is in Rounds Per Minute +SWEP.Primary.RPM = 650 -- This is in Rounds Per Minute SWEP.Primary.ClipSize = 30 -- Size of a clip SWEP.Primary.DefaultClip = 60 -- Bullets you start with -SWEP.Primary.KickUp = 0.3 -- Maximum up recoil (rise) -SWEP.Primary.KickDown = 0.3 -- Maximum down recoil (skeet) +SWEP.Primary.KickUp = 1 -- Maximum up recoil (rise) +SWEP.Primary.KickDown = 1 -- Maximum down recoil (skeet) SWEP.Primary.KickHorizontal = 0.5 -- Maximum up recoil (stock) SWEP.Primary.Automatic = true -- Automatic = true; Semi Auto = false SWEP.Primary.Ammo = "smg1" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun @@ -50,9 +50,9 @@ SWEP.data = {} --The starting firemode SWEP.data.ironsights = 1 SWEP.Primary.NumShots = 1 -- How many bullets to shoot per trigger pull -SWEP.Primary.Damage = 29 -- Base damage per bullet -SWEP.Primary.Spread = .02 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .014 -- Ironsight accuracy, should be the same for shotguns +SWEP.Primary.Damage = 30 -- Base damage per bullet +SWEP.Primary.Spread = 0 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = 0 -- Ironsight accuracy, should be the same for shotguns -- Enter iron sight info and bone mod info below SWEP.IronSightsPos = Vector (-2.2363, -1.0859, 0.5292) @@ -74,4 +74,6 @@ if GetConVar("M9KUniqueSlots") != nil then if not (GetConVar("M9KUniqueSlots"):GetBool()) then SWEP.SlotPos = 2 end -end \ No newline at end of file +end +SWEP.Primary.KickUp = 0.5 +SWEP.Primary.Recoil = 0.3 \ No newline at end of file diff --git a/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_winchester73/shared.lua b/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_winchester73/shared.lua index 1840001..a5cc2b5 100644 --- a/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_winchester73/shared.lua +++ b/m9k_assault_rifles_fatal_edition/lua/weapons/m9k_winchester73/shared.lua @@ -1,91 +1,127 @@ --- Variables that are used on both client and server -SWEP.Gun = ("m9k_winchester73") -- must be the name of your swep but NO CAPITALS! -if (GetConVar(SWEP.Gun.."_allowed")) != nil then - if not (GetConVar(SWEP.Gun.."_allowed"):GetBool()) then SWEP.Base = "bobs_blacklisted" SWEP.PrintName = SWEP.Gun return end -end -SWEP.Category = "M9K Assault Rifles" -SWEP.Author = "" -SWEP.Contact = "" -SWEP.Purpose = "" -SWEP.Instructions = "" -SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models -SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models -SWEP.PrintName = "73 Winchester Carbine" -- Weapon name (Shown on HUD) -SWEP.Slot = 2 -- Slot in the weapon selection menu -SWEP.SlotPos = 41 -- Position in the slot -SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter -SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box -SWEP.BounceWeaponIcon = false -- Should the weapon icon bounce? -SWEP.DrawCrosshair = true -- set false if you want no crosshair -SWEP.Weight = 3 -- rank relative ot other weapons. bigger is better -SWEP.AutoSwitchTo = true -- Auto switch to if we pick it up -SWEP.AutoSwitchFrom = true -- Auto switch from if you pick up a better weapon -SWEP.HoldType = "ar2" -- how others view you carrying the weapon --- normal melee melee2 fist knife smg ar2 pistol rpg physgun grenade shotgun crossbow slam passive --- you're mostly going to use ar2, smg, shotgun or pistol. rpg and crossbow make for good sniper rifles - -SWEP.ViewModelFOV = 70 -SWEP.ViewModelFlip = true -SWEP.ViewModel = "models/weapons/v_winchester1873.mdl" -- Weapon view model -SWEP.WorldModel = "models/weapons/w_winchester_1873.mdl" -- Weapon world model -SWEP.Base = "bobs_shotty_base" -SWEP.Spawnable = true -SWEP.AdminSpawnable = true - -SWEP.Primary.Sound = Sound("Weapon_73.Single") -- script that calls the primary fire sound -SWEP.Primary.RPM = 66 -- This is in Rounds Per Minute -SWEP.Primary.ClipSize = 8 -- Size of a clip -SWEP.Primary.DefaultClip = 30 -- Default number of bullets in a clip -SWEP.Primary.KickUp = .2 -- Maximum up recoil (rise) -SWEP.Primary.KickDown = 0 -- Maximum down recoil (skeet) -SWEP.Primary.KickHorizontal = 0.1 -- Maximum up recoil (stock) -SWEP.Primary.Automatic = false -- Automatic/Semi Auto -SWEP.Primary.Ammo = "AirboatGun" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun --- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets - -SWEP.Secondary.IronFOV = 60 -- How much you 'zoom' in. Less is more! -SWEP.ShellTime = .54 - -SWEP.data = {} --The starting firemode -SWEP.data.ironsights = 1 - -SWEP.Primary.NumShots = 1 -- How many bullets to shoot per trigger pull, AKA pellets -SWEP.Primary.Damage = 85 -- Base damage per bullet -SWEP.Primary.Spread = .01 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .001 -- Ironsight accuracy, should be the same for shotguns --- Because irons don't magically give you less pellet spread!, but this isn't a shotgun so whatever, man! - --- Enter iron sight info and bone mod info below -SWEP.IronSightsPos = Vector(4.356, 0, 2.591) -SWEP.IronSightsAng = Vector(0, 0, 0) -SWEP.SightsPos = Vector(4.356, 0, 2.591) -SWEP.SightsAng = Vector(0, 0, 0) -SWEP.GSightsPos = Vector (0, 0, 0) -SWEP.GSightsAng = Vector (0, 0, 0) -SWEP.RunSightsPos = Vector (-2.3095, -3.0514, 2.3965) -SWEP.RunSightsAng = Vector (-19.8471, -33.9181, 10) - -SWEP.ViewModelBoneMods = { - ["shell"] = { scale = Vector(0.009, 0.009, 0.009), pos = Vector(0, 0, 0), angle = Angle(0, 0, 0) } -} - -if (gmod.GetGamemode().Name == "Murderthon 9000") then - - SWEP.Slot = 1 -- Slot in the weapon selection menu - SWEP.Weight = 3 -- rank relative ot other weapons. bigger is better - -end - -if GetConVar("M9KDefaultClip") == nil then - print("M9KDefaultClip is missing! You may have hit the lua limit!") -else - if GetConVar("M9KDefaultClip"):GetInt() != -1 then - SWEP.Primary.DefaultClip = SWEP.Primary.ClipSize * GetConVar("M9KDefaultClip"):GetInt() - end -end - -if GetConVar("M9KUniqueSlots") != nil then - if not (GetConVar("M9KUniqueSlots"):GetBool()) then - SWEP.SlotPos = 2 - end +-- Variables that are used on both client and server +SWEP.Gun = ("m9k_winchester73") -- must be the name of your swep but NO CAPITALS! +if (GetConVar(SWEP.Gun.."_allowed")) != nil then + if not (GetConVar(SWEP.Gun.."_allowed"):GetBool()) then SWEP.Base = "bobs_blacklisted" SWEP.PrintName = SWEP.Gun return end +end +SWEP.Category = "M9K Assault Rifles" +SWEP.Author = "" +SWEP.Contact = "" +SWEP.Purpose = "" +SWEP.Instructions = "" +SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models +SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models +SWEP.PrintName = "73 Winchester Carbine" -- Weapon name (Shown on HUD) +SWEP.Slot = 4 -- Slot in the weapon selection menu +SWEP.SlotPos = 41 -- Position in the slot +SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter +SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box +SWEP.BounceWeaponIcon = false -- Should the weapon icon bounce? +SWEP.DrawCrosshair = true -- set false if you want no crosshair +SWEP.Weight = 3 -- rank relative ot other weapons. bigger is better +SWEP.AutoSwitchTo = true -- Auto switch to if we pick it up +SWEP.AutoSwitchFrom = true -- Auto switch from if you pick up a better weapon +SWEP.HoldType = "ar2" -- how others view you carrying the weapon +-- normal melee melee2 fist knife smg ar2 pistol rpg physgun grenade shotgun crossbow slam passive +-- you're mostly going to use ar2, smg, shotgun or pistol. rpg and crossbow make for good sniper rifles + +SWEP.ViewModelFOV = 70 +SWEP.ViewModelFlip = true +SWEP.ViewModel = "models/weapons/v_winchester1873.mdl" -- Weapon view model +SWEP.WorldModel = "models/weapons/w_winchester_1873.mdl" -- Weapon world model +SWEP.Base = "bobs_shotty_base" +SWEP.Spawnable = true +SWEP.AdminSpawnable = true + +SWEP.Primary.Sound = Sound("Weapon_73.Single") -- script that calls the primary fire sound +SWEP.Primary.RPM = 66 -- This is in Rounds Per Minute +SWEP.Primary.ClipSize = 8 -- Size of a clip +SWEP.Primary.DefaultClip = 30 -- Default number of bullets in a clip +SWEP.Primary.KickUp = .2 -- Maximum up recoil (rise) +SWEP.Primary.KickDown = 0 -- Maximum down recoil (skeet) +SWEP.Primary.KickHorizontal = 0.1 -- Maximum up recoil (stock) +SWEP.Primary.Automatic = false -- Automatic/Semi Auto +SWEP.Primary.Ammo = "AirboatGun" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun +-- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets + +SWEP.Secondary.IronFOV = 60 -- How much you 'zoom' in. Less is more! +SWEP.ShellTime = .54 + +SWEP.data = {} --The starting firemode +SWEP.data.ironsights = 1 + +SWEP.Primary.NumShots = 1 -- How many bullets to shoot per trigger pull, AKA pellets +SWEP.Primary.Damage = 85 -- Base damage per bullet +SWEP.Primary.Spread = 0 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = 0 -- Ironsight accuracy, should be the same for shotguns +-- Because irons don't magically give you less pellet spread!, but this isn't a shotgun so whatever, man! + +-- Enter iron sight info and bone mod info below +SWEP.IronSightsPos = Vector(4.356, 0, 2.591) +SWEP.IronSightsAng = Vector(0, 0, 0) +SWEP.SightsPos = Vector(4.356, 0, 2.591) +SWEP.SightsAng = Vector(0, 0, 0) +SWEP.GSightsPos = Vector (0, 0, 0) +SWEP.GSightsAng = Vector (0, 0, 0) +SWEP.RunSightsPos = Vector (-2.3095, -3.0514, 2.3965) +SWEP.RunSightsAng = Vector (-19.8471, -33.9181, 10) + +SWEP.ViewModelBoneMods = { + ["shell"] = { scale = Vector(0.009, 0.009, 0.009), pos = Vector(0, 0, 0), angle = Angle(0, 0, 0) } +} + +if (gmod.GetGamemode().Name == "Murderthon 9000") then + + SWEP.Slot = 1 -- Slot in the weapon selection menu + SWEP.Weight = 3 -- rank relative ot other weapons. bigger is better + +end + +if GetConVar("M9KDefaultClip") == nil then + print("M9KDefaultClip is missing! You may have hit the lua limit!") +else + if GetConVar("M9KDefaultClip"):GetInt() != -1 then + SWEP.Primary.DefaultClip = SWEP.Primary.ClipSize * GetConVar("M9KDefaultClip"):GetInt() + end +end + +if GetConVar("M9KUniqueSlots") != nil then + if not (GetConVar("M9KUniqueSlots"):GetBool()) then + SWEP.SlotPos = 2 + end +end +SWEP.Primary.KickUp = 2 +SWEP.Primary.Recoil = 0 +function SWEP:ShootBullet( DirX, DirY, DirZ ) + + local bullet = {} + bullet.Num = 1 + bullet.Src = self.Owner:GetShootPos() -- Source + bullet.Dir = self.Owner:GetAimVector() + (self.Owner:GetAimVector():Angle():Right()*DirX) + (self.Owner:GetAimVector():Angle():Up()*DirY) -- Dir of bullet + bullet.Spread = Vector(0,0,0) -- Aim Cone + bullet.Tracer = 1 -- Show a tracer on every x bullets + bullet.Force = 1 -- Amount of force to give to phys objects + bullet.Damage = 85 + bullet.AmmoType = self.Primary.Ammo + bullet.HullSize = 0 + + self.Owner:FireBullets( bullet ) + + self:ShootEffects() + +end + +function SWEP:PrimaryAttack() + + -- Make sure we can shoot first + if ( !self:CanPrimaryAttack() ) then return end + + -- Play shoot sound + self:EmitSound(self.Primary.Sound) + + self:ShootBullet(0,0,0) + + -- Remove 1 bullet from our clip + self:TakePrimaryAmmo( 1 ) + + self.Weapon:SetNextPrimaryFire(CurTime()+1/(self.Primary.RPM/60)) end \ No newline at end of file diff --git a/m9k_heavy_weapons_fatal_edition/lua/autorun/m9k_heavy_weaps_11_07_15.lua b/m9k_heavy_weapons_fatal_edition/lua/autorun/m9k_heavy_weaps_11_07_15.lua index 609b022..b2592ed 100644 --- a/m9k_heavy_weapons_fatal_edition/lua/autorun/m9k_heavy_weaps_11_07_15.lua +++ b/m9k_heavy_weapons_fatal_edition/lua/autorun/m9k_heavy_weaps_11_07_15.lua @@ -71,7 +71,7 @@ if GetConVar("M9KWeaponStrip") == nil then end if GetConVar("M9KDisablePenetration") == nil then - CreateConVar("M9KDisablePenetration", "0", { FCVAR_REPLICATED, FCVAR_NOTIFY, FCVAR_ARCHIVE }, "Disable Penetration and Ricochets? 1 for true, 0 for false") + CreateConVar("M9KDisablePenetration", "1", { FCVAR_REPLICATED, FCVAR_NOTIFY, FCVAR_ARCHIVE }, "Disable Penetration and Ricochets? 1 for true, 0 for false") print("Penetration/ricochet con var created") end @@ -880,7 +880,7 @@ sound.Add({ sound.Add({ name = "Weapon_INT.Single", channel = CHAN_USER_BASE+10, - volume = 1.0, + volume = 2.0, sound = "weapons/fokku_tc_intrv/int1.wav" }) diff --git a/m9k_heavy_weapons_fatal_edition/lua/weapons/bobs_gun_base/shared.lua b/m9k_heavy_weapons_fatal_edition/lua/weapons/bobs_gun_base/shared.lua index ab128bb..1a05aec 100644 --- a/m9k_heavy_weapons_fatal_edition/lua/weapons/bobs_gun_base/shared.lua +++ b/m9k_heavy_weapons_fatal_edition/lua/weapons/bobs_gun_base/shared.lua @@ -1,1359 +1,1280 @@ --- //Variables that are used on both client and server -SWEP.Category = "" -SWEP.Gun = "" -SWEP.Author = "Generic Default, Worshipper, Clavus, and Bob" -SWEP.Contact = "" -SWEP.Purpose = "" -SWEP.Instructions = "" -SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models -SWEP.DrawCrosshair = true -- Hell no, crosshairs r 4 nubz! -SWEP.ViewModelFOV = 65 -- How big the gun will look -SWEP.ViewModelFlip = true -- True for CSS models, False for HL2 models - -SWEP.Spawnable = false -SWEP.AdminSpawnable = false - -SWEP.Primary.Sound = Sound("") -- Sound of the gun -SWEP.Primary.Round = ("") -- What kind of bullet? -SWEP.Primary.Cone = 0.2 -- Accuracy of NPCs -SWEP.Primary.Recoil = 10 -SWEP.Primary.Damage = 10 -SWEP.Primary.Spread = .01 --define from-the-hip accuracy (1 is terrible, .0001 is exact) -SWEP.Primary.NumShots = 1 -SWEP.Primary.RPM = 0 -- This is in Rounds Per Minute -SWEP.Primary.ClipSize = 0 -- Size of a clip -SWEP.Primary.DefaultClip = 0 -- Default number of bullets in a clip -SWEP.Primary.KickUp = 0 -- Maximum up recoil (rise) -SWEP.Primary.KickDown = 0 -- Maximum down recoil (skeet) -SWEP.Primary.KickHorizontal = 0 -- Maximum side recoil (koolaid) -SWEP.Primary.Automatic = true -- Automatic/Semi Auto -SWEP.Primary.Ammo = "none" -- What kind of ammo - --- SWEP.Secondary.ClipSize = 0 -- Size of a clip --- SWEP.Secondary.DefaultClip = 0 -- Default number of bullets in a clip --- SWEP.Secondary.Automatic = false -- Automatic/Semi Auto -SWEP.Secondary.Ammo = "" ---//HAHA! GOTCHA, YA BASTARD! - --- SWEP.Secondary.IronFOV = 0 -- How much you 'zoom' in. Less is more! - -SWEP.Penetration = true -SWEP.Ricochet = true -SWEP.MaxRicochet = 1 -SWEP.RicochetCoin = 1 -SWEP.BoltAction = false -SWEP.Scoped = false -SWEP.ShellTime = .35 -SWEP.Tracer = 0 -SWEP.CanBeSilenced = false -SWEP.Silenced = false -SWEP.NextSilence = 0 -SWEP.SelectiveFire = false -SWEP.NextFireSelect = 0 -SWEP.OrigCrossHair = true - -local PainMulti = 1 - -if GetConVar("M9KDamageMultiplier") == nil then - PainMulti = 1 - print("M9KDamageMultiplier is missing! You may have hit the lua limit! Reverting multiplier to 1.") -else - PainMulti = GetConVar("M9KDamageMultiplier"):GetFloat() - if PainMulti < 0 then - PainMulti = PainMulti * -1 - print("Your damage multiplier was in the negatives. It has been reverted to a positive number. Your damage multiplier is now "..PainMulti) - end -end - -function NewM9KDamageMultiplier(cvar, previous, new) - print("multiplier has been changed ") - if GetConVar("M9KDamageMultiplier") == nil then - PainMulti = 1 - print("M9KDamageMultiplier is missing! You may have hit the lua limit! Reverting multiplier to 1, you will notice no changes.") - else - PainMulti = GetConVar("M9KDamageMultiplier"):GetFloat() - if PainMulti < 0 then - PainMulti = PainMulti * -1 - print("Your damage multiplier was in the negatives. It has been reverted to a positive number. Your damage multiplier is now "..PainMulti) - end - end -end -cvars.AddChangeCallback("M9KDamageMultiplier", NewM9KDamageMultiplier) - -function NewDefClips(cvar, previous, new) - print("Default clip multiplier has changed. A server restart will be required for these changes to take effect.") -end -cvars.AddChangeCallback("M9KDefaultClip", NewDefClips) - -if GetConVar("M9KDefaultClip") == nil then - print("M9KDefaultClip is missing! You may have hit the lua limit!") -else - if GetConVar("M9KDefaultClip"):GetInt() >= 0 then - print("M9K Weapons will now spawn with "..GetConVar("M9KDefaultClip"):GetFloat().." clips.") - else - print("Default clips will be not be modified") - end -end - -SWEP.IronSightsPos = Vector (2.4537, 1.0923, 0.2696) -SWEP.IronSightsAng = Vector (0.0186, -0.0547, 0) - -SWEP.VElements = {} -SWEP.WElements = {} - -function SWEP:Initialize() - self.Reloadaftershoot = 0 -- Can't reload when firing - self:SetHoldType(self.HoldType) - self.OrigCrossHair = self.DrawCrosshair - if SERVER and self.Owner:IsNPC() then - self:SetNPCMinBurst(3) - self:SetNPCMaxBurst(10) -- None of this really matters but you need it here anyway - self:SetNPCFireRate(1/(self.Primary.RPM/60)) - -- //self:SetCurrentWeaponProficiency( WEAPON_PROFICIENCY_VERY_GOOD ) - end - - if CLIENT then - - -- // Create a new table for every weapon instance - self.VElements = table.FullCopy( self.VElements ) - self.WElements = table.FullCopy( self.WElements ) - self.ViewModelBoneMods = table.FullCopy( self.ViewModelBoneMods ) - - self:CreateModels(self.VElements) -- create viewmodels - self:CreateModels(self.WElements) -- create worldmodels - - -- // init view model bone build function - if IsValid(self.Owner) and self.Owner:IsPlayer() then - if self.Owner:Alive() then - local vm = self.Owner:GetViewModel() - if IsValid(vm) then - self:ResetBonePositions(vm) - -- // Init viewmodel visibility - if (self.ShowViewModel == nil or self.ShowViewModel) then - vm:SetColor(Color(255,255,255,255)) - else - -- // however for some reason the view model resets to render mode 0 every frame so we just apply a debug material to prevent it from drawing - vm:SetMaterial("Debug/hsv") - end - end - - end - end - - end - - if CLIENT then - local oldpath = "vgui/hud/name" -- the path goes here - local newpath = string.gsub(oldpath, "name", self.Gun) - self.WepSelectIcon = surface.GetTextureID(newpath) - end - -end - -function SWEP:Equip() - self:SetHoldType(self.HoldType) -end - -function SWEP:Deploy() - self:SetIronsights(false, self.Owner) -- Set the ironsight false - self:SetHoldType(self.HoldType) - - if self.Silenced then - self.Weapon:SendWeaponAnim( ACT_VM_DRAW_SILENCED ) - else - self.Weapon:SendWeaponAnim( ACT_VM_DRAW ) - end - - self.Weapon:SetNWBool("Reloading", false) - - if !self.Owner:IsNPC() and self.Owner != nil then - if self.ResetSights and self.Owner:GetViewModel() != nil then - self.ResetSights = CurTime() + self.Owner:GetViewModel():SequenceDuration() - end - end - return true -end - -function SWEP:Holster() - - if CLIENT and IsValid(self.Owner) and not self.Owner:IsNPC() then - local vm = self.Owner:GetViewModel() - if IsValid(vm) then - self:ResetBonePositions(vm) - end - end - - return true -end - -function SWEP:OnRemove() - - if CLIENT and IsValid(self.Owner) and not self.Owner:IsNPC() then - local vm = self.Owner:GetViewModel() - if IsValid(vm) then - self:ResetBonePositions(vm) - end - end - -end - -function SWEP:GetCapabilities() - return CAP_WEAPON_RANGE_ATTACK1, CAP_INNATE_RANGE_ATTACK1 -end - -function SWEP:Precache() - util.PrecacheSound(self.Primary.Sound) - util.PrecacheModel(self.ViewModel) - util.PrecacheModel(self.WorldModel) -end - -function SWEP:PrimaryAttack() - OkaySoFar = true - if not IsValid(self) then - OkaySoFar = false - else if not IsValid(self.Weapon) then - OkaySoFar = false - else if not IsValid(self.Owner) then - OkaySoFar = false - end end end - - if not OkaySoFar then return end - - if self:CanPrimaryAttack() and self.Owner:IsPlayer() then - if !self.Owner:KeyDown(IN_SPEED) and !self.Owner:KeyDown(IN_RELOAD) then - self:ShootBulletInformation() - self.Weapon:TakePrimaryAmmo(1) - - if self.Silenced then - self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK_SILENCED ) - self.Weapon:EmitSound(self.Primary.SilencedSound) - else - self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK ) - self.Weapon:EmitSound(self.Primary.Sound) - end - - local fx = EffectData() - fx:SetEntity(self.Weapon) - fx:SetOrigin(self.Owner:GetShootPos()) - fx:SetNormal(self.Owner:GetAimVector()) - fx:SetAttachment(self.MuzzleAttachment) - if GetConVar("M9KGasEffect") != nil then - if GetConVar("M9KGasEffect"):GetBool() then - util.Effect("m9k_rg_muzzle_rifle",fx) - end - end - self.Owner:SetAnimation( PLAYER_ATTACK1 ) - self.Owner:MuzzleFlash() - self.Weapon:SetNextPrimaryFire(CurTime()+1/(self.Primary.RPM/60)) - self:CheckWeaponsAndAmmo() - self.RicochetCoin = (math.random(1,4)) - if self.BoltAction then self:BoltBack() end - end - elseif self:CanPrimaryAttack() and self.Owner:IsNPC() then - self:ShootBulletInformation() - self.Weapon:TakePrimaryAmmo(1) - self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK ) - self.Weapon:EmitSound(self.Primary.Sound) - self.Owner:SetAnimation( PLAYER_ATTACK1 ) - self.Owner:MuzzleFlash() - self.Weapon:SetNextPrimaryFire(CurTime()+1/(self.Primary.RPM/60)) - self.RicochetCoin = (math.random(1,4)) - end -end - -function SWEP:CheckWeaponsAndAmmo() - if SERVER and self.Weapon != nil and (GetConVar("M9KWeaponStrip"):GetBool()) then - if self.Weapon:Clip1() == 0 && self.Owner:GetAmmoCount( self.Weapon:GetPrimaryAmmoType() ) == 0 then - timer.Simple(.1, function() if SERVER then if not IsValid(self) then return end - if self.Owner == nil then return end - self.Owner:StripWeapon(self.Gun) - end end) - end - end -end - - -/*--------------------------------------------------------- - Name: SWEP:ShootBulletInformation() - Desc: This func add the damage, the recoil, the number of shots and the cone on the bullet. ------------------------------------------------------*/ -function SWEP:ShootBulletInformation() - - local CurrentDamage - local CurrentRecoil - local CurrentCone - local basedamage - - if (self:GetIronsights() == true) and self.Owner:KeyDown(IN_ATTACK2) then - CurrentCone = self.Primary.IronAccuracy - else - CurrentCone = self.Primary.Spread - end - local damagedice = math.Rand(.85,1.3) - - basedamage = PainMulti * self.Primary.Damage - CurrentDamage = basedamage * damagedice - CurrentRecoil = self.Primary.Recoil - - -- //Player is aiming - if (self:GetIronsights() == true) and self.Owner:KeyDown(IN_ATTACK2) then - self:ShootBullet(CurrentDamage, CurrentRecoil / 6, self.Primary.NumShots, CurrentCone) - -- //Player is not aiming - else - if IsValid(self) then - if IsValid(self.Weapon) then - if IsValid(self.Owner) then - self:ShootBullet(CurrentDamage, CurrentRecoil, self.Primary.NumShots, CurrentCone) - end - end - end - end - -end - -/*--------------------------------------------------------- - Name: SWEP:ShootBullet() - Desc: A convenience func to shoot bullets. ------------------------------------------------------*/ -local TracerName = "Tracer" - -function SWEP:ShootBullet(damage, recoil, num_bullets, aimcone) - - num_bullets = num_bullets or 1 - aimcone = aimcone or 0 - - self:ShootEffects() - - if self.Tracer == 1 then - TracerName = "Ar2Tracer" - elseif self.Tracer == 2 then - TracerName = "AirboatGunHeavyTracer" - else - TracerName = "Tracer" - end - - local bullet = {} - bullet.Num = num_bullets - bullet.Src = self.Owner:GetShootPos() -- Source - bullet.Dir = self.Owner:GetAimVector() -- Dir of bullet - bullet.Spread = Vector(aimcone, aimcone, 0) -- Aim Cone - bullet.Tracer = 3 -- Show a tracer on every x bullets - bullet.TracerName = TracerName - bullet.Force = damage * 0.25 -- Amount of force to give to phys objects - bullet.Damage = damage - bullet.Callback = function(attacker, tracedata, dmginfo) - return self:RicochetCallback(0, attacker, tracedata, dmginfo) - end - if IsValid(self) then - if IsValid(self.Weapon) then - if IsValid(self.Owner) then - self.Owner:FireBullets(bullet) - end - end - end - -- //if SERVER and !self.Owner:IsNPC() then - -- // local anglo = Angle(math.Rand(-self.Primary.KickDown,-self.Primary.KickUp), math.Rand(-self.Primary.KickHorizontal,self.Primary.KickHorizontal), 0) - -- // self.Owner:ViewPunch(anglo) - - -- // local eyes = self.Owner:EyeAngles() - -- // eyes.pitch = eyes.pitch + anglo.pitch - -- // eyes.yaw = eyes.yaw + anglo.yaw - -- // if game.SinglePlayer() then self.Owner:SetEyeAngles(eyes) end - -- //end - - local anglo1 = Angle(math.Rand(-self.Primary.KickDown,-self.Primary.KickUp), math.Rand(-self.Primary.KickHorizontal,self.Primary.KickHorizontal), 0) - self.Owner:ViewPunch(anglo1) - - if SERVER and game.SinglePlayer() and !self.Owner:IsNPC() then - local offlineeyes = self.Owner:EyeAngles() - offlineeyes.pitch = offlineeyes.pitch + anglo1.pitch - offlineeyes.yaw = offlineeyes.yaw + anglo1.yaw - if GetConVar("M9KDynamicRecoil"):GetBool() then - self.Owner:SetEyeAngles(offlineeyes) - end - end - - if CLIENT and !game.SinglePlayer() and !self.Owner:IsNPC() then - local anglo = Angle(math.Rand(-self.Primary.KickDown,-self.Primary.KickUp), math.Rand(-self.Primary.KickHorizontal,self.Primary.KickHorizontal), 0) - - local eyes = self.Owner:EyeAngles() - eyes.pitch = eyes.pitch + (anglo.pitch/3) - eyes.yaw = eyes.yaw + (anglo.yaw/3) - if GetConVar("M9KDynamicRecoil"):GetBool() then - self.Owner:SetEyeAngles(eyes) - end - end - -end - -/*--------------------------------------------------------- - Name: SWEP:RicochetCallback() ------------------------------------------------------*/ - -function SWEP:RicochetCallback(bouncenum, attacker, tr, dmginfo) - - if not IsFirstTimePredicted() then - return {damage = false, effects = false} - end - - local PenetrationChecker = false - - if GetConVar("M9KDisablePenetration") == nil then - PenetrationChecker = false - else - PenetrationChecker = GetConVar("M9KDisablePenetration"):GetBool() - end - - if PenetrationChecker then return {damage = true, effects = DoDefaultEffect} end - - bulletmiss = {} - bulletmiss[1]=Sound("weapons/fx/nearmiss/bulletLtoR03.wav") - bulletmiss[2]=Sound("weapons/fx/nearmiss/bulletLtoR04.wav") - bulletmiss[3]=Sound("weapons/fx/nearmiss/bulletLtoR06.wav") - bulletmiss[4]=Sound("weapons/fx/nearmiss/bulletLtoR07.wav") - bulletmiss[5]=Sound("weapons/fx/nearmiss/bulletLtoR09.wav") - bulletmiss[6]=Sound("weapons/fx/nearmiss/bulletLtoR10.wav") - bulletmiss[7]=Sound("weapons/fx/nearmiss/bulletLtoR13.wav") - bulletmiss[8]=Sound("weapons/fx/nearmiss/bulletLtoR14.wav") - - local DoDefaultEffect = true - if (tr.HitSky) then return end - - // -- Can we go through whatever we hit? - if (self.Penetration) and (self:BulletPenetrate(bouncenum, attacker, tr, dmginfo)) then - return {damage = true, effects = DoDefaultEffect} - end - - // -- Your screen will shake and you'll hear the savage hiss of an approaching bullet which passing if someone is shooting at you. - if (tr.MatType != MAT_METAL) then - if (SERVER) then - util.ScreenShake(tr.HitPos, 5, 0.1, 0.5, 64) - sound.Play(table.Random(bulletmiss), tr.HitPos, 75, math.random(75,150), 1) - end - - if self.Tracer == 0 or self.Tracer == 1 or self.Tracer == 2 then - local effectdata = EffectData() - effectdata:SetOrigin(tr.HitPos) - effectdata:SetNormal(tr.HitNormal) - effectdata:SetScale(20) - util.Effect("AR2Impact", effectdata) - elseif self.Tracer == 3 then - local effectdata = EffectData() - effectdata:SetOrigin(tr.HitPos) - effectdata:SetNormal(tr.HitNormal) - effectdata:SetScale(20) - util.Effect("StunstickImpact", effectdata) - end - - return - end - - if (self.Ricochet == false) then return {damage = true, effects = DoDefaultEffect} end - - if self.Primary.Ammo == "SniperPenetratedRound" then -- .50 Ammo - self.MaxRicochet = 12 - elseif self.Primary.Ammo == "pistol" then -- pistols - self.MaxRicochet = 2 - elseif self.Primary.Ammo == "357" then -- revolvers with big ass bullets - self.MaxRicochet = 4 - elseif self.Primary.Ammo == "smg1" then -- smgs - self.MaxRicochet = 5 - elseif self.Primary.Ammo == "ar2" then -- assault rifles - self.MaxRicochet = 8 - elseif self.Primary.Ammo == "buckshot" then -- shotguns - self.MaxRicochet = 1 - elseif self.Primary.Ammo == "slam" then -- secondary shotguns - self.MaxRicochet = 1 - elseif self.Primary.Ammo == "AirboatGun" then -- metal piercing shotgun pellet - self.MaxRicochet = 8 - end - - if (bouncenum > self.MaxRicochet) then return end - - // -- Bounce vector - local trace = {} - trace.start = tr.HitPos - trace.endpos = trace.start + (tr.HitNormal * 16384) - - local trace = util.TraceLine(trace) - - local DotProduct = tr.HitNormal:Dot(tr.Normal * -1) - - local ricochetbullet = {} - ricochetbullet.Num = 1 - ricochetbullet.Src = tr.HitPos + (tr.HitNormal * 5) - ricochetbullet.Dir = ((2 * tr.HitNormal * DotProduct) + tr.Normal) + (VectorRand() * 0.05) - ricochetbullet.Spread = Vector(0, 0, 0) - ricochetbullet.Tracer = 1 - ricochetbullet.TracerName = "m9k_effect_mad_ricochet_trace" - ricochetbullet.Force = dmginfo:GetDamage() * 0.15 - ricochetbullet.Damage = dmginfo:GetDamage() * 0.5 - ricochetbullet.Callback = function(a, b, c) - if (self.Ricochet) then - local impactnum - if tr.MatType == MAT_GLASS then impactnum = 0 else impactnum = 1 end - return self:RicochetCallback(bouncenum + impactnum, a, b, c) end - end - - timer.Simple(0, function() attacker:FireBullets(ricochetbullet) end) - - return {damage = true, effects = DoDefaultEffect} -end - - -/*--------------------------------------------------------- - Name: SWEP:BulletPenetrate() ------------------------------------------------------*/ -function SWEP:BulletPenetrate(bouncenum, attacker, tr, paininfo) - - local MaxPenetration - - if self.Primary.Ammo == "SniperPenetratedRound" then -- .50 Ammo - MaxPenetration = 20 - elseif self.Primary.Ammo == "pistol" then -- pistols - MaxPenetration = 9 - elseif self.Primary.Ammo == "357" then -- revolvers with big ass bullets - MaxPenetration = 12 - elseif self.Primary.Ammo == "smg1" then -- smgs - MaxPenetration = 14 - elseif self.Primary.Ammo == "ar2" then -- assault rifles - MaxPenetration = 16 - elseif self.Primary.Ammo == "buckshot" then -- shotguns - MaxPenetration = 5 - elseif self.Primary.Ammo == "slam" then -- secondary shotguns - MaxPenetration = 5 - elseif self.Primary.Ammo == "AirboatGun" then -- metal piercing shotgun pellet - MaxPenetration = 17 - else - MaxPenetration = 14 - end - - local DoDefaultEffect = true - // -- Don't go through metal, sand or player - - if self.Primary.Ammo == "pistol" or - self.Primary.Ammo == "buckshot" or - self.Primary.Ammo == "slam" then self.Ricochet = true - else - if self.RicochetCoin == 1 then - self.Ricochet = true - elseif self.RicochetCoin >= 2 then - self.Ricochet = false - end - end - - if self.Primary.Ammo == "SniperPenetratedRound" then self.Ricochet = true end - - if self.Primary.Ammo == "SniperPenetratedRound" then -- .50 Ammo - self.MaxRicochet = 10 - elseif self.Primary.Ammo == "pistol" then -- pistols - self.MaxRicochet = 2 - elseif self.Primary.Ammo == "357" then -- revolvers with big ass bullets - self.MaxRicochet = 5 - elseif self.Primary.Ammo == "smg1" then -- smgs - self.MaxRicochet = 4 - elseif self.Primary.Ammo == "ar2" then -- assault rifles - self.MaxRicochet = 5 - elseif self.Primary.Ammo == "buckshot" then -- shotguns - self.MaxRicochet = 0 - elseif self.Primary.Ammo == "slam" then -- secondary shotguns - self.MaxRicochet = 0 - elseif self.Primary.Ammo == "AirboatGun" then -- metal piercing shotgun pellet - self.MaxRicochet = 8 - end - - if (tr.MatType == MAT_METAL and self.Ricochet == true and self.Primary.Ammo != "SniperPenetratedRound" ) then return false end - - // -- Don't go through more than 3 times - if (bouncenum > self.MaxRicochet) then return false end - - // -- Direction (and length) that we are going to penetrate - local PenetrationDirection = tr.Normal * MaxPenetration - - if (tr.MatType == MAT_GLASS or tr.MatType == MAT_PLASTIC or tr.MatType == MAT_WOOD or tr.MatType == MAT_FLESH or tr.MatType == MAT_ALIENFLESH) then - PenetrationDirection = tr.Normal * (MaxPenetration * 2) - end - - local trace = {} - trace.endpos = tr.HitPos - trace.start = tr.HitPos + PenetrationDirection - trace.mask = MASK_SHOT - trace.filter = {self.Owner} - - local trace = util.TraceLine(trace) - - // -- Bullet didn't penetrate. - if (trace.StartSolid or trace.Fraction >= 1.0 or tr.Fraction <= 0.0) then return false end - - // -- Damage multiplier depending on surface - local fDamageMulti = 0.5 - - if self.Primary.Ammo == "SniperPenetratedRound" then - fDamageMulti = 1 - elseif(tr.MatType == MAT_CONCRETE or tr.MatType == MAT_METAL) then - fDamageMulti = 0.3 - elseif (tr.MatType == MAT_WOOD or tr.MatType == MAT_PLASTIC or tr.MatType == MAT_GLASS) then - fDamageMulti = 0.8 - elseif (tr.MatType == MAT_FLESH or tr.MatType == MAT_ALIENFLESH) then - fDamageMulti = 0.9 - end - - local damagedice = math.Rand(.85,1.3) - local newdamage = self.Primary.Damage * damagedice - - // -- Fire bullet from the exit point using the original trajectory - local penetratedbullet = {} - penetratedbullet.Num = 1 - penetratedbullet.Src = trace.HitPos - penetratedbullet.Dir = tr.Normal - penetratedbullet.Spread = Vector(0, 0, 0) - penetratedbullet.Tracer = 2 - penetratedbullet.TracerName = "m9k_effect_mad_penetration_trace" - penetratedbullet.Force = 5 - penetratedbullet.Damage = paininfo:GetDamage() * fDamageMulti - penetratedbullet.Callback = function(a, b, c) if (self.Ricochet) then - local impactnum - if tr.MatType == MAT_GLASS then impactnum = 0 else impactnum = 1 end - return self:RicochetCallback(bouncenum + impactnum, a,b,c) end end - - timer.Simple(0, function() if attacker != nil then attacker:FireBullets(penetratedbullet) end end) - - return true -end - - -function SWEP:SecondaryAttack() - return false -end - -function SWEP:Reload() - if not IsValid(self) then return end if not IsValid(self.Owner) then return end - - if self.Owner:IsNPC() then - self.Weapon:DefaultReload(ACT_VM_RELOAD) - return end - - if self.Owner:KeyDown(IN_USE) then return end - - if self.Silenced then - self.Weapon:DefaultReload(ACT_VM_RELOAD_SILENCED) - else - self.Weapon:DefaultReload(ACT_VM_RELOAD) - end - - if !self.Owner:IsNPC() then - if self.Owner:GetViewModel() == nil then self.ResetSights = CurTime() + 3 else - self.ResetSights = CurTime() + self.Owner:GetViewModel():SequenceDuration() - end - end - - if SERVER and self.Weapon != nil then - if ( self.Weapon:Clip1() < self.Primary.ClipSize ) and !self.Owner:IsNPC() then - -- //When the current clip < full clip and the rest of your ammo > 0, then - self.Owner:SetFOV( 0, 0.3 ) - -- //Zoom = 0 - self:SetIronsights(false) - -- //Set the ironsight to false - self.Weapon:SetNWBool("Reloading", true) - end - local waitdammit = (self.Owner:GetViewModel():SequenceDuration()) - timer.Simple(waitdammit + .1, - function() - if self.Weapon == nil then return end - self.Weapon:SetNWBool("Reloading", false) - if self.Owner:KeyDown(IN_ATTACK2) and self.Weapon:GetClass() == self.Gun then - if CLIENT then return end - if self.Scoped == false then - self.Owner:SetFOV( self.Secondary.IronFOV, 0.3 ) - self.IronSightsPos = self.SightsPos -- Bring it up - self.IronSightsAng = self.SightsAng -- Bring it up - self:SetIronsights(true, self.Owner) - self.DrawCrosshair = false - else return end - elseif self.Owner:KeyDown(IN_SPEED) and self.Weapon:GetClass() == self.Gun then - if self.Weapon:GetNextPrimaryFire() <= (CurTime() + .03) then - self.Weapon:SetNextPrimaryFire(CurTime()+0.3) -- Make it so you can't shoot for another quarter second - end - self.IronSightsPos = self.RunSightsPos -- Hold it down - self.IronSightsAng = self.RunSightsAng -- Hold it down - self:SetIronsights(true, self.Owner) -- Set the ironsight true - self.Owner:SetFOV( 0, 0.3 ) - else return end - end) - end -end - -function SWEP:PostReloadScopeCheck() - if self.Weapon == nil then return end - self.Weapon:SetNWBool("Reloading", false) - if self.Owner:KeyDown(IN_ATTACK2) and self.Weapon:GetClass() == self.Gun then - if CLIENT then return end - if self.Scoped == false then - self.Owner:SetFOV( self.Secondary.IronFOV, 0.3 ) - self.IronSightsPos = self.SightsPos -- Bring it up - self.IronSightsAng = self.SightsAng -- Bring it up - self:SetIronsights(true, self.Owner) - self.DrawCrosshair = false - else return end - elseif self.Owner:KeyDown(IN_SPEED) and self.Weapon:GetClass() == self.Gun then - if self.Weapon:GetNextPrimaryFire() <= (CurTime() + .03) then - self.Weapon:SetNextPrimaryFire(CurTime()+0.3) -- Make it so you can't shoot for another quarter second - end - self.IronSightsPos = self.RunSightsPos -- Hold it down - self.IronSightsAng = self.RunSightsAng -- Hold it down - self:SetIronsights(true, self.Owner) -- Set the ironsight true - self.Owner:SetFOV( 0, 0.3 ) - else return end -end - -function SWEP:Silencer() - - if self.NextSilence > CurTime() then return end - - if self.Weapon != nil then - self.Owner:SetFOV( 0, 0.3 ) - self:SetIronsights(false) - self.Weapon:SetNWBool("Reloading", true) -- i know we're not reloading but it works - end - - if self.Silenced then - self:SendWeaponAnim(ACT_VM_DETACH_SILENCER) - self.Silenced = false - elseif not self.Silenced then - self:SendWeaponAnim(ACT_VM_ATTACH_SILENCER) - self.Silenced = true - end - - siltimer = CurTime() + (self.Owner:GetViewModel():SequenceDuration()) + 0.1 - if self.Weapon:GetNextPrimaryFire() <= siltimer then - self.Weapon:SetNextPrimaryFire(siltimer) - end - self.NextSilence = siltimer - - timer.Simple( ((self.Owner:GetViewModel():SequenceDuration()) + 0.1), - function() - if self.Weapon != nil then - self.Weapon:SetNWBool("Reloading", false) - if self.Owner:KeyDown(IN_ATTACK2) and self.Weapon:GetClass() == self.Gun then - if CLIENT then return end - if self.Scoped == false then - self.Owner:SetFOV( self.Secondary.IronFOV, 0.3 ) - self.IronSightsPos = self.SightsPos -- Bring it up - self.IronSightsAng = self.SightsAng -- Bring it up - self:SetIronsights(true, self.Owner) - self.DrawCrosshair = false - else return end - elseif self.Owner:KeyDown(IN_SPEED) and self.Weapon:GetClass() == self.Gun then - if self.Weapon:GetNextPrimaryFire() <= (CurTime()+0.3) then - self.Weapon:SetNextPrimaryFire(CurTime()+0.3) -- Make it so you can't shoot for another quarter second - end - self.IronSightsPos = self.RunSightsPos -- Hold it down - self.IronSightsAng = self.RunSightsAng -- Hold it down - self:SetIronsights(true, self.Owner) -- Set the ironsight true - self.Owner:SetFOV( 0, 0.3 ) - else return end - end - end) - -end - -function SWEP:SelectFireMode() - - if self.Primary.Automatic then - self.Primary.Automatic = false - self.NextFireSelect = CurTime() + .5 - if CLIENT then - self.Owner:PrintMessage(HUD_PRINTTALK, "Semi-automatic selected.") - end - self.Weapon:EmitSound("Weapon_AR2.Empty") - else - self.Primary.Automatic = true - self.NextFireSelect = CurTime() + .5 - if CLIENT then - self.Owner:PrintMessage(HUD_PRINTTALK, "Automatic selected.") - end - self.Weapon:EmitSound("Weapon_AR2.Empty") - end -end - - -/*--------------------------------------------------------- -IronSight ------------------------------------------------------*/ -function SWEP:IronSight() - - if not IsValid(self) then return end - if not IsValid(self.Owner) then return end - - if !self.Owner:IsNPC() then - if self.ResetSights and CurTime() >= self.ResetSights then - self.ResetSights = nil - - if self.Silenced then - self:SendWeaponAnim(ACT_VM_IDLE_SILENCED) - else - self:SendWeaponAnim(ACT_VM_IDLE) - end - end end - - if self.CanBeSilenced and self.NextSilence < CurTime() then - if self.Owner:KeyDown(IN_USE) and self.Owner:KeyPressed(IN_ATTACK2) then - self:Silencer() - end - end - - if self.SelectiveFire and self.NextFireSelect < CurTime() and not (self.Weapon:GetNWBool("Reloading")) then - if self.Owner:KeyDown(IN_USE) and self.Owner:KeyPressed(IN_RELOAD) then - self:SelectFireMode() - end - end - --- //copy this... - if self.Owner:KeyPressed(IN_SPEED) and not (self.Weapon:GetNWBool("Reloading")) then -- If you are running - if self.Weapon:GetNextPrimaryFire() <= (CurTime()+0.3) then - self.Weapon:SetNextPrimaryFire(CurTime()+0.3) -- Make it so you can't shoot for another quarter second - end - self.IronSightsPos = self.RunSightsPos -- Hold it down - self.IronSightsAng = self.RunSightsAng -- Hold it down - self:SetIronsights(true, self.Owner) -- Set the ironsight true - self.Owner:SetFOV( 0, 0.3 ) - self.DrawCrosshair = false - end - - if self.Owner:KeyReleased (IN_SPEED) then -- If you release run then - self:SetIronsights(false, self.Owner) -- Set the ironsight true - self.Owner:SetFOV( 0, 0.3 ) - self.DrawCrosshair = self.OrigCrossHair - end -- Shoulder the gun - --- //down to this - if !self.Owner:KeyDown(IN_USE) and !self.Owner:KeyDown(IN_SPEED) then - -- //If the key E (Use Key) is not pressed, then - - if self.Owner:KeyPressed(IN_ATTACK2) and not (self.Weapon:GetNWBool("Reloading")) then - self.Owner:SetFOV( self.Secondary.IronFOV, 0.3 ) - self.IronSightsPos = self.SightsPos -- Bring it up - self.IronSightsAng = self.SightsAng -- Bring it up - self:SetIronsights(true, self.Owner) - self.DrawCrosshair = false - -- //Set the ironsight true - - if CLIENT then return end - end - end - - if self.Owner:KeyReleased(IN_ATTACK2) and !self.Owner:KeyDown(IN_USE) and !self.Owner:KeyDown(IN_SPEED) then - -- //If the right click is released, then - self.Owner:SetFOV( 0, 0.3 ) - self.DrawCrosshair = self.OrigCrossHair - self:SetIronsights(false, self.Owner) - -- //Set the ironsight false - - if CLIENT then return end - end - - if self.Owner:KeyDown(IN_ATTACK2) and !self.Owner:KeyDown(IN_USE) and !self.Owner:KeyDown(IN_SPEED) then - self.SwayScale = 0.05 - self.BobScale = 0.05 - else - self.SwayScale = 1.0 - self.BobScale = 1.0 - end -end - -/*--------------------------------------------------------- -Think ------------------------------------------------------*/ -function SWEP:Think() - -self:IronSight() - -end - -/*--------------------------------------------------------- -GetViewModelPosition ------------------------------------------------------*/ -local IRONSIGHT_TIME = 0.3 --- //Time to enter in the ironsight mod - -function SWEP:GetViewModelPosition(pos, ang) - - if (not self.IronSightsPos) then return pos, ang end - - local bIron = self.Weapon:GetNWBool("M9K_Ironsights") - - if (bIron != self.bLastIron) then - self.bLastIron = bIron - self.fIronTime = CurTime() - - end - - local fIronTime = self.fIronTime or 0 - - if (not bIron and fIronTime < CurTime() - IRONSIGHT_TIME) then - return pos, ang - end - - local Mul = 1.0 - - if (fIronTime > CurTime() - IRONSIGHT_TIME) then - Mul = math.Clamp((CurTime() - fIronTime) / IRONSIGHT_TIME, 0, 1) - - if not bIron then Mul = 1 - Mul end - end - - local Offset = self.IronSightsPos - - if (self.IronSightsAng) then - ang = ang * 1 - ang:RotateAroundAxis(ang:Right(), self.IronSightsAng.x * Mul) - ang:RotateAroundAxis(ang:Up(), self.IronSightsAng.y * Mul) - ang:RotateAroundAxis(ang:Forward(), self.IronSightsAng.z * Mul) - end - - local Right = ang:Right() - local Up = ang:Up() - local Forward = ang:Forward() - - pos = pos + Offset.x * Right * Mul - pos = pos + Offset.y * Forward * Mul - pos = pos + Offset.z * Up * Mul - - return pos, ang -end - -/*--------------------------------------------------------- -SetIronsights ------------------------------------------------------*/ -function SWEP:SetIronsights(b) - self.Weapon:SetNWBool("M9K_Ironsights", b) -end - -function SWEP:GetIronsights() - return self.Weapon:GetNWBool("M9K_Ironsights") -end - - -if CLIENT then - - SWEP.vRenderOrder = nil - function SWEP:ViewModelDrawn() - - if not IsValid(self) then return end - if not IsValid(self.Owner) then return end - local vm = self.Owner:GetViewModel() - if !IsValid(vm) then return end - - if (!self.VElements) then return end - - self:UpdateBonePositions(vm) - - if (!self.vRenderOrder) then - - -- // we build a render order because sprites need to be drawn after models - self.vRenderOrder = {} - - for k, v in pairs( self.VElements ) do - if (v.type == "Model") then - table.insert(self.vRenderOrder, 1, k) - elseif (v.type == "Sprite" or v.type == "Quad") then - table.insert(self.vRenderOrder, k) - end - end - - end - - for k, name in ipairs( self.vRenderOrder ) do - - local v = self.VElements[name] - if (!v) then self.vRenderOrder = nil break end - if (v.hide) then continue end - - local model = v.modelEnt - local sprite = v.spriteMaterial - - if (!v.bone) then continue end - - local pos, ang = self:GetBoneOrientation( self.VElements, v, vm ) - - if (!pos) then continue end - - if (v.type == "Model" and IsValid(model)) then - - model:SetPos(pos + ang:Forward() * v.pos.x + ang:Right() * v.pos.y + ang:Up() * v.pos.z ) - ang:RotateAroundAxis(ang:Up(), v.angle.y) - ang:RotateAroundAxis(ang:Right(), v.angle.p) - ang:RotateAroundAxis(ang:Forward(), v.angle.r) - - model:SetAngles(ang) - -- //model:SetModelScale(v.size) - local matrix = Matrix() - matrix:Scale(v.size) - model:EnableMatrix( "RenderMultiply", matrix ) - - if (v.material == "") then - model:SetMaterial("") - elseif (model:GetMaterial() != v.material) then - model:SetMaterial( v.material ) - end - - if (v.skin and v.skin != model:GetSkin()) then - model:SetSkin(v.skin) - end - - if (v.bodygroup) then - for k, v in pairs( v.bodygroup ) do - if (model:GetBodygroup(k) != v) then - model:SetBodygroup(k, v) - end - end - end - - if (v.surpresslightning) then - render.SuppressEngineLighting(true) - end - - render.SetColorModulation(v.color.r/255, v.color.g/255, v.color.b/255) - render.SetBlend(v.color.a/255) - model:DrawModel() - render.SetBlend(1) - render.SetColorModulation(1, 1, 1) - - if (v.surpresslightning) then - render.SuppressEngineLighting(false) - end - - elseif (v.type == "Sprite" and sprite) then - - local drawpos = pos + ang:Forward() * v.pos.x + ang:Right() * v.pos.y + ang:Up() * v.pos.z - render.SetMaterial(sprite) - render.DrawSprite(drawpos, v.size.x, v.size.y, v.color) - - elseif (v.type == "Quad" and v.draw_func) then - - local drawpos = pos + ang:Forward() * v.pos.x + ang:Right() * v.pos.y + ang:Up() * v.pos.z - ang:RotateAroundAxis(ang:Up(), v.angle.y) - ang:RotateAroundAxis(ang:Right(), v.angle.p) - ang:RotateAroundAxis(ang:Forward(), v.angle.r) - - cam.Start3D2D(drawpos, ang, v.size) - v.draw_func( self ) - cam.End3D2D() - - end - - end - - end - - SWEP.wRenderOrder = nil - function SWEP:DrawWorldModel() - - if (self.ShowWorldModel == nil or self.ShowWorldModel) then - self:DrawModel() - end - - if (!self.WElements) then return end - - if (!self.wRenderOrder) then - - self.wRenderOrder = {} - - for k, v in pairs( self.WElements ) do - if (v.type == "Model") then - table.insert(self.wRenderOrder, 1, k) - elseif (v.type == "Sprite" or v.type == "Quad") then - table.insert(self.wRenderOrder, k) - end - end - - end - - if (IsValid(self.Owner)) then - bone_ent = self.Owner - else - -- // when the weapon is dropped - bone_ent = self - end - - for k, name in pairs( self.wRenderOrder ) do - - local v = self.WElements[name] - if (!v) then self.wRenderOrder = nil break end - if (v.hide) then continue end - - local pos, ang - - if (v.bone) then - pos, ang = self:GetBoneOrientation( self.WElements, v, bone_ent ) - else - pos, ang = self:GetBoneOrientation( self.WElements, v, bone_ent, "ValveBiped.Bip01_R_Hand" ) - end - - if (!pos) then continue end - - local model = v.modelEnt - local sprite = v.spriteMaterial - - if (v.type == "Model" and IsValid(model)) then - - model:SetPos(pos + ang:Forward() * v.pos.x + ang:Right() * v.pos.y + ang:Up() * v.pos.z ) - ang:RotateAroundAxis(ang:Up(), v.angle.y) - ang:RotateAroundAxis(ang:Right(), v.angle.p) - ang:RotateAroundAxis(ang:Forward(), v.angle.r) - - model:SetAngles(ang) - -- //model:SetModelScale(v.size) - local matrix = Matrix() - matrix:Scale(v.size) - model:EnableMatrix( "RenderMultiply", matrix ) - - if (v.material == "") then - model:SetMaterial("") - elseif (model:GetMaterial() != v.material) then - model:SetMaterial( v.material ) - end - - if (v.skin and v.skin != model:GetSkin()) then - model:SetSkin(v.skin) - end - - if (v.bodygroup) then - for k, v in pairs( v.bodygroup ) do - if (model:GetBodygroup(k) != v) then - model:SetBodygroup(k, v) - end - end - end - - if (v.surpresslightning) then - render.SuppressEngineLighting(true) - end - - render.SetColorModulation(v.color.r/255, v.color.g/255, v.color.b/255) - render.SetBlend(v.color.a/255) - model:DrawModel() - render.SetBlend(1) - render.SetColorModulation(1, 1, 1) - - if (v.surpresslightning) then - render.SuppressEngineLighting(false) - end - - elseif (v.type == "Sprite" and sprite) then - - local drawpos = pos + ang:Forward() * v.pos.x + ang:Right() * v.pos.y + ang:Up() * v.pos.z - render.SetMaterial(sprite) - render.DrawSprite(drawpos, v.size.x, v.size.y, v.color) - - elseif (v.type == "Quad" and v.draw_func) then - - local drawpos = pos + ang:Forward() * v.pos.x + ang:Right() * v.pos.y + ang:Up() * v.pos.z - ang:RotateAroundAxis(ang:Up(), v.angle.y) - ang:RotateAroundAxis(ang:Right(), v.angle.p) - ang:RotateAroundAxis(ang:Forward(), v.angle.r) - - cam.Start3D2D(drawpos, ang, v.size) - v.draw_func( self ) - cam.End3D2D() - - end - - end - - end - - function SWEP:GetBoneOrientation( basetab, tab, ent, bone_override ) - - local bone, pos, ang - if (tab.rel and tab.rel != "") then - - local v = basetab[tab.rel] - - if (!v) then return end - - -- // Technically, if there exists an element with the same name as a bone - -- // you can get in an infinite loop. Let's just hope nobody's that stupid. - pos, ang = self:GetBoneOrientation( basetab, v, ent ) - - if (!pos) then return end - - pos = pos + ang:Forward() * v.pos.x + ang:Right() * v.pos.y + ang:Up() * v.pos.z - ang:RotateAroundAxis(ang:Up(), v.angle.y) - ang:RotateAroundAxis(ang:Right(), v.angle.p) - ang:RotateAroundAxis(ang:Forward(), v.angle.r) - - else - - bone = ent:LookupBone(bone_override or tab.bone) - - if (!bone) then return end - - pos, ang = Vector(0,0,0), Angle(0,0,0) - local m = ent:GetBoneMatrix(bone) - if (m) then - pos, ang = m:GetTranslation(), m:GetAngles() - end - - if (IsValid(self.Owner) and self.Owner:IsPlayer() and - ent == self.Owner:GetViewModel() and self.ViewModelFlip) then - ang.r = -ang.r --// Fixes mirrored models - end - - end - - return pos, ang - end - - function SWEP:CreateModels( tab ) - - if (!tab) then return end - - -- // Create the clientside models here because Garry says we can't do it in the render hook - for k, v in pairs( tab ) do - if (v.type == "Model" and v.model and v.model != "" and (!IsValid(v.modelEnt) or v.createdModel != v.model) and - string.find(v.model, ".mdl") and file.Exists (v.model, "GAME") ) then - - v.modelEnt = ClientsideModel(v.model, RENDER_GROUP_VIEW_MODEL_OPAQUE) - if (IsValid(v.modelEnt)) then - v.modelEnt:SetPos(self:GetPos()) - v.modelEnt:SetAngles(self:GetAngles()) - v.modelEnt:SetParent(self) - v.modelEnt:SetNoDraw(true) - v.createdModel = v.model - else - v.modelEnt = nil - end - - elseif (v.type == "Sprite" and v.sprite and v.sprite != "" and (!v.spriteMaterial or v.createdSprite != v.sprite) - and file.Exists ("materials/"..v.sprite..".vmt", "GAME")) then - - local name = v.sprite.."-" - local params = { ["$basetexture"] = v.sprite } - -- // make sure we create a unique name based on the selected options - local tocheck = { "nocull", "additive", "vertexalpha", "vertexcolor", "ignorez" } - for i, j in pairs( tocheck ) do - if (v[j]) then - params["$"..j] = 1 - name = name.."1" - else - name = name.."0" - end - end - - v.createdSprite = v.sprite - v.spriteMaterial = CreateMaterial(name,"UnlitGeneric",params) - - end - end - - end - - local allbones - local hasGarryFixedBoneScalingYet = false - - function SWEP:UpdateBonePositions(vm) - - if self.ViewModelBoneMods then - - if (!vm:GetBoneCount()) then return end - - -- // !! WORKAROUND !! --// - -- // We need to check all model names :/ - local loopthrough = self.ViewModelBoneMods - if (!hasGarryFixedBoneScalingYet) then - allbones = {} - for i=0, vm:GetBoneCount() do - local bonename = vm:GetBoneName(i) - if (self.ViewModelBoneMods[bonename]) then - allbones[bonename] = self.ViewModelBoneMods[bonename] - else - allbones[bonename] = { - scale = Vector(1,1,1), - pos = Vector(0,0,0), - angle = Angle(0,0,0) - } - end - end - - loopthrough = allbones - end - //!! ----------- !! -- - - for k, v in pairs( loopthrough ) do - local bone = vm:LookupBone(k) - if (!bone) then continue end - - -- // !! WORKAROUND !! --// - local s = Vector(v.scale.x,v.scale.y,v.scale.z) - local p = Vector(v.pos.x,v.pos.y,v.pos.z) - local ms = Vector(1,1,1) - if (!hasGarryFixedBoneScalingYet) then - local cur = vm:GetBoneParent(bone) - while(cur >= 0) do - local pscale = loopthrough[vm:GetBoneName(cur)].scale - ms = ms * pscale - cur = vm:GetBoneParent(cur) - end - end - - s = s * ms - //!! ----------- !! -- - - if vm:GetManipulateBoneScale(bone) != s then - vm:ManipulateBoneScale( bone, s ) - end - if vm:GetManipulateBoneAngles(bone) != v.angle then - vm:ManipulateBoneAngles( bone, v.angle ) - end - if vm:GetManipulateBonePosition(bone) != p then - vm:ManipulateBonePosition( bone, p ) - end - end - else - self:ResetBonePositions(vm) - end - - end - - function SWEP:ResetBonePositions(vm) - - if (!vm:GetBoneCount()) then return end - for i=0, vm:GetBoneCount() do - vm:ManipulateBoneScale( i, Vector(1, 1, 1) ) - vm:ManipulateBoneAngles( i, Angle(0, 0, 0) ) - vm:ManipulateBonePosition( i, Vector(0, 0, 0) ) - end - - end - - /************************** - Global utility code - **************************/ - - -- // Fully copies the table, meaning all tables inside this table are copied too and so on (normal table.Copy copies only their reference). - -- // Does not copy entities of course, only copies their reference. - -- // WARNING: do not use on tables that contain themselves somewhere down the line or you'll get an infinite loop - function table.FullCopy( tab ) - - if (!tab) then return nil end - - local res = {} - for k, v in pairs( tab ) do - if (type(v) == "table") then - res[k] = table.FullCopy(v) --// recursion ho! - elseif (type(v) == "Vector") then - res[k] = Vector(v.x, v.y, v.z) - elseif (type(v) == "Angle") then - res[k] = Angle(v.p, v.y, v.r) - else - res[k] = v - end - end - - return res - - end - -end - +-- //Variables that are used on both client and server +SWEP.Category = "" +SWEP.Gun = "" +SWEP.Author = "Generic Default, Worshipper, Clavus, and Bob" +SWEP.Contact = "" +SWEP.Purpose = "" +SWEP.Instructions = "" +SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models +SWEP.DrawCrosshair = true -- Hell no, crosshairs r 4 nubz! +SWEP.ViewModelFOV = 65 -- How big the gun will look +SWEP.ViewModelFlip = true -- True for CSS models, False for HL2 models + +SWEP.Spawnable = false +SWEP.AdminSpawnable = false + +SWEP.Primary.Sound = Sound("") -- Sound of the gun +SWEP.Primary.Round = ("") -- What kind of bullet? +SWEP.Primary.Cone = 0.2 -- Accuracy of NPCs +SWEP.Primary.Recoil = 10 +SWEP.Primary.Damage = 10 +SWEP.Primary.Spread = .01 --define from-the-hip accuracy (1 is terrible, .0001 is exact) +SWEP.Primary.NumShots = 1 +SWEP.Primary.RPM = 0 -- This is in Rounds Per Minute +SWEP.Primary.ClipSize = 0 -- Size of a clip +SWEP.Primary.DefaultClip = 0 -- Default number of bullets in a clip +SWEP.Primary.KickUp = 0 -- Maximum up recoil (rise) +SWEP.Primary.KickDown = 0 -- Maximum down recoil (skeet) +SWEP.Primary.KickHorizontal = 0 -- Maximum side recoil (koolaid) +SWEP.Primary.Automatic = true -- Automatic/Semi Auto +SWEP.Primary.Ammo = "none" -- What kind of ammo + +-- SWEP.Secondary.ClipSize = 0 -- Size of a clip +-- SWEP.Secondary.DefaultClip = 0 -- Default number of bullets in a clip +-- SWEP.Secondary.Automatic = false -- Automatic/Semi Auto +SWEP.Secondary.Ammo = "" +--//HAHA! GOTCHA, YA BASTARD! + +-- SWEP.Secondary.IronFOV = 0 -- How much you 'zoom' in. Less is more! + +SWEP.Penetration = true +SWEP.Ricochet = true +SWEP.MaxRicochet = 1 +SWEP.RicochetCoin = 1 +SWEP.BoltAction = false +SWEP.Scoped = false +SWEP.ShellTime = .35 +SWEP.Tracer = 0 +SWEP.CanBeSilenced = false +SWEP.Silenced = false +SWEP.NextSilence = 0 +SWEP.SelectiveFire = false +SWEP.NextFireSelect = 0 +SWEP.OrigCrossHair = true + +local PainMulti = 1 + +if GetConVar("M9KDamageMultiplier") == nil then + PainMulti = 1 + print("M9KDamageMultiplier is missing! You may have hit the lua limit! Reverting multiplier to 1.") +else + PainMulti = GetConVar("M9KDamageMultiplier"):GetFloat() + if PainMulti < 0 then + PainMulti = PainMulti * -1 + print("Your damage multiplier was in the negatives. It has been reverted to a positive number. Your damage multiplier is now "..PainMulti) + end +end + +function NewM9KDamageMultiplier(cvar, previous, new) + print("multiplier has been changed ") + if GetConVar("M9KDamageMultiplier") == nil then + PainMulti = 1 + print("M9KDamageMultiplier is missing! You may have hit the lua limit! Reverting multiplier to 1, you will notice no changes.") + else + PainMulti = GetConVar("M9KDamageMultiplier"):GetFloat() + if PainMulti < 0 then + PainMulti = PainMulti * -1 + print("Your damage multiplier was in the negatives. It has been reverted to a positive number. Your damage multiplier is now "..PainMulti) + end + end +end +cvars.AddChangeCallback("M9KDamageMultiplier", NewM9KDamageMultiplier) + +function NewDefClips(cvar, previous, new) + print("Default clip multiplier has changed. A server restart will be required for these changes to take effect.") +end +cvars.AddChangeCallback("M9KDefaultClip", NewDefClips) + +if GetConVar("M9KDefaultClip") == nil then + print("M9KDefaultClip is missing! You may have hit the lua limit!") +else + if GetConVar("M9KDefaultClip"):GetInt() >= 0 then + print("M9K Weapons will now spawn with "..GetConVar("M9KDefaultClip"):GetFloat().." clips.") + else + print("Default clips will be not be modified") + end +end + +SWEP.VElements = {} +SWEP.WElements = {} + +function SWEP:Initialize() + self.Reloadaftershoot = 0 -- Can't reload when firing + self:SetHoldType(self.HoldType) + self.OrigCrossHair = self.DrawCrosshair + if SERVER and self.Owner:IsNPC() then + self:SetNPCMinBurst(3) + self:SetNPCMaxBurst(10) -- None of this really matters but you need it here anyway + self:SetNPCFireRate(1/(self.Primary.RPM/60)) + -- //self:SetCurrentWeaponProficiency( WEAPON_PROFICIENCY_VERY_GOOD ) + end + + if CLIENT then + + -- // Create a new table for every weapon instance + self.VElements = table.FullCopy( self.VElements ) + self.WElements = table.FullCopy( self.WElements ) + self.ViewModelBoneMods = table.FullCopy( self.ViewModelBoneMods ) + + self:CreateModels(self.VElements) -- create viewmodels + self:CreateModels(self.WElements) -- create worldmodels + + -- // init view model bone build function + if IsValid(self.Owner) and self.Owner:IsPlayer() then + if self.Owner:Alive() then + local vm = self.Owner:GetViewModel() + if IsValid(vm) then + self:ResetBonePositions(vm) + -- // Init viewmodel visibility + if (self.ShowViewModel == nil or self.ShowViewModel) then + vm:SetColor(Color(255,255,255,255)) + else + -- // however for some reason the view model resets to render mode 0 every frame so we just apply a debug material to prevent it from drawing + vm:SetMaterial("Debug/hsv") + end + end + + end + end + + end + + if CLIENT then + local oldpath = "vgui/hud/name" -- the path goes here + local newpath = string.gsub(oldpath, "name", self.Gun) + self.WepSelectIcon = surface.GetTextureID(newpath) + end + +end + +function SWEP:Equip() + self:SetHoldType(self.HoldType) + self:SetIronsights(false, self.Owner) +end + +function SWEP:Deploy() + self:SetHoldType(self.HoldType) + + if self.Silenced then + self.Weapon:SendWeaponAnim( ACT_VM_DRAW_SILENCED ) + else + self.Weapon:SendWeaponAnim( ACT_VM_DRAW ) + end + self:SetIronsights(false, self.Owner) + + self.Weapon:SetNWBool("Reloading", false) + + if !self.Owner:IsNPC() and self.Owner != nil then + if self.ResetSights and self.Owner:GetViewModel() != nil then + self.ResetSights = CurTime() + self.Owner:GetViewModel():SequenceDuration() + end + end + return true +end + +function SWEP:Holster() + + if CLIENT and IsValid(self.Owner) and not self.Owner:IsNPC() then + local vm = self.Owner:GetViewModel() + if IsValid(vm) then + self:ResetBonePositions(vm) + end + end + self:SetIronsights(false, self.Owner) + + return true +end + +function SWEP:OnRemove() + + if CLIENT and IsValid(self.Owner) and not self.Owner:IsNPC() then + local vm = self.Owner:GetViewModel() + if IsValid(vm) then + self:ResetBonePositions(vm) + end + end + +end + +function SWEP:GetCapabilities() + return CAP_WEAPON_RANGE_ATTACK1, CAP_INNATE_RANGE_ATTACK1 +end + +function SWEP:Precache() + util.PrecacheSound(self.Primary.Sound) + util.PrecacheModel(self.ViewModel) + util.PrecacheModel(self.WorldModel) +end + +function SWEP:PrimaryAttack() + OkaySoFar = true + if not IsValid(self) then + OkaySoFar = false + else if not IsValid(self.Weapon) then + OkaySoFar = false + else if not IsValid(self.Owner) then + OkaySoFar = false + end end end + + if not OkaySoFar then return end + + if self:CanPrimaryAttack() and self.Owner:IsPlayer() then + if !self.Owner:KeyDown(IN_RELOAD) then + self:ShootBulletInformation() + self.Weapon:TakePrimaryAmmo(1) + + if self.Silenced then + self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK_SILENCED ) + self.Weapon:EmitSound(self.Primary.SilencedSound) + else + self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK ) + self.Weapon:EmitSound(self.Primary.Sound) + end + + local fx = EffectData() + fx:SetEntity(self.Weapon) + fx:SetOrigin(self.Owner:GetShootPos()) + fx:SetNormal(self.Owner:GetAimVector()) + fx:SetAttachment(self.MuzzleAttachment) + if GetConVar("M9KGasEffect") != nil then + if GetConVar("M9KGasEffect"):GetBool() then + util.Effect("m9k_rg_muzzle_rifle",fx) + end + end + self.Owner:SetAnimation( PLAYER_ATTACK1 ) + self.Owner:MuzzleFlash() + self.Weapon:SetNextPrimaryFire(CurTime()+1/(self.Primary.RPM/60)) + self:CheckWeaponsAndAmmo() + self.RicochetCoin = (1) + if self.BoltAction then self:BoltBack() end + end + elseif self:CanPrimaryAttack() and self.Owner:IsNPC() then + self:ShootBulletInformation() + self.Weapon:TakePrimaryAmmo(1) + self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK ) + self.Weapon:EmitSound(self.Primary.Sound) + self.Owner:SetAnimation( PLAYER_ATTACK1 ) + self.Owner:MuzzleFlash() + self.Weapon:SetNextPrimaryFire(CurTime()+1/(self.Primary.RPM/60)) + self.RicochetCoin = (1) + end + end + +function SWEP:CheckWeaponsAndAmmo() + if SERVER and self.Weapon != nil and (GetConVar("M9KWeaponStrip"):GetBool()) then + if self.Weapon:Clip1() == 0 && self.Owner:GetAmmoCount( self.Weapon:GetPrimaryAmmoType() ) == 0 then + timer.Simple(.1, function() if SERVER then if not IsValid(self) then return end + if self.Owner == nil then return end + self.Owner:StripWeapon(self.Gun) + end end) + end + end +end + + +/*--------------------------------------------------------- + Name: SWEP:ShootBulletInformation() + Desc: This func add the damage, the recoil, the number of shots and the cone on the bullet. +-----------------------------------------------------*/ +function SWEP:ShootBulletInformation() + + local CurrentDamage + local CurrentRecoil + local CurrentCone + local basedamage + local damagedice = 1 + + basedamage = PainMulti * self.Primary.Damage + CurrentDamage = basedamage * damagedice + CurrentRecoil = self.Primary.Recoil + + -- //Player is aiming + if (self:GetIronsights() == true) and self.Owner:KeyDown(IN_ATTACK2) then + self:ShootBullet(CurrentDamage, CurrentRecoil, self.Primary.NumShots, self.Primary.IronAccuracy) + -- //Player is not aiming + else + if IsValid(self) then + if IsValid(self.Weapon) then + if IsValid(self.Owner) then + self:ShootBullet(CurrentDamage, CurrentRecoil, self.Primary.NumShots, self.Primary.Spread) + end + end + end + end + +end + +/*--------------------------------------------------------- + Name: SWEP:ShootBullet() + Desc: A convenience func to shoot bullets. +-----------------------------------------------------*/ +local TracerName = "Tracer" + +function SWEP:ShootBullet(damage, recoil, num_bullets, aimcone) + + num_bullets = num_bullets or 1 + aimcone = aimcone or 0 + + self:ShootEffects() + + if self.Tracer == 1 then + TracerName = "Ar2Tracer" + elseif self.Tracer == 2 then + TracerName = "AirboatGunHeavyTracer" + else + TracerName = "Tracer" + end + + local bullet = {} + bullet.Num = num_bullets + bullet.Src = self.Owner:GetShootPos() -- Source + bullet.Dir = self.Owner:GetAimVector() -- Dir of bullet + bullet.Spread = Vector(aimcone, aimcone, 0) -- Aim Cone + bullet.Tracer = 3 -- Show a tracer on every x bullets + bullet.TracerName = TracerName + bullet.Force = damage * 0.25 -- Amount of force to give to phys objects + bullet.Damage = damage + bullet.Callback = function(attacker, tracedata, dmginfo) + return self:RicochetCallback(0, attacker, tracedata, dmginfo) + end + if IsValid(self) then + if IsValid(self.Weapon) then + if IsValid(self.Owner) then + self.Owner:FireBullets(bullet) + end + end + end + -- //if SERVER and !self.Owner:IsNPC() then + -- // local anglo = Angle(math.Rand(-self.Primary.KickDown,-self.Primary.KickUp), math.Rand(-self.Primary.KickHorizontal,self.Primary.KickHorizontal), 0) + -- // self.Owner:ViewPunch(anglo) + + -- // local eyes = self.Owner:EyeAngles() + -- // eyes.pitch = eyes.pitch + anglo.pitch + -- // eyes.yaw = eyes.yaw + anglo.yaw + -- // if game.SinglePlayer() then self.Owner:SetEyeAngles(eyes) end + -- //end + + + + if !self.Owner:IsNPC() then + + local anglo = Angle(-self.Primary.Recoil) + local eyes = self.Owner:EyeAngles() + eyes.pitch = eyes.pitch + (anglo.pitch/3) + eyes.yaw = eyes.yaw + (anglo.yaw/3) + self.Owner:SetEyeAngles(eyes) + end + +end + +/*--------------------------------------------------------- + Name: SWEP:RicochetCallback() +-----------------------------------------------------*/ + +function SWEP:RicochetCallback(bouncenum, attacker, tr, dmginfo) + + if not IsFirstTimePredicted() then + return {damage = false, effects = false} + end + + local PenetrationChecker = false + + if GetConVar("M9KDisablePenetration") == nil then + PenetrationChecker = false + else + PenetrationChecker = GetConVar("M9KDisablePenetration"):GetBool() + end + + if PenetrationChecker then return {damage = true, effects = DoDefaultEffect} end + + bulletmiss = {} + bulletmiss[1]=Sound("weapons/fx/nearmiss/bulletLtoR03.wav") + bulletmiss[2]=Sound("weapons/fx/nearmiss/bulletLtoR04.wav") + bulletmiss[3]=Sound("weapons/fx/nearmiss/bulletLtoR06.wav") + bulletmiss[4]=Sound("weapons/fx/nearmiss/bulletLtoR07.wav") + bulletmiss[5]=Sound("weapons/fx/nearmiss/bulletLtoR09.wav") + bulletmiss[6]=Sound("weapons/fx/nearmiss/bulletLtoR10.wav") + bulletmiss[7]=Sound("weapons/fx/nearmiss/bulletLtoR13.wav") + bulletmiss[8]=Sound("weapons/fx/nearmiss/bulletLtoR14.wav") + + local DoDefaultEffect = true + if (tr.HitSky) then return end + + // -- Can we go through whatever we hit? + if (self.Penetration) and (self:BulletPenetrate(bouncenum, attacker, tr, dmginfo)) then + return {damage = true, effects = DoDefaultEffect} + end + + // -- Your screen will shake and you'll hear the savage hiss of an approaching bullet which passing if someone is shooting at you. + if (tr.MatType != MAT_METAL) then + if (SERVER) then + util.ScreenShake(tr.HitPos, 5, 0.1, 0.5, 64) + sound.Play(table.Random(bulletmiss), tr.HitPos, 75, math.random(75,150), 1) + end + + if self.Tracer == 0 or self.Tracer == 1 or self.Tracer == 2 then + local effectdata = EffectData() + effectdata:SetOrigin(tr.HitPos) + effectdata:SetNormal(tr.HitNormal) + effectdata:SetScale(20) + util.Effect("AR2Impact", effectdata) + elseif self.Tracer == 3 then + local effectdata = EffectData() + effectdata:SetOrigin(tr.HitPos) + effectdata:SetNormal(tr.HitNormal) + effectdata:SetScale(20) + util.Effect("StunstickImpact", effectdata) + end + + return + end + + if (self.Ricochet == false) then return {damage = true, effects = DoDefaultEffect} end + + if self.Primary.Ammo == "SniperPenetratedRound" then -- .50 Ammo + self.MaxRicochet = 12 + elseif self.Primary.Ammo == "pistol" then -- pistols + self.MaxRicochet = 2 + elseif self.Primary.Ammo == "357" then -- revolvers with big ass bullets + self.MaxRicochet = 4 + elseif self.Primary.Ammo == "smg1" then -- smgs + self.MaxRicochet = 5 + elseif self.Primary.Ammo == "ar2" then -- assault rifles + self.MaxRicochet = 8 + elseif self.Primary.Ammo == "buckshot" then -- shotguns + self.MaxRicochet = 1 + elseif self.Primary.Ammo == "slam" then -- secondary shotguns + self.MaxRicochet = 1 + elseif self.Primary.Ammo == "AirboatGun" then -- metal piercing shotgun pellet + self.MaxRicochet = 8 + end + + if (bouncenum > self.MaxRicochet) then return end + + // -- Bounce vector + local trace = {} + trace.start = tr.HitPos + trace.endpos = trace.start + (tr.HitNormal * 16384) + + local trace = util.TraceLine(trace) + + local DotProduct = tr.HitNormal:Dot(tr.Normal * -1) + + local ricochetbullet = {} + ricochetbullet.Num = 1 + ricochetbullet.Src = tr.HitPos + (tr.HitNormal * 5) + ricochetbullet.Dir = ((2 * tr.HitNormal * DotProduct) + tr.Normal) + (VectorRand() * 0.05) + ricochetbullet.Spread = Vector(0, 0, 0) + ricochetbullet.Tracer = 1 + ricochetbullet.TracerName = "m9k_effect_mad_ricochet_trace" + ricochetbullet.Force = dmginfo:GetDamage() * 0.15 + ricochetbullet.Damage = dmginfo:GetDamage() * 0.5 + ricochetbullet.Callback = function(a, b, c) + if (self.Ricochet) then + local impactnum + if tr.MatType == MAT_GLASS then impactnum = 0 else impactnum = 1 end + return self:RicochetCallback(bouncenum + impactnum, a, b, c) end + end + + timer.Simple(0, function() attacker:FireBullets(ricochetbullet) end) + + return {damage = true, effects = DoDefaultEffect} +end + + +/*--------------------------------------------------------- + Name: SWEP:BulletPenetrate() +-----------------------------------------------------*/ +function SWEP:BulletPenetrate(bouncenum, attacker, tr, paininfo) + + local MaxPenetration + + if self.Primary.Ammo == "SniperPenetratedRound" then -- .50 Ammo + MaxPenetration = 20 + elseif self.Primary.Ammo == "pistol" then -- pistols + MaxPenetration = 9 + elseif self.Primary.Ammo == "357" then -- revolvers with big ass bullets + MaxPenetration = 12 + elseif self.Primary.Ammo == "smg1" then -- smgs + MaxPenetration = 14 + elseif self.Primary.Ammo == "ar2" then -- assault rifles + MaxPenetration = 16 + elseif self.Primary.Ammo == "buckshot" then -- shotguns + MaxPenetration = 5 + elseif self.Primary.Ammo == "slam" then -- secondary shotguns + MaxPenetration = 5 + elseif self.Primary.Ammo == "AirboatGun" then -- metal piercing shotgun pellet + MaxPenetration = 17 + else + MaxPenetration = 14 + end + + local DoDefaultEffect = true + // -- Don't go through metal, sand or player + + if self.Primary.Ammo == "pistol" or + self.Primary.Ammo == "buckshot" or + self.Primary.Ammo == "slam" then self.Ricochet = true + else + if self.RicochetCoin == 1 then + self.Ricochet = true + elseif self.RicochetCoin >= 2 then + self.Ricochet = false + end + end + + if self.Primary.Ammo == "SniperPenetratedRound" then self.Ricochet = true end + + if self.Primary.Ammo == "SniperPenetratedRound" then -- .50 Ammo + self.MaxRicochet = 10 + elseif self.Primary.Ammo == "pistol" then -- pistols + self.MaxRicochet = 2 + elseif self.Primary.Ammo == "357" then -- revolvers with big ass bullets + self.MaxRicochet = 5 + elseif self.Primary.Ammo == "smg1" then -- smgs + self.MaxRicochet = 4 + elseif self.Primary.Ammo == "ar2" then -- assault rifles + self.MaxRicochet = 5 + elseif self.Primary.Ammo == "buckshot" then -- shotguns + self.MaxRicochet = 0 + elseif self.Primary.Ammo == "slam" then -- secondary shotguns + self.MaxRicochet = 0 + elseif self.Primary.Ammo == "AirboatGun" then -- metal piercing shotgun pellet + self.MaxRicochet = 8 + end + + if (tr.MatType == MAT_METAL and self.Ricochet == true and self.Primary.Ammo != "SniperPenetratedRound" ) then return false end + + // -- Don't go through more than 3 times + if (bouncenum > self.MaxRicochet) then return false end + + // -- Direction (and length) that we are going to penetrate + local PenetrationDirection = tr.Normal * MaxPenetration + + if (tr.MatType == MAT_GLASS or tr.MatType == MAT_PLASTIC or tr.MatType == MAT_WOOD or tr.MatType == MAT_FLESH or tr.MatType == MAT_ALIENFLESH) then + PenetrationDirection = tr.Normal * (MaxPenetration * 2) + end + + local trace = {} + trace.endpos = tr.HitPos + trace.start = tr.HitPos + PenetrationDirection + trace.mask = MASK_SHOT + trace.filter = {self.Owner} + + local trace = util.TraceLine(trace) + + // -- Bullet didn't penetrate. + if (trace.StartSolid or trace.Fraction >= 1.0 or tr.Fraction <= 0.0) then return false end + + // -- Damage multiplier depending on surface + local fDamageMulti = 0.5 + + if self.Primary.Ammo == "SniperPenetratedRound" then + fDamageMulti = 1 + elseif(tr.MatType == MAT_CONCRETE or tr.MatType == MAT_METAL) then + fDamageMulti = 0.3 + elseif (tr.MatType == MAT_WOOD or tr.MatType == MAT_PLASTIC or tr.MatType == MAT_GLASS) then + fDamageMulti = 0.8 + elseif (tr.MatType == MAT_FLESH or tr.MatType == MAT_ALIENFLESH) then + fDamageMulti = 0.9 + end + + local damagedice = math.Rand(.85,1.3) + local newdamage = self.Primary.Damage * damagedice + + // -- Fire bullet from the exit point using the original trajectory + local penetratedbullet = {} + penetratedbullet.Num = 1 + penetratedbullet.Src = trace.HitPos + penetratedbullet.Dir = tr.Normal + penetratedbullet.Spread = Vector(0, 0, 0) + penetratedbullet.Tracer = 2 + penetratedbullet.TracerName = "m9k_effect_mad_penetration_trace" + penetratedbullet.Force = 5 + penetratedbullet.Damage = paininfo:GetDamage() * fDamageMulti + penetratedbullet.Callback = function(a, b, c) if (self.Ricochet) then + local impactnum + if tr.MatType == MAT_GLASS then impactnum = 0 else impactnum = 1 end + return self:RicochetCallback(bouncenum + impactnum, a,b,c) end end + + timer.Simple(0, function() if attacker != nil then attacker:FireBullets(penetratedbullet) end end) + + return true +end + + +function SWEP:SecondaryAttack() + return false +end + +function SWEP:Reload() + if not IsValid(self) then return end if not IsValid(self.Owner) then return end + + if self.Owner:IsNPC() then + self.Weapon:DefaultReload(ACT_VM_RELOAD) + return end + + if self.Owner:KeyDown(IN_USE) then return end + + if self.Silenced then + self.Weapon:DefaultReload(ACT_VM_RELOAD_SILENCED) + else + self.Weapon:DefaultReload(ACT_VM_RELOAD) + end + + if !self.Owner:IsNPC() then + if self.Owner:GetViewModel() == nil then self.ResetSights = CurTime() + 3 else + self.ResetSights = CurTime() + self.Owner:GetViewModel():SequenceDuration() + end + end + + if SERVER and self.Weapon != nil then + if ( self.Weapon:Clip1() < self.Primary.ClipSize ) and !self.Owner:IsNPC() then + -- //When the current clip < full clip and the rest of your ammo > 0, then + -- //Zoom = 0 + -- //Set the ironsight to false + self.Weapon:SetNWBool("Reloading", true) + end + local waitdammit = (self.Owner:GetViewModel():SequenceDuration()) + timer.Simple(waitdammit + .1, + function() + if self.Weapon == nil then return end + self.Weapon:SetNWBool("Reloading", false) + if self.Owner:KeyDown(IN_ATTACK2) and self.Weapon:GetClass() == self.Gun then + if CLIENT then return end + if self.Scoped == false then + self.DrawCrosshair = false + else return end + else return end + end) + end +end + +function SWEP:PostReloadScopeCheck() + if self.Weapon == nil then return end + self.Weapon:SetNWBool("Reloading", false) + if self.Owner:KeyDown(IN_ATTACK2) and self.Weapon:GetClass() == self.Gun then + if CLIENT then return end + if self.Scoped == false then + self.DrawCrosshair = false + else return end + else return end +end + +function SWEP:Silencer() + + if self.NextSilence > CurTime() then return end + + if self.Weapon != nil then + self.Weapon:SetNWBool("Reloading", true) -- i know we're not reloading but it works + end + + if self.Silenced then + self:SendWeaponAnim(ACT_VM_DETACH_SILENCER) + self.Silenced = false + elseif not self.Silenced then + self:SendWeaponAnim(ACT_VM_ATTACH_SILENCER) + self.Silenced = true + end + + siltimer = CurTime() + (self.Owner:GetViewModel():SequenceDuration()) + 0.1 + if self.Weapon:GetNextPrimaryFire() <= siltimer then + self.Weapon:SetNextPrimaryFire(siltimer) + end + self.NextSilence = siltimer + + timer.Simple( ((self.Owner:GetViewModel():SequenceDuration()) + 0.1), + function() + if self.Weapon != nil then + self.Weapon:SetNWBool("Reloading", false) + if self.Owner:KeyDown(IN_ATTACK2) and self.Weapon:GetClass() == self.Gun then + if CLIENT then return end + if self.Scoped == false then + self.DrawCrosshair = false + else return end + else return end + end + end) + +end + +function SWEP:SelectFireMode() + + if self.Primary.Automatic then + self.Primary.Automatic = false + self.NextFireSelect = CurTime() + .5 + if CLIENT then + self.Owner:PrintMessage(HUD_PRINTTALK, "Semi-automatic selected.") + end + self.Weapon:EmitSound("Weapon_AR2.Empty") + else + self.Primary.Automatic = true + self.NextFireSelect = CurTime() + .5 + if CLIENT then + self.Owner:PrintMessage(HUD_PRINTTALK, "Automatic selected.") + end + self.Weapon:EmitSound("Weapon_AR2.Empty") + end +end + + +/*--------------------------------------------------------- +IronSight +-----------------------------------------------------*/ +function SWEP:IronSight() + + if not IsValid(self) then return end + if not IsValid(self.Owner) then return end + + if !self.Owner:IsNPC() then + if self.ResetSights and CurTime() >= self.ResetSights then + self.ResetSights = nil + + if self.Silenced then + self:SendWeaponAnim(ACT_VM_IDLE_SILENCED) + else + self:SendWeaponAnim(ACT_VM_IDLE) + end + end end + + if self.CanBeSilenced and self.NextSilence < CurTime() then + if self.Owner:KeyDown(IN_USE) and self.Owner:KeyPressed(IN_ATTACK2) then + self:Silencer() + end + end + + if self.SelectiveFire and self.NextFireSelect < CurTime() and not (self.Weapon:GetNWBool("Reloading")) then + if self.Owner:KeyDown(IN_USE) and self.Owner:KeyPressed(IN_RELOAD) then + self:SelectFireMode() + end + end + +-- //copy this... + if self.Owner:KeyPressed(IN_SPEED) and not (self.Weapon:GetNWBool("Reloading")) then -- If you are running + if self.Weapon:GetNextPrimaryFire() <= (CurTime()+0.3) then --r second + end + self.DrawCrosshair = false + end + + if self.Owner:KeyReleased (IN_SPEED) then -- If you release run then + self.DrawCrosshair = self.OrigCrossHair + end -- Shoulder the gun + +-- //down to this + if !self.Owner:KeyDown(IN_USE) and !self.Owner:KeyDown(IN_SPEED) then + -- //If the key E (Use Key) is not pressed, then + + if self.Owner:KeyPressed(IN_ATTACK2) and not (self.Weapon:GetNWBool("Reloading")) then + self.DrawCrosshair = false + -- //Set the ironsight true + + if CLIENT then return end + end + end + + if self.Owner:KeyReleased(IN_ATTACK2) and !self.Owner:KeyDown(IN_USE) and !self.Owner:KeyDown(IN_SPEED) then + -- //If the right click is released, then + self.DrawCrosshair = self.OrigCrossHair + -- //Set the ironsight false + + if CLIENT then return end + end + + +end + +/*--------------------------------------------------------- +Think +-----------------------------------------------------*/ +function SWEP:Think() + +self:IronSight() + +end + +/*--------------------------------------------------------- +GetViewModelPosition +-----------------------------------------------------*/ +local IRONSIGHT_TIME = 0.3 +-- //Time to enter in the ironsight mod + +function SWEP:GetViewModelPosition(pos, ang) + + if (not self.IronSightsPos) then return pos, ang end + + local bIron = self.Weapon:GetNWBool("M9K_Ironsights") + + if (bIron != self.bLastIron) then + self.bLastIron = bIron + self.fIronTime = CurTime() + + end + + local fIronTime = self.fIronTime or 0 + + if (not bIron and fIronTime < CurTime() - IRONSIGHT_TIME) then + return pos, ang + end + + local Mul = 1.0 + + if (fIronTime > CurTime() - IRONSIGHT_TIME) then + Mul = math.Clamp((CurTime() - fIronTime) / IRONSIGHT_TIME, 0, 1) + + if not bIron then Mul = 1 - Mul end + end + + local Offset = self.IronSightsPos + + if (self.IronSightsAng) then + ang = ang * 1 + ang:RotateAroundAxis(ang:Right(), self.IronSightsAng.x * Mul) + ang:RotateAroundAxis(ang:Up(), self.IronSightsAng.y * Mul) + ang:RotateAroundAxis(ang:Forward(), self.IronSightsAng.z * Mul) + end + + local Right = ang:Right() + local Up = ang:Up() + local Forward = ang:Forward() + + pos = pos + Offset.x * Right * Mul + pos = pos + Offset.y * Forward * Mul + pos = pos + Offset.z * Up * Mul + + return pos, ang +end + +/*--------------------------------------------------------- +SetIronsights +-----------------------------------------------------*/ +function SWEP:SetIronsights(b) + self.Weapon:SetNWBool("M9K_Ironsights", b) +end + +function SWEP:GetIronsights() + return self.Weapon:GetNWBool("M9K_Ironsights") +end + + +if CLIENT then + + SWEP.vRenderOrder = nil + function SWEP:ViewModelDrawn() + + if not IsValid(self) then return end + if not IsValid(self.Owner) then return end + local vm = self.Owner:GetViewModel() + if !IsValid(vm) then return end + + if (!self.VElements) then return end + + self:UpdateBonePositions(vm) + + if (!self.vRenderOrder) then + + -- // we build a render order because sprites need to be drawn after models + self.vRenderOrder = {} + + for k, v in pairs( self.VElements ) do + if (v.type == "Model") then + table.insert(self.vRenderOrder, 1, k) + elseif (v.type == "Sprite" or v.type == "Quad") then + table.insert(self.vRenderOrder, k) + end + end + + end + + for k, name in ipairs( self.vRenderOrder ) do + + local v = self.VElements[name] + if (!v) then self.vRenderOrder = nil break end + if (v.hide) then continue end + + local model = v.modelEnt + local sprite = v.spriteMaterial + + if (!v.bone) then continue end + + local pos, ang = self:GetBoneOrientation( self.VElements, v, vm ) + + if (!pos) then continue end + + if (v.type == "Model" and IsValid(model)) then + + model:SetPos(pos + ang:Forward() * v.pos.x + ang:Right() * v.pos.y + ang:Up() * v.pos.z ) + ang:RotateAroundAxis(ang:Up(), v.angle.y) + ang:RotateAroundAxis(ang:Right(), v.angle.p) + ang:RotateAroundAxis(ang:Forward(), v.angle.r) + + model:SetAngles(ang) + -- //model:SetModelScale(v.size) + local matrix = Matrix() + matrix:Scale(v.size) + model:EnableMatrix( "RenderMultiply", matrix ) + + if (v.material == "") then + model:SetMaterial("") + elseif (model:GetMaterial() != v.material) then + model:SetMaterial( v.material ) + end + + if (v.skin and v.skin != model:GetSkin()) then + model:SetSkin(v.skin) + end + + if (v.bodygroup) then + for k, v in pairs( v.bodygroup ) do + if (model:GetBodygroup(k) != v) then + model:SetBodygroup(k, v) + end + end + end + + if (v.surpresslightning) then + render.SuppressEngineLighting(true) + end + + render.SetColorModulation(v.color.r/255, v.color.g/255, v.color.b/255) + render.SetBlend(v.color.a/255) + model:DrawModel() + render.SetBlend(1) + render.SetColorModulation(1, 1, 1) + + if (v.surpresslightning) then + render.SuppressEngineLighting(false) + end + + elseif (v.type == "Sprite" and sprite) then + + local drawpos = pos + ang:Forward() * v.pos.x + ang:Right() * v.pos.y + ang:Up() * v.pos.z + render.SetMaterial(sprite) + render.DrawSprite(drawpos, v.size.x, v.size.y, v.color) + + elseif (v.type == "Quad" and v.draw_func) then + + local drawpos = pos + ang:Forward() * v.pos.x + ang:Right() * v.pos.y + ang:Up() * v.pos.z + ang:RotateAroundAxis(ang:Up(), v.angle.y) + ang:RotateAroundAxis(ang:Right(), v.angle.p) + ang:RotateAroundAxis(ang:Forward(), v.angle.r) + + cam.Start3D2D(drawpos, ang, v.size) + v.draw_func( self ) + cam.End3D2D() + + end + + end + + end + + SWEP.wRenderOrder = nil + function SWEP:DrawWorldModel() + + if (self.ShowWorldModel == nil or self.ShowWorldModel) then + self:DrawModel() + end + + if (!self.WElements) then return end + + if (!self.wRenderOrder) then + + self.wRenderOrder = {} + + for k, v in pairs( self.WElements ) do + if (v.type == "Model") then + table.insert(self.wRenderOrder, 1, k) + elseif (v.type == "Sprite" or v.type == "Quad") then + table.insert(self.wRenderOrder, k) + end + end + + end + + if (IsValid(self.Owner)) then + bone_ent = self.Owner + else + -- // when the weapon is dropped + bone_ent = self + end + + for k, name in pairs( self.wRenderOrder ) do + + local v = self.WElements[name] + if (!v) then self.wRenderOrder = nil break end + if (v.hide) then continue end + + local pos, ang + + if (v.bone) then + pos, ang = self:GetBoneOrientation( self.WElements, v, bone_ent ) + else + pos, ang = self:GetBoneOrientation( self.WElements, v, bone_ent, "ValveBiped.Bip01_R_Hand" ) + end + + if (!pos) then continue end + + local model = v.modelEnt + local sprite = v.spriteMaterial + + if (v.type == "Model" and IsValid(model)) then + + model:SetPos(pos + ang:Forward() * v.pos.x + ang:Right() * v.pos.y + ang:Up() * v.pos.z ) + ang:RotateAroundAxis(ang:Up(), v.angle.y) + ang:RotateAroundAxis(ang:Right(), v.angle.p) + ang:RotateAroundAxis(ang:Forward(), v.angle.r) + + model:SetAngles(ang) + -- //model:SetModelScale(v.size) + local matrix = Matrix() + matrix:Scale(v.size) + model:EnableMatrix( "RenderMultiply", matrix ) + + if (v.material == "") then + model:SetMaterial("") + elseif (model:GetMaterial() != v.material) then + model:SetMaterial( v.material ) + end + + if (v.skin and v.skin != model:GetSkin()) then + model:SetSkin(v.skin) + end + + if (v.bodygroup) then + for k, v in pairs( v.bodygroup ) do + if (model:GetBodygroup(k) != v) then + model:SetBodygroup(k, v) + end + end + end + + if (v.surpresslightning) then + render.SuppressEngineLighting(true) + end + + render.SetColorModulation(v.color.r/255, v.color.g/255, v.color.b/255) + render.SetBlend(v.color.a/255) + model:DrawModel() + render.SetBlend(1) + render.SetColorModulation(1, 1, 1) + + if (v.surpresslightning) then + render.SuppressEngineLighting(false) + end + + elseif (v.type == "Sprite" and sprite) then + + local drawpos = pos + ang:Forward() * v.pos.x + ang:Right() * v.pos.y + ang:Up() * v.pos.z + render.SetMaterial(sprite) + render.DrawSprite(drawpos, v.size.x, v.size.y, v.color) + + elseif (v.type == "Quad" and v.draw_func) then + + local drawpos = pos + ang:Forward() * v.pos.x + ang:Right() * v.pos.y + ang:Up() * v.pos.z + ang:RotateAroundAxis(ang:Up(), v.angle.y) + ang:RotateAroundAxis(ang:Right(), v.angle.p) + ang:RotateAroundAxis(ang:Forward(), v.angle.r) + + cam.Start3D2D(drawpos, ang, v.size) + v.draw_func( self ) + cam.End3D2D() + + end + + end + + end + + function SWEP:GetBoneOrientation( basetab, tab, ent, bone_override ) + + local bone, pos, ang + if (tab.rel and tab.rel != "") then + + local v = basetab[tab.rel] + + if (!v) then return end + + -- // Technically, if there exists an element with the same name as a bone + -- // you can get in an infinite loop. Let's just hope nobody's that stupid. + pos, ang = self:GetBoneOrientation( basetab, v, ent ) + + if (!pos) then return end + + pos = pos + ang:Forward() * v.pos.x + ang:Right() * v.pos.y + ang:Up() * v.pos.z + ang:RotateAroundAxis(ang:Up(), v.angle.y) + ang:RotateAroundAxis(ang:Right(), v.angle.p) + ang:RotateAroundAxis(ang:Forward(), v.angle.r) + + else + + bone = ent:LookupBone(bone_override or tab.bone) + + if (!bone) then return end + + pos, ang = Vector(0,0,0), Angle(0,0,0) + local m = ent:GetBoneMatrix(bone) + if (m) then + pos, ang = m:GetTranslation(), m:GetAngles() + end + + if (IsValid(self.Owner) and self.Owner:IsPlayer() and + ent == self.Owner:GetViewModel() and self.ViewModelFlip) then + ang.r = -ang.r --// Fixes mirrored models + end + + end + + return pos, ang + end + + function SWEP:CreateModels( tab ) + + if (!tab) then return end + + -- // Create the clientside models here because Garry says we can't do it in the render hook + for k, v in pairs( tab ) do + if (v.type == "Model" and v.model and v.model != "" and (!IsValid(v.modelEnt) or v.createdModel != v.model) and + string.find(v.model, ".mdl") and file.Exists (v.model, "GAME") ) then + + v.modelEnt = ClientsideModel(v.model, RENDER_GROUP_VIEW_MODEL_OPAQUE) + if (IsValid(v.modelEnt)) then + v.modelEnt:SetPos(self:GetPos()) + v.modelEnt:SetAngles(self:GetAngles()) + v.modelEnt:SetParent(self) + v.modelEnt:SetNoDraw(true) + v.createdModel = v.model + else + v.modelEnt = nil + end + + elseif (v.type == "Sprite" and v.sprite and v.sprite != "" and (!v.spriteMaterial or v.createdSprite != v.sprite) + and file.Exists ("materials/"..v.sprite..".vmt", "GAME")) then + + local name = v.sprite.."-" + local params = { ["$basetexture"] = v.sprite } + -- // make sure we create a unique name based on the selected options + local tocheck = { "nocull", "additive", "vertexalpha", "vertexcolor", "ignorez" } + for i, j in pairs( tocheck ) do + if (v[j]) then + params["$"..j] = 1 + name = name.."1" + else + name = name.."0" + end + end + + v.createdSprite = v.sprite + v.spriteMaterial = CreateMaterial(name,"UnlitGeneric",params) + + end + end + + end + + local allbones + local hasGarryFixedBoneScalingYet = false + + function SWEP:UpdateBonePositions(vm) + + if self.ViewModelBoneMods then + + if (!vm:GetBoneCount()) then return end + + -- // !! WORKAROUND !! --// + -- // We need to check all model names :/ + local loopthrough = self.ViewModelBoneMods + if (!hasGarryFixedBoneScalingYet) then + allbones = {} + for i=0, vm:GetBoneCount() do + local bonename = vm:GetBoneName(i) + if (self.ViewModelBoneMods[bonename]) then + allbones[bonename] = self.ViewModelBoneMods[bonename] + else + allbones[bonename] = { + scale = Vector(1,1,1), + pos = Vector(0,0,0), + angle = Angle(0,0,0) + } + end + end + + loopthrough = allbones + end + //!! ----------- !! -- + + for k, v in pairs( loopthrough ) do + local bone = vm:LookupBone(k) + if (!bone) then continue end + + -- // !! WORKAROUND !! --// + local s = Vector(v.scale.x,v.scale.y,v.scale.z) + local p = Vector(v.pos.x,v.pos.y,v.pos.z) + local ms = Vector(1,1,1) + if (!hasGarryFixedBoneScalingYet) then + local cur = vm:GetBoneParent(bone) + while(cur >= 0) do + local pscale = loopthrough[vm:GetBoneName(cur)].scale + ms = ms * pscale + cur = vm:GetBoneParent(cur) + end + end + + s = s * ms + //!! ----------- !! -- + + if vm:GetManipulateBoneScale(bone) != s then + vm:ManipulateBoneScale( bone, s ) + end + if vm:GetManipulateBoneAngles(bone) != v.angle then + vm:ManipulateBoneAngles( bone, v.angle ) + end + if vm:GetManipulateBonePosition(bone) != p then + vm:ManipulateBonePosition( bone, p ) + end + end + else + self:ResetBonePositions(vm) + end + + end + + function SWEP:ResetBonePositions(vm) + + if (!vm:GetBoneCount()) then return end + for i=0, vm:GetBoneCount() do + vm:ManipulateBoneScale( i, Vector(1, 1, 1) ) + vm:ManipulateBoneAngles( i, Angle(0, 0, 0) ) + vm:ManipulateBonePosition( i, Vector(0, 0, 0) ) + end + + end + + /************************** + Global utility code + **************************/ + + -- // Fully copies the table, meaning all tables inside this table are copied too and so on (normal table.Copy copies only their reference). + -- // Does not copy entities of course, only copies their reference. + -- // WARNING: do not use on tables that contain themselves somewhere down the line or you'll get an infinite loop + function table.FullCopy( tab ) + + if (!tab) then return nil end + + local res = {} + for k, v in pairs( tab ) do + if (type(v) == "table") then + res[k] = table.FullCopy(v) --// recursion ho! + elseif (type(v) == "Vector") then + res[k] = Vector(v.x, v.y, v.z) + elseif (type(v) == "Angle") then + res[k] = Angle(v.p, v.y, v.r) + else + res[k] = v + end + end + + return res + + end + +end \ No newline at end of file diff --git a/m9k_heavy_weapons_fatal_edition/lua/weapons/bobs_scoped_base/shared.lua b/m9k_heavy_weapons_fatal_edition/lua/weapons/bobs_scoped_base/shared.lua index 00bf9ea..91b4412 100644 --- a/m9k_heavy_weapons_fatal_edition/lua/weapons/bobs_scoped_base/shared.lua +++ b/m9k_heavy_weapons_fatal_edition/lua/weapons/bobs_scoped_base/shared.lua @@ -58,10 +58,11 @@ SWEP.data = {} -- The starting firemode SWEP.data.ironsights = 1 SWEP.ScopeScale = 0.5 SWEP.ReticleScale = 0.5 -SWEP.IronSightsPos = Vector (2.4537, 1.0923, 0.2696) -SWEP.IronSightsAng = Vector (0.0186, -0.0547, 0) +SWEP.IronSightsPos = Vector (0,0,0) +SWEP.IronSightsAng = Vector (0,0,0) function SWEP:Initialize() + self:SetIronsights(false, self.Owner) self.Weapon:SetNWBool("Reloading", false) util.PrecacheSound(self.Primary.Sound) if CLIENT then @@ -191,8 +192,6 @@ function SWEP:BoltBack() self.Weapon:SetNWBool("Reloading", false) if self.Owner:KeyDown(IN_ATTACK2) and self.Weapon:GetClass() == self.Gun then self.Owner:SetFOV( 75/self.Secondary.ScopeZoom, 0.15 ) - self.IronSightsPos = self.SightsPos -- Bring it up - self.IronSightsAng = self.SightsAng -- Bring it up self.DrawCrosshair = false self:SetIronsights(true, self.Owner) self.Owner:DrawViewModel(false) @@ -205,8 +204,6 @@ function SWEP:BoltBack() end function SWEP:Reload() - - if self.Owner:KeyDown(IN_USE) then return end self.Weapon:DefaultReload(ACT_VM_RELOAD) if !self.Owner:IsNPC() then @@ -237,17 +234,9 @@ function SWEP:Reload() if self.Owner:KeyDown(IN_ATTACK2) and self.Weapon:GetClass() == self.Gun then if CLIENT then return end self.Owner:SetFOV( 75/self.Secondary.ScopeZoom, 0.15 ) - self.IronSightsPos = self.SightsPos -- Bring it up - self.IronSightsAng = self.SightsAng -- Bring it up self.DrawCrosshair = false self:SetIronsights(true, self.Owner) self.Owner:DrawViewModel(false) - elseif self.Owner:KeyDown(IN_SPEED) and self.Weapon:GetClass() == self.Gun then - if self.Weapon:GetNextPrimaryFire() <= (CurTime()+0.3) then - self.Weapon:SetNextPrimaryFire(CurTime()+0.3) -- Make it so you can't shoot for another quarter second - end - self.IronSightsPos = self.RunSightsPos -- Hold it down - self.IronSightsAng = self.RunSightsAng -- Hold it down self:SetIronsights(true, self.Owner) -- Set the ironsight true self.Owner:SetFOV( 0, 0.2 ) else return end @@ -260,17 +249,9 @@ function SWEP:PostReloadScopeCheck() if self.Owner:KeyDown(IN_ATTACK2) and self.Weapon:GetClass() == self.Gun then if CLIENT then return end self.Owner:SetFOV( 75/self.Secondary.ScopeZoom, 0.15 ) - self.IronSightsPos = self.SightsPos -- Bring it up - self.IronSightsAng = self.SightsAng -- Bring it up self.DrawCrosshair = false self:SetIronsights(true, self.Owner) self.Owner:DrawViewModel(false) - elseif self.Owner:KeyDown(IN_SPEED) and self.Weapon:GetClass() == self.Gun then - if self.Weapon:GetNextPrimaryFire() <= (CurTime()+0.3) then - self.Weapon:SetNextPrimaryFire(CurTime()+0.3) -- Make it so you can't shoot for another quarter second - end - self.IronSightsPos = self.RunSightsPos -- Hold it down - self.IronSightsAng = self.RunSightsAng -- Hold it down self:SetIronsights(true, self.Owner) -- Set the ironsight true self.Owner:SetFOV( 0, 0.2 ) else return end @@ -291,57 +272,16 @@ function SWEP:IronSight() self:SelectFireMode() end end - - if self.Owner:KeyDown(IN_USE) and self.Owner:KeyPressed(IN_ATTACK2) then return end - - if self.Owner:KeyPressed(IN_SPEED) and not (self.Weapon:GetNWBool("Reloading")) then -- If you hold E and you can shoot then - if self.Weapon:GetNextPrimaryFire() <= (CurTime()+0.3) then - self.Weapon:SetNextPrimaryFire(CurTime()+0.3) -- Make it so you can't shoot for another quarter second - end - self.IronSightsPos = self.RunSightsPos -- Hold it down - self.IronSightsAng = self.RunSightsAng -- Hold it down - self:SetIronsights(true, self.Owner) -- Set the ironsight true - self.Owner:SetFOV( 0, 0.2 ) - end - - if self.Owner:KeyDown(IN_SPEED) and not (self.Weapon:GetNWBool("Reloading")) then -- If you hold E or run then - if self.Weapon:GetNextPrimaryFire() <= (CurTime()+0.3) then - self.Weapon:SetNextPrimaryFire(CurTime()+0.3) -- Make it so you can't shoot for another quarter second - end -- Lower the gun - end - - if self.Owner:KeyReleased(IN_USE) || self.Owner:KeyReleased (IN_SPEED) then -- If you release E then - self:SetIronsights(false, self.Owner) -- Set the ironsight true - self.DrawCrosshair = self.XHair - end - - if self.Owner:KeyPressed(IN_SPEED) || self.Owner:KeyPressed(IN_USE) then -- If you run then - self.Owner:SetFOV( 0, 0.2 ) - self.DrawCrosshair = false - if CLIENT then return end - self.Owner:DrawViewModel(true) - end - - if self.Owner:KeyPressed(IN_ATTACK2) and !self.Owner:KeyDown(IN_SPEED) and not (self.Weapon:GetNWBool("Reloading")) then - self.Owner:SetFOV( 75/self.Secondary.ScopeZoom, 0.15 ) - self.IronSightsPos = self.SightsPos -- Bring it up - self.IronSightsAng = self.SightsAng -- Bring it up + if self.Owner:KeyPressed(IN_ATTACK2) and not (self.Weapon:GetNWBool("Reloading")) then + self.Owner:SetFOV( 75/self.Secondary.ScopeZoom, 0.15 ) self.DrawCrosshair = false self:SetIronsights(true, self.Owner) if CLIENT then return end self.Owner:DrawViewModel(false) - elseif self.Owner:KeyPressed(IN_ATTACK2) and not (self.Weapon:GetNWBool("Reloading")) and self.Owner:KeyDown(IN_SPEED) then - if self.Weapon:GetNextPrimaryFire() <= (CurTime()+0.3) then - self.Weapon:SetNextPrimaryFire(CurTime()+0.3) -- Make it so you can't shoot for another quarter second - end - self.IronSightsPos = self.RunSightsPos -- Hold it down - self.IronSightsAng = self.RunSightsAng -- Hold it down - self:SetIronsights(true, self.Owner) -- Set the ironsight true - self.Owner:SetFOV( 0, 0.2 ) end - if (self.Owner:KeyReleased(IN_ATTACK2) || self.Owner:KeyDown(IN_SPEED)) and !self.Owner:KeyDown(IN_USE) and !self.Owner:KeyDown(IN_SPEED) then + if (self.Owner:KeyReleased(IN_ATTACK2)) then self.Owner:SetFOV( 0, 0.2 ) self:SetIronsights(false, self.Owner) self.DrawCrosshair = self.XHair @@ -349,20 +289,12 @@ function SWEP:IronSight() if CLIENT then return end self.Owner:DrawViewModel(true) end - - if self.Owner:KeyDown(IN_ATTACK2) and !self.Owner:KeyDown(IN_USE) and !self.Owner:KeyDown(IN_SPEED) then - self.SwayScale = 0.05 - self.BobScale = 0.05 - else - self.SwayScale = 1.0 - self.BobScale = 1.0 - end end function SWEP:DrawHUD() - if self.Owner:KeyDown(IN_ATTACK2) and (self:GetIronsights() == true) and (!self.Owner:KeyDown(IN_SPEED) and !self.Owner:KeyDown(IN_USE)) then + if self.Owner:KeyDown(IN_ATTACK2) and (self:GetIronsights() == true) then if self.Secondary.UseACOG then -- Draw the FAKE SCOPE THANG @@ -451,11 +383,11 @@ function SWEP:DrawHUD() end end + function SWEP:AdjustMouseSensitivity() - if self.Owner:KeyDown(IN_ATTACK2) then return (1/(self.Secondary.ScopeZoom/2)) else - return 1 - end + return 1 + end end \ No newline at end of file diff --git a/m9k_heavy_weapons_fatal_edition/lua/weapons/bobs_shotty_base/shared.lua b/m9k_heavy_weapons_fatal_edition/lua/weapons/bobs_shotty_base/shared.lua index c8b9531..2f1ce7f 100644 --- a/m9k_heavy_weapons_fatal_edition/lua/weapons/bobs_shotty_base/shared.lua +++ b/m9k_heavy_weapons_fatal_edition/lua/weapons/bobs_shotty_base/shared.lua @@ -23,7 +23,7 @@ SWEP.Primary.DefaultClip = 0 // Default number of bullets in a clip SWEP.Primary.KickUp = 0 // Maximum up recoil (rise) SWEP.Primary.KickDown = 0 // Maximum down recoil (skeet) SWEP.Primary.KickHorizontal = 0 // Maximum side recoil (koolaid) -SWEP.Primary.Automatic = true // Automatic/Semi Auto +SWEP.Primary.Automatic = false // Automatic/Semi Auto SWEP.Primary.Ammo = "none" // What kind of ammo SWEP.Primary.Reloading = false // Reloading func @@ -95,7 +95,7 @@ function SWEP:Deploy() self.Weapon:SendWeaponAnim(ACT_VM_DRAW) - self.Weapon:SetNextPrimaryFire(CurTime() + .25) + self.Weapon:SetNextPrimaryFire(CurTime() + .13) self.Weapon:SetNextSecondaryFire(CurTime() + .25) self.ActionDelay = (CurTime() + .25) @@ -103,7 +103,7 @@ function SWEP:Deploy() self:SetIronsights(false) end - self.Owner.NextReload = CurTime() + 1 + self.Owner.NextReload = CurTime() return true end @@ -127,7 +127,7 @@ function SWEP:Reload() if self.Owner:IsPlayer() then if self.Weapon:GetNextPrimaryFire() <= (CurTime()+2) then - self.Weapon:SetNextPrimaryFire(CurTime() + 2) -- wait TWO seconds before you can shoot again + self.Weapon:SetNextPrimaryFire(CurTime()) -- wait TWO seconds before you can shoot again end self.Weapon:SendWeaponAnim(ACT_SHOTGUN_RELOAD_START) -- sending start reload anim self.Owner:SetAnimation( PLAYER_RELOAD ) @@ -190,3 +190,39 @@ end function SWEP:ShellAnimCaller() self.Weapon:SendWeaponAnim(ACT_VM_RELOAD) end + +function SWEP:PrimaryAttack() + + -- Make sure we can shoot first + if ( !self:CanPrimaryAttack() ) then return end + + -- Play shoot sound + self:EmitSound(self.Primary.Sound) + + self:ShootBullet(0,0,0) + self:ShootBullet(0,0,0) + self:ShootBullet(0.015,0,0) + self:ShootBullet(-0.015,0,0) + self:ShootBullet(0,0.015,0) + self:ShootBullet(0,-0.015,0) + self:ShootBullet(0.015,0.015,0) + self:ShootBullet(-0.015,0.015,0) + self:ShootBullet(-0.015,-0.015,0) + self:ShootBullet(0.015,-0.015,0) + + -- Remove 1 bullet from our clip + self:TakePrimaryAmmo( 1 ) + + + + if CLIENT and !game.SinglePlayer() and !self.Owner:IsNPC() then + + local anglo = Angle(-self.Primary.Recoil) + local eyes = self.Owner:EyeAngles() + eyes.pitch = eyes.pitch + (anglo.pitch/3) + eyes.yaw = eyes.yaw + (anglo.yaw/3) + self.Owner:SetEyeAngles(eyes) + end + + self.Weapon:SetNextPrimaryFire(CurTime()+1/(self.Primary.RPM/60)) +end \ No newline at end of file diff --git a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_1887winchester/shared.lua b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_1887winchester/shared.lua index 4efb832..56e750b 100644 --- a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_1887winchester/shared.lua +++ b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_1887winchester/shared.lua @@ -1,89 +1,109 @@ --- Variables that are used on both client and server -SWEP.Gun = ("m9k_1887winchester") -- must be the name of your swep but NO CAPITALS! -if (GetConVar(SWEP.Gun.."_allowed")) != nil then - if not (GetConVar(SWEP.Gun.."_allowed"):GetBool()) then SWEP.Base = "bobs_blacklisted" SWEP.PrintName = SWEP.Gun return end -end -SWEP.Category = "M9K Shotguns" -SWEP.Author = "" -SWEP.Contact = "" -SWEP.Purpose = "" -SWEP.Instructions = "" -SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models -SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models -SWEP.PrintName = "Winchester 87" -- Weapon name (Shown on HUD) -SWEP.Slot = 3 -- Slot in the weapon selection menu -SWEP.SlotPos = 30 -- Position in the slot -SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter -SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box -SWEP.BounceWeaponIcon = false -- Should the weapon icon bounce? -SWEP.DrawCrosshair = true -- set false if you want no crosshair -SWEP.Weight = 3 -- rank relative ot other weapons. bigger is better -SWEP.AutoSwitchTo = true -- Auto switch to if we pick it up -SWEP.AutoSwitchFrom = true -- Auto switch from if you pick up a better weapon -SWEP.HoldType = "shotgun" -- how others view you carrying the weapon --- normal melee melee2 fist knife smg ar2 pistol rpg physgun grenade shotgun crossbow slam passive --- you're mostly going to use ar2, smg, shotgun or pistol. rpg and crossbow make for good sniper rifles - -SWEP.ViewModelFOV = 70 -SWEP.ViewModelFlip = true -SWEP.ViewModel = "models/weapons/v_1887winchester.mdl" -- Weapon view model -SWEP.WorldModel = "models/weapons/w_winchester_1887.mdl" -- Weapon world model -SWEP.Base = "bobs_shotty_base" -SWEP.Spawnable = true -SWEP.AdminSpawnable = true - -SWEP.Primary.Sound = Sound("1887winch.Single") -- script that calls the primary fire sound -SWEP.Primary.RPM = 70 -- This is in Rounds Per Minute -SWEP.Primary.ClipSize = 4 -- Size of a clip -SWEP.Primary.DefaultClip = 12 -- Default number of bullets in a clip -SWEP.Primary.KickUp = 1 -- Maximum up recoil (rise) -SWEP.Primary.KickDown = 0.8 -- Maximum down recoil (skeet) -SWEP.Primary.KickHorizontal = 0.6 -- Maximum up recoil (stock) -SWEP.Primary.Automatic = false -- Automatic/Semi Auto -SWEP.Primary.Ammo = "slam" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun --- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets - -SWEP.Secondary.IronFOV = 60 -- How much you 'zoom' in. Less is more! - -SWEP.ShellTime = .67 - -SWEP.data = {} --The starting firemode -SWEP.data.ironsights = 1 - -SWEP.Primary.NumShots = 10 -- How many bullets to shoot per trigger pull, AKA pellets -SWEP.Primary.Damage = 10 -- Base damage per bullet -SWEP.Primary.Spread = .042 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .042 -- Ironsight accuracy, should be the same for shotguns --- Because irons don't magically give you less pellet spread! - --- Enter iron sight info and bone mod info below -SWEP.IronSightsPos = Vector(4.84, 0, 1.2) -SWEP.IronSightsAng = Vector(0, 0, 2.295) -SWEP.SightsPos = Vector(4.84, 0, 1.2) -SWEP.SightsAng = Vector(0, 0, 2.295) -SWEP.RunSightsPos = Vector (-2.3095, -3.0514, 2.3965) -SWEP.RunSightsAng = Vector (-19.8471, -33.9181, 10) - -if ((gmod.GetGamemode().Name) == "Murderthon 9000") or ((gmod.GetGamemode().Name) == "Murderthon 9000 beta") then - SWEP.Primary.Ammo = "slam" - SWEP.Slot = 1 -- Slot in the weapon selection menu - SWEP.Weight = 3 -- rank relative ot other weapons. bigger is better -else - SWEP.Primary.Ammo = "buckshot" -end - - - -if GetConVar("M9KDefaultClip") == nil then - print("M9KDefaultClip is missing! You may have hit the lua limit!") -else - if GetConVar("M9KDefaultClip"):GetInt() != -1 then - SWEP.Primary.DefaultClip = SWEP.Primary.ClipSize * GetConVar("M9KDefaultClip"):GetInt() - end -end - -if GetConVar("M9KUniqueSlots") != nil then - if not (GetConVar("M9KUniqueSlots"):GetBool()) then - SWEP.SlotPos = 2 - end -end \ No newline at end of file +-- Variables that are used on both client and server +SWEP.Gun = ("m9k_1887winchester") -- must be the name of your swep but NO CAPITALS! +if (GetConVar(SWEP.Gun.."_allowed")) != nil then + if not (GetConVar(SWEP.Gun.."_allowed"):GetBool()) then SWEP.Base = "bobs_blacklisted" SWEP.PrintName = SWEP.Gun return end +end +SWEP.Category = "M9K Shotguns" +SWEP.Author = "" +SWEP.Contact = "" +SWEP.Purpose = "" +SWEP.Instructions = "" +SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models +SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models +SWEP.PrintName = "Winchester 87" -- Weapon name (Shown on HUD) +SWEP.Slot = 2 -- Slot in the weapon selection menu +SWEP.SlotPos = 30 -- Position in the slot +SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter +SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box +SWEP.BounceWeaponIcon = false -- Should the weapon icon bounce? +SWEP.DrawCrosshair = true -- set false if you want no crosshair +SWEP.Weight = 3 -- rank relative ot other weapons. bigger is better +SWEP.AutoSwitchTo = true -- Auto switch to if we pick it up +SWEP.AutoSwitchFrom = true -- Auto switch from if you pick up a better weapon +SWEP.HoldType = "shotgun" -- how others view you carrying the weapon +-- normal melee melee2 fist knife smg ar2 pistol rpg physgun grenade shotgun crossbow slam passive +-- you're mostly going to use ar2, smg, shotgun or pistol. rpg and crossbow make for good sniper rifles + +SWEP.ViewModelFOV = 70 +SWEP.ViewModelFlip = true +SWEP.ViewModel = "models/weapons/v_1887winchester.mdl" -- Weapon view model +SWEP.WorldModel = "models/weapons/w_winchester_1887.mdl" -- Weapon world model +SWEP.Base = "bobs_shotty_base" +SWEP.Spawnable = true +SWEP.AdminSpawnable = true + +SWEP.Primary.Sound = Sound("1887winch.Single") -- script that calls the primary fire sound +SWEP.Primary.RPM = 70 -- This is in Rounds Per Minute +SWEP.Primary.ClipSize = 4 -- Size of a clip +SWEP.Primary.DefaultClip = 12 -- Default number of bullets in a clip +SWEP.Primary.KickUp = 1 -- Maximum up recoil (rise) +SWEP.Primary.KickDown = 0.8 -- Maximum down recoil (skeet) +SWEP.Primary.KickHorizontal = 0.6 -- Maximum up recoil (stock) +SWEP.Primary.Automatic = false -- Automatic/Semi Auto +SWEP.Primary.Ammo = "slam" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun +-- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets + +SWEP.Secondary.IronFOV = 60 -- How much you 'zoom' in. Less is more! + +SWEP.ShellTime = .3 + +SWEP.data = {} --The starting firemode +SWEP.data.ironsights = 1 + +SWEP.Primary.NumShots = 60 -- How many bullets to shoot per trigger pull, AKA pellets +SWEP.Primary.Damage = 2 -- Base damage per bullet +SWEP.Primary.Spread = .06 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = .06 -- Ironsight accuracy, should be the same for shotguns +-- Because irons don't magically give you less pellet spread! + +-- Enter iron sight info and bone mod info below +SWEP.IronSightsPos = Vector(4.84, 0, 1.2) +SWEP.IronSightsAng = Vector(0, 0, 2.295) +SWEP.SightsPos = Vector(4.84, 0, 1.2) +SWEP.SightsAng = Vector(0, 0, 2.295) +SWEP.RunSightsPos = Vector (-2.3095, -3.0514, 2.3965) +SWEP.RunSightsAng = Vector (-19.8471, -33.9181, 10) + +if ((gmod.GetGamemode().Name) == "Murderthon 9000") or ((gmod.GetGamemode().Name) == "Murderthon 9000 beta") then + SWEP.Primary.Ammo = "slam" + SWEP.Slot = 1 -- Slot in the weapon selection menu + SWEP.Weight = 3 -- rank relative ot other weapons. bigger is better +else + SWEP.Primary.Ammo = "buckshot" +end + + + +if GetConVar("M9KDefaultClip") == nil then + print("M9KDefaultClip is missing! You may have hit the lua limit!") +else + if GetConVar("M9KDefaultClip"):GetInt() != -1 then + SWEP.Primary.DefaultClip = SWEP.Primary.ClipSize * GetConVar("M9KDefaultClip"):GetInt() + end +end + +if GetConVar("M9KUniqueSlots") != nil then + if not (GetConVar("M9KUniqueSlots"):GetBool()) then + SWEP.SlotPos = 2 + end +end +function SWEP:ShootBullet( DirX, DirY, DirZ ) + + local bullet = {} + bullet.Num = 1 + bullet.Src = self.Owner:GetShootPos() -- Source + bullet.Dir = self.Owner:GetAimVector() + (self.Owner:GetAimVector():Angle():Right()*DirX) + (self.Owner:GetAimVector():Angle():Up()*DirY) -- Dir of bullet + bullet.Spread = Vector(0,0,0) -- Aim Cone + bullet.Tracer = 1 -- Show a tracer on every x bullets + bullet.Force = 1 -- Amount of force to give to phys objects + bullet.Damage = 9 + bullet.AmmoType = self.Primary.Ammo + bullet.HullSize = 0 + + self.Owner:FireBullets( bullet ) + + self:ShootEffects() + +end +SWEP.Primary.KickUp = 0 +SWEP.Primary.Recoil = 0 \ No newline at end of file diff --git a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_1897winchester/shared.lua b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_1897winchester/shared.lua index cc6f964..604b10d 100644 --- a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_1897winchester/shared.lua +++ b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_1897winchester/shared.lua @@ -1,85 +1,105 @@ --- Variables that are used on both client and server -SWEP.Gun = ("m9k_1897winchester") -- must be the name of your swep but NO CAPITALS! -if (GetConVar(SWEP.Gun.."_allowed")) != nil then - if not (GetConVar(SWEP.Gun.."_allowed"):GetBool()) then SWEP.Base = "bobs_blacklisted" SWEP.PrintName = SWEP.Gun return end -end -SWEP.Category = "M9K Shotguns" -SWEP.Author = "" -SWEP.Contact = "" -SWEP.Purpose = "" -SWEP.Instructions = "" -SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models -SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models -SWEP.PrintName = "Winchester 1897" -- Weapon name (Shown on HUD) -SWEP.Slot = 3 -- Slot in the weapon selection menu -SWEP.SlotPos = 31 -- Position in the slot -SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter -SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box -SWEP.BounceWeaponIcon = false -- Should the weapon icon bounce? -SWEP.DrawCrosshair = true -- set false if you want no crosshair -SWEP.Weight = 3 -- rank relative ot other weapons. bigger is better -SWEP.AutoSwitchTo = true -- Auto switch to if we pick it up -SWEP.AutoSwitchFrom = true -- Auto switch from if you pick up a better weapon -SWEP.HoldType = "shotgun" -- how others view you carrying the weapon --- normal melee melee2 fist knife smg ar2 pistol rpg physgun grenade shotgun crossbow slam passive --- you're mostly going to use ar2, smg, shotgun or pistol. rpg and crossbow make for good sniper rifles - -SWEP.ViewModelFOV = 70 -SWEP.ViewModelFlip = true -SWEP.ViewModel = "models/weapons/v_1897trenchshot.mdl" -- Weapon view model -SWEP.WorldModel = "models/weapons/w_winchester_1897_trench.mdl" -- Weapon world model -SWEP.Base = "bobs_shotty_base" -SWEP.Spawnable = true -SWEP.AdminSpawnable = true - -SWEP.Primary.Sound = Sound("Trench_97.Single") -- script that calls the primary fire sound -SWEP.Primary.RPM = 70 -- This is in Rounds Per Minute -SWEP.Primary.ClipSize = 4 -- Size of a clip -SWEP.Primary.DefaultClip = 12 -- Default number of bullets in a clip -SWEP.Primary.KickUp = 0.9 -- Maximum up recoil (rise) -SWEP.Primary.KickDown = 0.6 -- Maximum down recoil (skeet) -SWEP.Primary.KickHorizontal = 0.4 -- Maximum up recoil (stock) -SWEP.Primary.Automatic = false -- Automatic/Semi Auto -SWEP.Primary.Ammo = "slam" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun --- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets - -SWEP.Secondary.IronFOV = 60 -- How much you 'zoom' in. Less is more! - -SWEP.data = {} --The starting firemode -SWEP.data.ironsights = 1 - -SWEP.ShellTime = .6 - -SWEP.Primary.NumShots = 11 //how many bullets to shoot, use with shotguns -SWEP.Primary.Damage = 10 //base damage, scaled by game -SWEP.Primary.Spread = .04 //define from-the-hip accuracy (1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .04 // has to be the same as primary.spread --- Because irons don't magically give you less pellet spread! - - -SWEP.IronSightsPos = Vector(2.809, 0, 1.48) -SWEP.IronSightsAng = Vector(0, 0, 0) -SWEP.SightsPos = Vector(2.809, 0, 1.48) -SWEP.SightsAng = Vector(0, 0, 0) -SWEP.RunSightsPos = Vector(-3.116, -3.935, 0.492) -SWEP.RunSightsAng = Vector(-19.894, -47.624, 10.902) - -if ((gmod.GetGamemode().Name) == "Murderthon 9000") or ((gmod.GetGamemode().Name) == "Murderthon 9000 beta") then - SWEP.Primary.Ammo = "slam" -else - SWEP.Primary.Ammo = "buckshot" -end - -if GetConVar("M9KDefaultClip") == nil then - print("M9KDefaultClip is missing! You may have hit the lua limit!") -else - if GetConVar("M9KDefaultClip"):GetInt() != -1 then - SWEP.Primary.DefaultClip = SWEP.Primary.ClipSize * GetConVar("M9KDefaultClip"):GetInt() - end -end - -if GetConVar("M9KUniqueSlots") != nil then - if not (GetConVar("M9KUniqueSlots"):GetBool()) then - SWEP.SlotPos = 2 - end -end \ No newline at end of file +-- Variables that are used on both client and server +SWEP.Gun = ("m9k_1897winchester") -- must be the name of your swep but NO CAPITALS! +if (GetConVar(SWEP.Gun.."_allowed")) != nil then + if not (GetConVar(SWEP.Gun.."_allowed"):GetBool()) then SWEP.Base = "bobs_blacklisted" SWEP.PrintName = SWEP.Gun return end +end +SWEP.Category = "M9K Shotguns" +SWEP.Author = "" +SWEP.Contact = "" +SWEP.Purpose = "" +SWEP.Instructions = "" +SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models +SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models +SWEP.PrintName = "Winchester 1897" -- Weapon name (Shown on HUD) +SWEP.Slot = 2 -- Slot in the weapon selection menu +SWEP.SlotPos = 31 -- Position in the slot +SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter +SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box +SWEP.BounceWeaponIcon = false -- Should the weapon icon bounce? +SWEP.DrawCrosshair = true -- set false if you want no crosshair +SWEP.Weight = 3 -- rank relative ot other weapons. bigger is better +SWEP.AutoSwitchTo = true -- Auto switch to if we pick it up +SWEP.AutoSwitchFrom = true -- Auto switch from if you pick up a better weapon +SWEP.HoldType = "shotgun" -- how others view you carrying the weapon +-- normal melee melee2 fist knife smg ar2 pistol rpg physgun grenade shotgun crossbow slam passive +-- you're mostly going to use ar2, smg, shotgun or pistol. rpg and crossbow make for good sniper rifles + +SWEP.ViewModelFOV = 70 +SWEP.ViewModelFlip = true +SWEP.ViewModel = "models/weapons/v_1897trenchshot.mdl" -- Weapon view model +SWEP.WorldModel = "models/weapons/w_winchester_1897_trench.mdl" -- Weapon world model +SWEP.Base = "bobs_shotty_base" +SWEP.Spawnable = true +SWEP.AdminSpawnable = true + +SWEP.Primary.Sound = Sound("Trench_97.Single") -- script that calls the primary fire sound +SWEP.Primary.RPM = 50 -- This is in Rounds Per Minute +SWEP.Primary.ClipSize = 4 -- Size of a clip +SWEP.Primary.DefaultClip = 12 -- Default number of bullets in a clip +SWEP.Primary.KickUp = 0.9 -- Maximum up recoil (rise) +SWEP.Primary.KickDown = 0.6 -- Maximum down recoil (skeet) +SWEP.Primary.KickHorizontal = 0.4 -- Maximum up recoil (stock) +SWEP.Primary.Automatic = false -- Automatic/Semi Auto +SWEP.Primary.Ammo = "slam" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun +-- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets + +SWEP.Secondary.IronFOV = 60 -- How much you 'zoom' in. Less is more! + +SWEP.data = {} --The starting firemode +SWEP.data.ironsights = 1 + +SWEP.ShellTime = .3 + +SWEP.Primary.NumShots = 60 //how many bullets to shoot, use with shotguns +SWEP.Primary.Damage = 2 //base damage, scaled by game +SWEP.Primary.Spread = .06 //define from-the-hip accuracy (1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = .06 // has to be the same as primary.spread +-- Because irons don't magically give you less pellet spread! + + +SWEP.IronSightsPos = Vector(2.809, 0, 1.48) +SWEP.IronSightsAng = Vector(0, 0, 0) +SWEP.SightsPos = Vector(2.809, 0, 1.48) +SWEP.SightsAng = Vector(0, 0, 0) +SWEP.RunSightsPos = Vector(-3.116, -3.935, 0.492) +SWEP.RunSightsAng = Vector(-19.894, -47.624, 10.902) + +if ((gmod.GetGamemode().Name) == "Murderthon 9000") or ((gmod.GetGamemode().Name) == "Murderthon 9000 beta") then + SWEP.Primary.Ammo = "slam" +else + SWEP.Primary.Ammo = "buckshot" +end + +if GetConVar("M9KDefaultClip") == nil then + print("M9KDefaultClip is missing! You may have hit the lua limit!") +else + if GetConVar("M9KDefaultClip"):GetInt() != -1 then + SWEP.Primary.DefaultClip = SWEP.Primary.ClipSize * GetConVar("M9KDefaultClip"):GetInt() + end +end + +if GetConVar("M9KUniqueSlots") != nil then + if not (GetConVar("M9KUniqueSlots"):GetBool()) then + SWEP.SlotPos = 2 + end +end +function SWEP:ShootBullet( DirX, DirY, DirZ ) + + local bullet = {} + bullet.Num = 1 + bullet.Src = self.Owner:GetShootPos() -- Source + bullet.Dir = self.Owner:GetAimVector() + (self.Owner:GetAimVector():Angle():Right()*DirX) + (self.Owner:GetAimVector():Angle():Up()*DirY) -- Dir of bullet + bullet.Spread = Vector(0,0,0) -- Aim Cone + bullet.Tracer = 1 -- Show a tracer on every x bullets + bullet.Force = 1 -- Amount of force to give to phys objects + bullet.Damage = 9 + bullet.AmmoType = self.Primary.Ammo + bullet.HullSize = 0 + + self.Owner:FireBullets( bullet ) + + self:ShootEffects() + +end +SWEP.Primary.KickUp = 0 +SWEP.Primary.Recoil = 0 \ No newline at end of file diff --git a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_ares_shrike/shared.lua b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_ares_shrike/shared.lua index 96b2807..eaf5cb7 100644 --- a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_ares_shrike/shared.lua +++ b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_ares_shrike/shared.lua @@ -35,10 +35,10 @@ SWEP.FiresUnderwater = false SWEP.Primary.Sound = Sound("Weapon_shrk.Single") -- Script that calls the primary fire sound SWEP.Primary.RPM = 650 -- This is in Rounds Per Minute -SWEP.Primary.ClipSize = 200 -- Size of a clip +SWEP.Primary.ClipSize = 50 -- Size of a clip SWEP.Primary.DefaultClip = 400 -- Bullets you start with -SWEP.Primary.KickUp = 0.6 -- Maximum up recoil (rise) -SWEP.Primary.KickDown = 0.4 -- Maximum down recoil (skeet) +SWEP.Primary.KickUp = 0.5 -- Maximum up recoil (rise) +SWEP.Primary.KickDown = 0.5 -- Maximum down recoil (skeet) SWEP.Primary.KickHorizontal = 0.5 -- Maximum up recoil (stock) SWEP.Primary.Automatic = true -- Automatic = true; Semi Auto = false SWEP.Primary.Ammo = "ar2" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun @@ -50,9 +50,9 @@ SWEP.data = {} --The starting firemode SWEP.data.ironsights = 1 SWEP.Primary.NumShots = 1 -- How many bullets to shoot per trigger pull -SWEP.Primary.Damage = 30 -- Base damage per bullet -SWEP.Primary.Spread = .03 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .02 -- Ironsight accuracy, should be the same for shotguns +SWEP.Primary.Damage = 20 -- Base damage per bullet +SWEP.Primary.Spread = 0 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = 0 -- Ironsight accuracy, should be the same for shotguns -- Enter iron sight info and bone mod info below SWEP.IronSightsPos = Vector(-3.804, 0, 0.495) @@ -74,4 +74,6 @@ if GetConVar("M9KUniqueSlots") != nil then if not (GetConVar("M9KUniqueSlots"):GetBool()) then SWEP.SlotPos = 2 end -end \ No newline at end of file +end +SWEP.Primary.KickUp = 0.5 +SWEP.Primary.Recoil = 0.3 \ No newline at end of file diff --git a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_aw50/shared.lua b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_aw50/shared.lua index 1494f70..27af16d 100644 --- a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_aw50/shared.lua +++ b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_aw50/shared.lua @@ -1,89 +1,91 @@ --- Variables that are used on both client and server -SWEP.Gun = ("m9k_aw50") -- must be the name of your swep but NO CAPITALS! -if (GetConVar(SWEP.Gun.."_allowed")) != nil then - if not (GetConVar(SWEP.Gun.."_allowed"):GetBool()) then SWEP.Base = "bobs_blacklisted" SWEP.PrintName = SWEP.Gun return end -end -SWEP.Category = "M9K Sniper Rifles" -SWEP.Author = "" -SWEP.Contact = "" -SWEP.Purpose = "" -SWEP.Instructions = "" -SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models -SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models -SWEP.PrintName = "AI AW50" -- Weapon name (Shown on HUD) -SWEP.Slot = 3 -- Slot in the weapon selection menu -SWEP.SlotPos = 50 -- Position in the slot -SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter -SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box -SWEP.BounceWeaponIcon = false -- Should the weapon icon bounce? -SWEP.DrawCrosshair = false -- Set false if you want no crosshair from hip -SWEP.XHair = false -- Used for returning crosshair after scope. Must be the same as DrawCrosshair -SWEP.Weight = 50 -- Rank relative ot other weapons. bigger is better -SWEP.AutoSwitchTo = true -- Auto switch to if we pick it up -SWEP.AutoSwitchFrom = true -- Auto switch from if you pick up a better weapon -SWEP.BoltAction = true -- Is this a bolt action rifle? -SWEP.HoldType = "rpg" -- how others view you carrying the weapon --- normal melee melee2 fist knife smg ar2 pistol rpg physgun grenade shotgun crossbow slam passive --- you're mostly going to use ar2, smg, shotgun or pistol. rpg and crossbow make for good sniper rifles - -SWEP.ViewModelFOV = 70 -SWEP.ViewModelFlip = true -SWEP.ViewModel = "models/weapons/v_aw50_awp.mdl" -- Weapon view model -SWEP.WorldModel = "models/weapons/w_acc_int_aw50.mdl" -- Weapon world model -SWEP.Base = "bobs_scoped_base" -SWEP.Spawnable = true -SWEP.AdminSpawnable = true - -SWEP.Primary.Sound = Sound("Weaponaw50.Single") -- script that calls the primary fire sound -SWEP.Primary.RPM = 50 -- This is in Rounds Per Minute -SWEP.Primary.ClipSize = 10 -- Size of a clip -SWEP.Primary.DefaultClip = 60 -- Bullets you start with -SWEP.Primary.KickUp = 1 -- Maximum up recoil (rise) -SWEP.Primary.KickDown = 1 -- Maximum down recoil (skeet) -SWEP.Primary.KickHorizontal = 1 -- Maximum up recoil (stock) -SWEP.Primary.Automatic = false -- Automatic/Semi Auto -SWEP.Primary.Ammo = "SniperPenetratedRound" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun --- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets - -SWEP.Secondary.ScopeZoom = 9 -SWEP.Secondary.UseACOG = false -- Choose one scope type -SWEP.Secondary.UseMilDot = false -- I mean it, only one -SWEP.Secondary.UseSVD = false -- If you choose more than one, your scope will not show up at all -SWEP.Secondary.UseParabolic = true -SWEP.Secondary.UseElcan = false -SWEP.Secondary.UseGreenDuplex = false -SWEP.Secondary.UseAimpoint = false -SWEP.Secondary.UseMatador = false - -SWEP.data = {} -SWEP.data.ironsights = 1 -SWEP.ScopeScale = 0.7 -SWEP.ReticleScale = 0.6 - -SWEP.Primary.NumShots = 1 --how many bullets to shoot per trigger pull -SWEP.Primary.Damage = 95 --base damage per bullet -SWEP.Primary.Spread = .01 --define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .0001 -- ironsight accuracy, should be the same for shotguns - --- enter iron sight info and bone mod info below - -SWEP.IronSightsPos = Vector(3.68, 0, 1.08) -SWEP.IronSightsAng = Vector(0, 0, 0) -SWEP.SightsPos = Vector(3.68, 0, 1.08) -SWEP.SightsAng = Vector(0, 0, 0) -SWEP.RunSightsPos = Vector (-2.3095, -3.0514, 2.3965) -SWEP.RunSightsAng = Vector (-19.8471, -33.9181, 10) - -if GetConVar("M9KDefaultClip") == nil then - print("M9KDefaultClip is missing! You may have hit the lua limit!") -else - if GetConVar("M9KDefaultClip"):GetInt() != -1 then - SWEP.Primary.DefaultClip = SWEP.Primary.ClipSize * GetConVar("M9KDefaultClip"):GetInt() - end -end - -if GetConVar("M9KUniqueSlots") != nil then - if not (GetConVar("M9KUniqueSlots"):GetBool()) then - SWEP.SlotPos = 2 - end -end \ No newline at end of file +-- Variables that are used on both client and server +SWEP.Gun = ("m9k_aw50") -- must be the name of your swep but NO CAPITALS! +if (GetConVar(SWEP.Gun.."_allowed")) != nil then + if not (GetConVar(SWEP.Gun.."_allowed"):GetBool()) then SWEP.Base = "bobs_blacklisted" SWEP.PrintName = SWEP.Gun return end +end +SWEP.Category = "M9K Sniper Rifles" +SWEP.Author = "" +SWEP.Contact = "" +SWEP.Purpose = "" +SWEP.Instructions = "" +SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models +SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models +SWEP.PrintName = "AI AW50" -- Weapon name (Shown on HUD) +SWEP.Slot = 4 -- Slot in the weapon selection menu +SWEP.SlotPos = 50 -- Position in the slot +SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter +SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box +SWEP.BounceWeaponIcon = false -- Should the weapon icon bounce? +SWEP.DrawCrosshair = false -- Set false if you want no crosshair from hip +SWEP.XHair = false -- Used for returning crosshair after scope. Must be the same as DrawCrosshair +SWEP.Weight = 50 -- Rank relative ot other weapons. bigger is better +SWEP.AutoSwitchTo = true -- Auto switch to if we pick it up +SWEP.AutoSwitchFrom = true -- Auto switch from if you pick up a better weapon +SWEP.BoltAction = true -- Is this a bolt action rifle? +SWEP.HoldType = "rpg" -- how others view you carrying the weapon +-- normal melee melee2 fist knife smg ar2 pistol rpg physgun grenade shotgun crossbow slam passive +-- you're mostly going to use ar2, smg, shotgun or pistol. rpg and crossbow make for good sniper rifles + +SWEP.ViewModelFOV = 70 +SWEP.ViewModelFlip = true +SWEP.ViewModel = "models/weapons/v_aw50_awp.mdl" -- Weapon view model +SWEP.WorldModel = "models/weapons/w_acc_int_aw50.mdl" -- Weapon world model +SWEP.Base = "bobs_scoped_base" +SWEP.Spawnable = true +SWEP.AdminSpawnable = true + +SWEP.Primary.Sound = Sound("Weaponaw50.Single") -- script that calls the primary fire sound +SWEP.Primary.RPM = 45 -- This is in Rounds Per Minute +SWEP.Primary.ClipSize = 5 -- Size of a clip +SWEP.Primary.DefaultClip = 60 -- Bullets you start with +SWEP.Primary.KickUp = 10 -- Maximum up recoil (rise) +SWEP.Primary.KickDown = 0 -- Maximum down recoil (skeet) +SWEP.Primary.KickHorizontal = 10 -- Maximum up recoil (stock) +SWEP.Primary.Automatic = false -- Automatic/Semi Auto +SWEP.Primary.Ammo = "SniperPenetratedRound" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun +-- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets + +SWEP.Secondary.ScopeZoom = 9 +SWEP.Secondary.UseACOG = false -- Choose one scope type +SWEP.Secondary.UseMilDot = false -- I mean it, only one +SWEP.Secondary.UseSVD = false -- If you choose more than one, your scope will not show up at all +SWEP.Secondary.UseParabolic = true +SWEP.Secondary.UseElcan = false +SWEP.Secondary.UseGreenDuplex = false +SWEP.Secondary.UseAimpoint = false +SWEP.Secondary.UseMatador = false + +SWEP.data = {} +SWEP.data.ironsights = 1 +SWEP.ScopeScale = 0.7 +SWEP.ReticleScale = 0.6 + +SWEP.Primary.NumShots = 1 --how many bullets to shoot per trigger pull +SWEP.Primary.Damage = 100 --base damage per bullet +SWEP.Primary.Spread = 0.5 --define from-the-hip accuracy 1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = 0 -- ironsight accuracy, should be the same for shotguns + +-- enter iron sight info and bone mod info below + +SWEP.IronSightsPos = Vector(3.68, 0, 1.08) +SWEP.IronSightsAng = Vector(0, 0, 0) +SWEP.SightsPos = Vector(3.68, 0, 1.08) +SWEP.SightsAng = Vector(0, 0, 0) +SWEP.RunSightsPos = Vector (-2.3095, -3.0514, 2.3965) +SWEP.RunSightsAng = Vector (-19.8471, -33.9181, 10) + +if GetConVar("M9KDefaultClip") == nil then + print("M9KDefaultClip is missing! You may have hit the lua limit!") +else + if GetConVar("M9KDefaultClip"):GetInt() != -1 then + SWEP.Primary.DefaultClip = SWEP.Primary.ClipSize * GetConVar("M9KDefaultClip"):GetInt() + end +end + +if GetConVar("M9KUniqueSlots") != nil then + if not (GetConVar("M9KUniqueSlots"):GetBool()) then + SWEP.SlotPos = 2 + end +end +SWEP.Primary.KickUp = 10 +SWEP.Primary.Recoil = 0 \ No newline at end of file diff --git a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_barret_m82/shared.lua b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_barret_m82/shared.lua index 480bcee..6fdcf3d 100644 --- a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_barret_m82/shared.lua +++ b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_barret_m82/shared.lua @@ -11,7 +11,7 @@ SWEP.Instructions = "" SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models SWEP.PrintName = "Barret M82" -- Weapon name (Shown on HUD) -SWEP.Slot = 3 -- Slot in the weapon selection menu +SWEP.Slot = 4 -- Slot in the weapon selection menu SWEP.SlotPos = 51 -- Position in the slot SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box @@ -43,7 +43,7 @@ SWEP.Primary.KickUp = 1 -- Maximum up recoil (rise) SWEP.Primary.KickDown = 1 -- Maximum down recoil (skeet) SWEP.Primary.KickHorizontal = 1 -- Maximum up recoil (stock) SWEP.Primary.Automatic = false -- Automatic/Semi Auto -SWEP.Primary.Ammo = "SniperPenetratedRound" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun +SWEP.Primary.Ammo = "ar2" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun -- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets SWEP.Secondary.ScopeZoom = 9 @@ -62,9 +62,9 @@ SWEP.ScopeScale = 0.7 SWEP.ReticleScale = 0.6 SWEP.Primary.NumShots = 1 --how many bullets to shoot per trigger pull -SWEP.Primary.Damage = 110 --base damage per bullet -SWEP.Primary.Spread = .01 --define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .00001 -- ironsight accuracy, should be the same for shotguns +SWEP.Primary.Damage = 50 --base damage per bullet +SWEP.Primary.Spread = .05 --define from-the-hip accuracy 1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = 0 -- ironsight accuracy, should be the same for shotguns -- enter iron sight info and bone mod info below @@ -87,4 +87,6 @@ if GetConVar("M9KUniqueSlots") != nil then if not (GetConVar("M9KUniqueSlots"):GetBool()) then SWEP.SlotPos = 2 end -end \ No newline at end of file +end +SWEP.Primary.KickUp = 5 +SWEP.Primary.Recoil = 0 \ No newline at end of file diff --git a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_browningauto5/shared.lua b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_browningauto5/shared.lua index 4875703..4156a62 100644 --- a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_browningauto5/shared.lua +++ b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_browningauto5/shared.lua @@ -11,7 +11,7 @@ SWEP.Instructions = "" SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models SWEP.PrintName = "Browning Auto 5" -- Weapon name (Shown on HUD) -SWEP.Slot = 3 -- Slot in the weapon selection menu +SWEP.Slot = 2 -- Slot in the weapon selection menu SWEP.SlotPos = 32 -- Position in the slot SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box @@ -48,12 +48,12 @@ SWEP.Secondary.IronFOV = 60 -- How much you 'zoom' in. Less is more! SWEP.data = {} --The starting firemode SWEP.data.ironsights = 1 -SWEP.ShellTime = .35 +SWEP.ShellTime = .33 -SWEP.Primary.NumShots = 9 //how many bullets to shoot, use with shotguns -SWEP.Primary.Damage = 10 //base damage, scaled by game -SWEP.Primary.Spread = .03 //define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .03 // has to be the same as primary.spread +SWEP.Primary.NumShots = 60 //how many bullets to shoot, use with shotguns +SWEP.Primary.Damage = 1 //base damage, scaled by game +SWEP.Primary.Spread = .06 //define from-the-hip accuracy 1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = .06 // has to be the same as primary.spread -- Because irons don't magically give you less pellet spread! -- Enter iron sight info and bone mod info below @@ -76,4 +76,24 @@ if GetConVar("M9KUniqueSlots") != nil then if not (GetConVar("M9KUniqueSlots"):GetBool()) then SWEP.SlotPos = 2 end -end \ No newline at end of file +end +function SWEP:ShootBullet( DirX, DirY, DirZ ) + + local bullet = {} + bullet.Num = 1 + bullet.Src = self.Owner:GetShootPos() -- Source + bullet.Dir = self.Owner:GetAimVector() + (self.Owner:GetAimVector():Angle():Right()*DirX) + (self.Owner:GetAimVector():Angle():Up()*DirY) -- Dir of bullet + bullet.Spread = Vector(0,0,0) -- Aim Cone + bullet.Tracer = 1 -- Show a tracer on every x bullets + bullet.Force = 1 -- Amount of force to give to phys objects + bullet.Damage = 6 + bullet.AmmoType = self.Primary.Ammo + bullet.HullSize = 0 + + self.Owner:FireBullets( bullet ) + + self:ShootEffects() + +end +SWEP.Primary.KickUp = 0 +SWEP.Primary.Recoil = 0 \ No newline at end of file diff --git a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_contender/shared.lua b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_contender/shared.lua index 164e262..1a1fc81 100644 --- a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_contender/shared.lua +++ b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_contender/shared.lua @@ -1,233 +1,235 @@ --- Variables that are used on both client and server -SWEP.Gun = ("m9k_contender") -- must be the name of your swep but NO CAPITALS! -if (GetConVar(SWEP.Gun.."_allowed")) != nil then - if not (GetConVar(SWEP.Gun.."_allowed"):GetBool()) then SWEP.Base = "bobs_blacklisted" SWEP.PrintName = SWEP.Gun return end -end -SWEP.Category = "M9K Sniper Rifles" -SWEP.Author = "" -SWEP.Contact = "" -SWEP.Purpose = "" -SWEP.Instructions = "" -SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models -SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models -SWEP.PrintName = "Thompson Contender G2" -- Weapon name (Shown on HUD) -SWEP.Slot = 3 -- Slot in the weapon selection menu -SWEP.SlotPos = 40 -- Position in the slot -SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter -SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box -SWEP.BounceWeaponIcon = false -- Should the weapon icon bounce? -SWEP.DrawCrosshair = false -- Set false if you want no crosshair from hip -SWEP.XHair = false -- Used for returning crosshair after scope. Must be the same as DrawCrosshair -SWEP.Weight = 50 -- Rank relative ot other weapons. bigger is better -SWEP.AutoSwitchTo = true -- Auto switch to if we pick it up -SWEP.AutoSwitchFrom = true -- Auto switch from if you pick up a better weapon -SWEP.BoltAction = true -- Is this a bolt action rifle? -SWEP.HoldType = "rpg" -- how others view you carrying the weapon --- normal melee melee2 fist knife smg ar2 pistol rpg physgun grenade shotgun crossbow slam passive --- you're mostly going to use ar2, smg, shotgun or pistol. rpg and crossbow make for good sniper rifles - -SWEP.ViewModelFOV = 70 -SWEP.ViewModelFlip = false -SWEP.ViewModel = "models/weapons/v_contender2.mdl" -- Weapon view model -SWEP.WorldModel = "models/weapons/w_g2_contender.mdl" -- Weapon world model -SWEP.Base = "bobs_scoped_base" -SWEP.Spawnable = true -SWEP.AdminSpawnable = true - -SWEP.Primary.Sound = Sound("contender_g2.Single") -- script that calls the primary fire sound -SWEP.Primary.RPM = 35 -- This is in Rounds Per Minute -SWEP.Primary.ClipSize = 1 -- Size of a clip -SWEP.Primary.DefaultClip = 60 -- Bullets you start with -SWEP.Primary.KickUp = 1 -- Maximum up recoil (rise) -SWEP.Primary.KickDown = 1 -- Maximum down recoil (skeet) -SWEP.Primary.KickHorizontal = 1 -- Maximum up recoil (stock) -SWEP.Primary.Automatic = false -- Automatic/Semi Auto -SWEP.Primary.Ammo = "ar2" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun --- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets - -SWEP.Secondary.ScopeZoom = 9 -SWEP.Secondary.UseACOG = false -- Choose one scope type -SWEP.Secondary.UseMilDot = true -- I mean it, only one -SWEP.Secondary.UseSVD = false -- If you choose more than one, your scope will not show up at all -SWEP.Secondary.UseParabolic = false -SWEP.Secondary.UseElcan = false -SWEP.Secondary.UseGreenDuplex = false -SWEP.Secondary.UseAimpoint = false -SWEP.Secondary.UseMatador = false - -SWEP.data = {} -SWEP.data.ironsights = 1 -SWEP.ScopeScale = 0.7 -SWEP.ReticleScale = 0.6 - -SWEP.Primary.NumShots = 1 --how many bullets to shoot per trigger pull -SWEP.Primary.Damage = 85 --base damage per bullet -SWEP.Primary.Spread = .01 --define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .00015 -- ironsight accuracy, should be the same for shotguns - --- enter iron sight info and bone mod info below - -SWEP.IronSightsPos = Vector(-3, -0.857, 0.36) -SWEP.IronSightsAng = Vector(0, 0, 0) -SWEP.SightsPos = Vector(-3, -0.857, 0.36) -SWEP.SightsAng = Vector(0, 0, 0) -SWEP.RunSightsPos = Vector(3.714, -1.429, 0) -SWEP.RunSightsAng = Vector(-11, 31, 0) - -if (gmod.GetGamemode().Name == "Murderthon 9000") then - - SWEP.Slot = 1 -- Slot in the weapon selection menu - SWEP.Weight = 3 -- rank relative ot other weapons. bigger is better - -end - -function SWEP:PrimaryAttack() - if self.Owner:IsNPC() then return end - if self:CanPrimaryAttack() and !self.Owner:KeyDown(IN_SPEED) then - self:ShootBulletInformation() - self.Weapon:EmitSound(self.Primary.Sound) - self.Weapon:TakePrimaryAmmo(1) - self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK ) - local fx = EffectData() - fx:SetEntity(self.Weapon) - fx:SetOrigin(self.Owner:GetShootPos()) - fx:SetNormal(self.Owner:GetAimVector()) - fx:SetAttachment(self.MuzzleAttachment) - util.Effect("rg_muzzle_rifle",fx) - self.Owner:SetAnimation( PLAYER_ATTACK1 ) - self.Owner:MuzzleFlash() - self.Weapon:SetNextPrimaryFire(CurTime()+10) - self.RicochetCoin = (math.random(1,4)) - self:UseBolt() - end -end - -function SWEP:UseBolt() - - if self.Owner:GetAmmoCount( self.Weapon:GetPrimaryAmmoType() ) > 0 then - timer.Simple(.25, function() - if SERVER and self.Weapon != nil then - self.Weapon:SetNWBool("Reloading", true) - if self.Weapon:GetClass() == self.Gun and self.BoltAction then - self.Owner:SetFOV( 0, 0.3 ) - self:SetIronsights(false) - self.Owner:DrawViewModel(true) - local boltactiontime = (self.Owner:GetViewModel():SequenceDuration()) - timer.Simple(boltactiontime, - function() if self.Weapon and self.Owner then if IsValid(self.Weapon) and IsValid(self.Owner) then - self.Weapon:SetNWBool("Reloading", false) - if SERVER and self.Weapon != nil then - if self.Owner:KeyDown(IN_ATTACK2) and self.Weapon:GetClass() == self.Gun then - self.Owner:SetFOV( 75/self.Secondary.ScopeZoom, 0.15 ) - self.IronSightsPos = self.SightsPos -- Bring it up - self.IronSightsAng = self.SightsAng -- Bring it up - self.DrawCrosshair = false - self:SetIronsights(true, self.Owner) - self.Owner:DrawViewModel(false) - - self.Owner:RemoveAmmo(1, self.Primary.Ammo, false) -- out of the frying pan - self.Weapon:SetClip1(self.Weapon:Clip1() + 1) -- into the fire - self.Weapon:SetNextPrimaryFire(CurTime() + .1) - --well, hope this works - elseif !self.Owner:KeyDown(IN_ATTACK2) and self.Weapon:GetClass() == self.Gun then - self.Owner:RemoveAmmo(1, self.Primary.Ammo, false) -- out of the frying pan - self.Weapon:SetClip1(self.Weapon:Clip1() + 1) -- into the fire - self.Weapon:SetNextPrimaryFire(CurTime() + .1) - end - end - end end end) - -- else if self.Weapon:GetClass() == self.Gun and - -- self.BoltAction and (self:GetIronsights() == false) then - - end - end - end ) - else - timer.Simple(.1, function() self:CheckWeaponsAndAmmo() end) - end - -end - -function SWEP:Reload() - - -// self.Weapon:DefaultReload(ACT_VM_RELOAD) - - if not IsValid(self) then return end - if not IsValid(self.Owner) then return end - if not IsValid(self.Weapon) then return end - - if self.Weapon:GetNextPrimaryFire() > (CurTime() + 1) then - return - else - - if self.Owner:IsNPC() then - self.Weapon:DefaultReload(ACT_VM_RELOAD) - return end - - if self.Owner:KeyDown(IN_USE) then return end - - if self.Silenced then - self.Weapon:DefaultReload(ACT_VM_RELOAD_SILENCED) - else - self.Weapon:DefaultReload(ACT_VM_RELOAD) - end - - if !self.Owner:IsNPC() then - if self.Owner:GetViewModel() == nil then self.ResetSights = CurTime() + 3 else - self.ResetSights = CurTime() + self.Owner:GetViewModel():SequenceDuration() - end - end - - if SERVER and self.Weapon != nil then - if ( self.Weapon:Clip1() < self.Primary.ClipSize ) and !self.Owner:IsNPC() then - -- //When the current clip < full clip and the rest of your ammo > 0, then - self.Owner:SetFOV( 0, 0.3 ) - -- //Zoom = 0 - self:SetIronsights(false) - -- //Set the ironsight to false - self.Weapon:SetNWBool("Reloading", true) - end - local waitdammit = (self.Owner:GetViewModel():SequenceDuration()) - timer.Simple(waitdammit + .1, - function() - if self.Weapon == nil then return end - self.Weapon:SetNWBool("Reloading", false) - if self.Owner:KeyDown(IN_ATTACK2) and self.Weapon:GetClass() == self.Gun then - if CLIENT then return end - if self.Scoped == false then - self.Owner:SetFOV( self.Secondary.IronFOV, 0.3 ) - self.IronSightsPos = self.SightsPos -- Bring it up - self.IronSightsAng = self.SightsAng -- Bring it up - self:SetIronsights(true, self.Owner) - self.DrawCrosshair = false - else return end - elseif self.Owner:KeyDown(IN_SPEED) and self.Weapon:GetClass() == self.Gun then - if self.Weapon:GetNextPrimaryFire() <= (CurTime() + .03) then - self.Weapon:SetNextPrimaryFire(CurTime()+0.3) -- Make it so you can't shoot for another quarter second - end - self.IronSightsPos = self.RunSightsPos -- Hold it down - self.IronSightsAng = self.RunSightsAng -- Hold it down - self:SetIronsights(true, self.Owner) -- Set the ironsight true - self.Owner:SetFOV( 0, 0.3 ) - else return end - end) - end - - end - -end - -if GetConVar("M9KDefaultClip") == nil then - print("M9KDefaultClip is missing! You may have hit the lua limit!") -else - if GetConVar("M9KDefaultClip"):GetInt() != -1 then - SWEP.Primary.DefaultClip = SWEP.Primary.ClipSize * GetConVar("M9KDefaultClip"):GetInt() - end -end - -if GetConVar("M9KUniqueSlots") != nil then - if not (GetConVar("M9KUniqueSlots"):GetBool()) then - SWEP.SlotPos = 2 - end -end \ No newline at end of file +-- Variables that are used on both client and server +SWEP.Gun = ("m9k_contender") -- must be the name of your swep but NO CAPITALS! +if (GetConVar(SWEP.Gun.."_allowed")) != nil then + if not (GetConVar(SWEP.Gun.."_allowed"):GetBool()) then SWEP.Base = "bobs_blacklisted" SWEP.PrintName = SWEP.Gun return end +end +SWEP.Category = "M9K Sniper Rifles" +SWEP.Author = "" +SWEP.Contact = "" +SWEP.Purpose = "" +SWEP.Instructions = "" +SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models +SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models +SWEP.PrintName = "Thompson Contender G2" -- Weapon name (Shown on HUD) +SWEP.Slot = 4 -- Slot in the weapon selection menu +SWEP.SlotPos = 40 -- Position in the slot +SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter +SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box +SWEP.BounceWeaponIcon = false -- Should the weapon icon bounce? +SWEP.DrawCrosshair = false -- Set false if you want no crosshair from hip +SWEP.XHair = false -- Used for returning crosshair after scope. Must be the same as DrawCrosshair +SWEP.Weight = 50 -- Rank relative ot other weapons. bigger is better +SWEP.AutoSwitchTo = true -- Auto switch to if we pick it up +SWEP.AutoSwitchFrom = true -- Auto switch from if you pick up a better weapon +SWEP.BoltAction = true -- Is this a bolt action rifle? +SWEP.HoldType = "rpg" -- how others view you carrying the weapon +-- normal melee melee2 fist knife smg ar2 pistol rpg physgun grenade shotgun crossbow slam passive +-- you're mostly going to use ar2, smg, shotgun or pistol. rpg and crossbow make for good sniper rifles + +SWEP.ViewModelFOV = 70 +SWEP.ViewModelFlip = false +SWEP.ViewModel = "models/weapons/v_contender2.mdl" -- Weapon view model +SWEP.WorldModel = "models/weapons/w_g2_contender.mdl" -- Weapon world model +SWEP.Base = "bobs_scoped_base" +SWEP.Spawnable = true +SWEP.AdminSpawnable = true + +SWEP.Primary.Sound = Sound("contender_g2.Single") -- script that calls the primary fire sound +SWEP.Primary.RPM = 60 -- This is in Rounds Per Minute +SWEP.Primary.ClipSize = 1 -- Size of a clip +SWEP.Primary.DefaultClip = 60 -- Bullets you start with +SWEP.Primary.KickUp = 1 -- Maximum up recoil (rise) +SWEP.Primary.KickDown = 1 -- Maximum down recoil (skeet) +SWEP.Primary.KickHorizontal = 1 -- Maximum up recoil (stock) +SWEP.Primary.Automatic = false -- Automatic/Semi Auto +SWEP.Primary.Ammo = "ar2" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun +-- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets + +SWEP.Secondary.ScopeZoom = 9 +SWEP.Secondary.UseACOG = false -- Choose one scope type +SWEP.Secondary.UseMilDot = true -- I mean it, only one +SWEP.Secondary.UseSVD = false -- If you choose more than one, your scope will not show up at all +SWEP.Secondary.UseParabolic = false +SWEP.Secondary.UseElcan = false +SWEP.Secondary.UseGreenDuplex = false +SWEP.Secondary.UseAimpoint = false +SWEP.Secondary.UseMatador = false + +SWEP.data = {} +SWEP.data.ironsights = 1 +SWEP.ScopeScale = 0.7 +SWEP.ReticleScale = 0.6 + +SWEP.Primary.NumShots = 1 --how many bullets to shoot per trigger pull +SWEP.Primary.Damage = 100.1 --base damage per bullet +SWEP.Primary.Spread = 0 --define from-the-hip accuracy 1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = 0 -- ironsight accuracy, should be the same for shotguns + +-- enter iron sight info and bone mod info below + +SWEP.IronSightsPos = Vector(-3, -0.857, 0.36) +SWEP.IronSightsAng = Vector(0, 0, 0) +SWEP.SightsPos = Vector(-3, -0.857, 0.36) +SWEP.SightsAng = Vector(0, 0, 0) +SWEP.RunSightsPos = Vector(3.714, -1.429, 0) +SWEP.RunSightsAng = Vector(-11, 31, 0) + +if (gmod.GetGamemode().Name == "Murderthon 9000") then + + SWEP.Slot = 1 -- Slot in the weapon selection menu + SWEP.Weight = 3 -- rank relative ot other weapons. bigger is better + +end + +function SWEP:PrimaryAttack() + if self.Owner:IsNPC() then return end + if self:CanPrimaryAttack() then + self:ShootBulletInformation() + self.Weapon:EmitSound(self.Primary.Sound) + self.Weapon:TakePrimaryAmmo(1) + self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK ) + local fx = EffectData() + fx:SetEntity(self.Weapon) + fx:SetOrigin(self.Owner:GetShootPos()) + fx:SetNormal(self.Owner:GetAimVector()) + fx:SetAttachment(self.MuzzleAttachment) + util.Effect("rg_muzzle_rifle",fx) + self.Owner:SetAnimation( PLAYER_ATTACK1 ) + self.Owner:MuzzleFlash() + self.Weapon:SetNextPrimaryFire(CurTime()+10) + self.RicochetCoin = (math.random(1,4)) + self:UseBolt() + end +end + +function SWEP:UseBolt() + + if self.Owner:GetAmmoCount( self.Weapon:GetPrimaryAmmoType() ) > 0 then + timer.Simple(.25, function() + if SERVER and self.Weapon != nil then + self.Weapon:SetNWBool("Reloading", true) + if self.Weapon:GetClass() == self.Gun and self.BoltAction then + self.Owner:SetFOV( 0, 0.3 ) + self:SetIronsights(false) + self.Owner:DrawViewModel(true) + local boltactiontime = (self.Owner:GetViewModel():SequenceDuration()) + timer.Simple(boltactiontime, + function() if self.Weapon and self.Owner then if IsValid(self.Weapon) and IsValid(self.Owner) then + self.Weapon:SetNWBool("Reloading", false) + if SERVER and self.Weapon != nil then + if self.Owner:KeyDown(IN_ATTACK2) and self.Weapon:GetClass() == self.Gun then + self.Owner:SetFOV( 75/self.Secondary.ScopeZoom, 0.15 ) + self.IronSightsPos = self.SightsPos -- Bring it up + self.IronSightsAng = self.SightsAng -- Bring it up + self.DrawCrosshair = false + self:SetIronsights(true, self.Owner) + self.Owner:DrawViewModel(false) + + self.Owner:RemoveAmmo(1, self.Primary.Ammo, false) -- out of the frying pan + self.Weapon:SetClip1(self.Weapon:Clip1() + 1) -- into the fire + self.Weapon:SetNextPrimaryFire(CurTime() + .1) + --well, hope this works + elseif !self.Owner:KeyDown(IN_ATTACK2) and self.Weapon:GetClass() == self.Gun then + self.Owner:RemoveAmmo(1, self.Primary.Ammo, false) -- out of the frying pan + self.Weapon:SetClip1(self.Weapon:GetMaxClip1()) -- into the fire + self.Weapon:SetNextPrimaryFire(CurTime() + .1) + end + end + end end end) + -- else if self.Weapon:GetClass() == self.Gun and + -- self.BoltAction and (self:GetIronsights() == false) then + + end + end + end ) + else + timer.Simple(.1, function() self:CheckWeaponsAndAmmo() end) + end + +end + +function SWEP:Reload() + + +// self.Weapon:DefaultReload(ACT_VM_RELOAD) + + if not IsValid(self) then return end + if not IsValid(self.Owner) then return end + if not IsValid(self.Weapon) then return end + + if self.Weapon:GetNextPrimaryFire() > (CurTime() + 1) then + return + else + + if self.Owner:IsNPC() then + self.Weapon:DefaultReload(ACT_VM_RELOAD) + return end + + if self.Owner:KeyDown(IN_USE) then return end + + if self.Silenced then + self.Weapon:DefaultReload(ACT_VM_RELOAD_SILENCED) + else + self.Weapon:DefaultReload(ACT_VM_RELOAD) + end + + if !self.Owner:IsNPC() then + if self.Owner:GetViewModel() == nil then self.ResetSights = CurTime() + 3 else + self.ResetSights = CurTime() + self.Owner:GetViewModel():SequenceDuration() + end + end + + if SERVER and self.Weapon != nil then + if ( self.Weapon:Clip1() < self.Primary.ClipSize ) and !self.Owner:IsNPC() then + -- //When the current clip < full clip and the rest of your ammo > 0, then + self.Owner:SetFOV( 0, 0.3 ) + -- //Zoom = 0 + self:SetIronsights(false) + -- //Set the ironsight to false + self.Weapon:SetNWBool("Reloading", true) + end + local waitdammit = (self.Owner:GetViewModel():SequenceDuration()) + timer.Simple(waitdammit - 50, + function() + if self.Weapon == nil then return end + self.Weapon:SetNWBool("Reloading", false) + if self.Owner:KeyDown(IN_ATTACK2) and self.Weapon:GetClass() == self.Gun then + if CLIENT then return end + if self.Scoped == false then + self.Owner:SetFOV( self.Secondary.IronFOV, 0.3 ) + self.IronSightsPos = self.SightsPos -- Bring it up + self.IronSightsAng = self.SightsAng -- Bring it up + self:SetIronsights(true, self.Owner) + self.DrawCrosshair = false + else return end + elseif self.Owner:KeyDown(IN_SPEED) and self.Weapon:GetClass() == self.Gun then + if self.Weapon:GetNextPrimaryFire() <= (CurTime() + .03) then + self.Weapon:SetNextPrimaryFire(CurTime()+0.3) -- Make it so you can't shoot for another quarter second + end + self.IronSightsPos = self.RunSightsPos -- Hold it down + self.IronSightsAng = self.RunSightsAng -- Hold it down + self:SetIronsights(true, self.Owner) -- Set the ironsight true + self.Owner:SetFOV( 0, 0.3 ) + else return end + end) + end + + end + +end + +if GetConVar("M9KDefaultClip") == nil then + print("M9KDefaultClip is missing! You may have hit the lua limit!") +else + if GetConVar("M9KDefaultClip"):GetInt() != -1 then + SWEP.Primary.DefaultClip = SWEP.Primary.ClipSize * GetConVar("M9KDefaultClip"):GetInt() + end +end + +if GetConVar("M9KUniqueSlots") != nil then + if not (GetConVar("M9KUniqueSlots"):GetBool()) then + SWEP.SlotPos = 2 + end +end +SWEP.Primary.KickUp = 10 +SWEP.Primary.Recoil = 0 \ No newline at end of file diff --git a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_dbarrel/shared.lua b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_dbarrel/shared.lua index df49757..812baf9 100644 --- a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_dbarrel/shared.lua +++ b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_dbarrel/shared.lua @@ -1,316 +1,327 @@ --- Variables that are used on both client and server -SWEP.Gun = ("m9k_dbarrel") -- must be the name of your swep but NO CAPITALS! -if (GetConVar(SWEP.Gun.."_allowed")) != nil then - if not (GetConVar(SWEP.Gun.."_allowed"):GetBool()) then SWEP.Base = "bobs_blacklisted" SWEP.PrintName = SWEP.Gun return end -end -SWEP.Category = "M9K Shotguns" -SWEP.Author = "" -SWEP.Contact = "" -SWEP.Purpose = "" -SWEP.Instructions = "" -SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models -SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models -SWEP.PrintName = "Double Barrel Shotgun" -- Weapon name (Shown on HUD) -SWEP.Slot = 3 -- Slot in the weapon selection menu -SWEP.SlotPos = 21 -- Position in the slot -SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter -SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box -SWEP.BounceWeaponIcon = false -- Should the weapon icon bounce? -SWEP.DrawCrosshair = true -- set false if you want no crosshair -SWEP.Weight = 30 -- rank relative ot other weapons. bigger is better -SWEP.AutoSwitchTo = true -- Auto switch to if we pick it up -SWEP.AutoSwitchFrom = true -- Auto switch from if you pick up a better weapon -SWEP.HoldType = "shotgun" -- how others view you carrying the weapon --- normal melee melee2 fist knife smg ar2 pistol rpg physgun grenade shotgun crossbow slam passive --- you're mostly going to use ar2, smg, shotgun or pistol. rpg and crossbow make for good sniper rifles - -SWEP.ViewModelFOV = 70 -SWEP.ViewModelFlip = false -SWEP.ViewModel = "models/weapons/v_doublebarrl.mdl" -- Weapon view model -SWEP.WorldModel = "models/weapons/w_double_barrel_shotgun.mdl" -- Weapon world model -SWEP.Base = "bobs_shotty_base" -SWEP.Spawnable = true -SWEP.AdminSpawnable = true - -SWEP.Primary.Sound = Sound("Double_Barrel.Single") -- script that calls the primary fire sound -SWEP.Primary.RPM = 180 -- This is in Rounds Per Minute -SWEP.Primary.ClipSize = 2 -- Size of a clip -SWEP.Primary.DefaultClip = 30 -- Default number of bullets in a clip -SWEP.Primary.KickUp = 10 -- Maximum up recoil (rise) -SWEP.Primary.KickDown = 5 -- Maximum down recoil (skeet) -SWEP.Primary.KickHorizontal = 5 -- Maximum up recoil (stock) -SWEP.Primary.Automatic = false -- Automatic/Semi Auto -SWEP.Primary.Ammo = "buckshot" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun --- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets - -SWEP.Secondary.IronFOV = 0 -- How much you 'zoom' in. Less is more! - -SWEP.data = {} --The starting firemode -SWEP.data.ironsights = 1 - -SWEP.ShellTime = .5 - -SWEP.Primary.NumShots = 18 -- How many bullets to shoot per trigger pull, AKA pellets -SWEP.Primary.Damage = 10 -- Base damage per bullet -SWEP.Primary.Spread = .03 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .03 -- Ironsight accuracy, should be the same for shotguns --- Because irons don't magically give you less pellet spread! - --- Enter iron sight info and bone mod info below -SWEP.IronSightsPos = Vector(0, 0, 0) -SWEP.IronSightsAng = Vector(0, 0, 0) -SWEP.SightsPos = Vector(0, 0, 0) -SWEP.SightsAng = Vector(0, 0, 0) -SWEP.RunSightsPos = Vector(11.475, -7.705, -2.787) -SWEP.RunSightsAng = Vector(0.574, 51.638, 5.737) - -SWEP.Secondary.Sound = Sound("dbarrel_dblast") - -local PainMulti = 1 - -if GetConVar("M9KDamageMultiplier") == nil then - PainMulti = 1 - print("M9KDamageMultiplier is missing! You may have hit the lua limit! Reverting multiplier to 1.") -else - PainMulti = GetConVar("M9KDamageMultiplier"):GetFloat() - if PainMulti < 0 then - PainMulti = PainMulti * -1 - print("Your damage multiplier was in the negatives. It has been reverted to a positive number. Your damage multiplier is now "..PainMulti) - end -end - -function NewM9KDamageMultiplierDB(cvar, previous, new) - print("multiplier has been changed ") - if GetConVar("M9KDamageMultiplier") == nil then - PainMulti = 1 - print("M9KDamageMultiplier is missing! You may have hit the lua limit! Reverting multiplier to 1, you will notice no changes.") - else - PainMulti = GetConVar("M9KDamageMultiplier"):GetFloat() - if PainMulti < 0 then - PainMulti = PainMulti * -1 - end - end -end -cvars.AddChangeCallback("M9KDamageMultiplier", NewM9KDamageMultiplierDB) - -function SWEP:SecondaryAttack() - local timerName = "ShotgunReload_" .. self.Owner:UniqueID() - if (timer.Exists(timerName)) then return end - - if self:CanPrimaryAttack() and self.Owner:IsPlayer() then - if self.Weapon:Clip1() == 2 then - if !self.Owner:KeyDown(IN_SPEED) and !self.Owner:KeyDown(IN_RELOAD) then - self:ShootBulletInformation2() - self.Weapon:TakePrimaryAmmo(2) - self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK ) - self.Weapon:EmitSound(self.Secondary.Sound) - --self.Owner:ViewPunch(Angle(-15, math.Rand(-20,-25), 0)) - - local fx = EffectData() - fx:SetEntity(self.Weapon) - fx:SetOrigin(self.Owner:GetShootPos()) - fx:SetNormal(self.Owner:GetAimVector()) - fx:SetAttachment(self.MuzzleAttachment) - if GetConVar("M9KGasEffect") != nil then - if GetConVar("M9KGasEffect"):GetBool() then - util.Effect("m9k_rg_muzzle_rifle",fx) - end - end - self.Owner:SetAnimation( PLAYER_ATTACK1 ) - self.Owner:MuzzleFlash() - self.Weapon:SetNextSecondaryFire(CurTime()+1/((self.Primary.RPM/2)/60)) - self:CheckWeaponsAndAmmo() - self.RicochetCoin = (math.random(1,8)) - if self.BoltAction then self:BoltBack() end - end - elseif self.Weapon:Clip1() == 1 then - self.Weapon:PrimaryAttack() - self.Weapon:SetNextSecondaryFire(CurTime()+1/((self.Primary.RPM/2)/60)) - elseif self.Weapon:Clip1() == 0 then - self:Reload() - end - end -end - -function SWEP:PrimaryAttack() - local timerName = "ShotgunReload_" .. self.Owner:UniqueID() - if (timer.Exists(timerName)) then return end - if self:CanPrimaryAttack() and self.Owner:IsPlayer() then - if !self.Owner:KeyDown(IN_SPEED) and !self.Owner:KeyDown(IN_RELOAD) then - self:ShootBulletInformation() - self.Weapon:TakePrimaryAmmo(1) - - if self.Silenced then - self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK_SILENCED ) - self.Weapon:EmitSound(self.Primary.SilencedSound) - else - self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK ) - self.Weapon:EmitSound(self.Primary.Sound) - end - - local fx = EffectData() - fx:SetEntity(self.Weapon) - fx:SetOrigin(self.Owner:GetShootPos()) - fx:SetNormal(self.Owner:GetAimVector()) - fx:SetAttachment(self.MuzzleAttachment) - if GetConVar("M9KGasEffect") != nil then - if GetConVar("M9KGasEffect"):GetBool() then - util.Effect("m9k_rg_muzzle_rifle",fx) - end - end - self.Owner:SetAnimation( PLAYER_ATTACK1 ) - self.Owner:MuzzleFlash() - self.Weapon:SetNextPrimaryFire(CurTime()+1/(self.Primary.RPM/60)) - self:CheckWeaponsAndAmmo() - self.RicochetCoin = (math.random(1,4)) - if self.BoltAction then self:BoltBack() end - end - elseif self:CanPrimaryAttack() and self.Owner:IsNPC() then - self:ShootBulletInformation() - self.Weapon:TakePrimaryAmmo(1) - self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK ) - self.Weapon:EmitSound(self.Primary.Sound) - self.Owner:SetAnimation( PLAYER_ATTACK1 ) - self.Owner:MuzzleFlash() - self.Weapon:SetNextPrimaryFire(CurTime()+1/(self.Primary.RPM/60)) - self.RicochetCoin = (math.random(1,4)) - end -end - - -function SWEP:ShootBulletInformation2() - - local CurrentDamage - local CurrentRecoil - local CurrentCone - local basedamage - - CurrentCone = self.Primary.Spread - - local damagedice = math.Rand(.85,1.3) - - basedamage = PainMulti * self.Primary.Damage - CurrentDamage = basedamage * damagedice - CurrentRecoil = self.Primary.Recoil - - self:ShootBullet(CurrentDamage, CurrentRecoil, 31, .06) - -end - -/*--------------------------------------------------------- - Name: SWEP:Reload() - Desc: Reload is being pressed. ----------------------------------------------------------*/ -function SWEP:Reload() - - if not IsValid(self) then return end - if not IsValid(self.Owner) then return end - if not self.Owner:IsPlayer() then return end - - local maxcap = self.Primary.ClipSize - local spaceavail = self.Weapon:Clip1() - local shellz = (maxcap) - (spaceavail) + 1 - - if (timer.Exists("ShotgunReload")) or self.Owner.NextReload > CurTime() or maxcap == spaceavail then return end - - if self.Owner:IsPlayer() then - - self.Weapon:SetNextPrimaryFire(CurTime() + 1) -- wait one second before you can shoot again - self.Weapon:SendWeaponAnim(ACT_SHOTGUN_RELOAD_START) -- sending start reload anim - self.Owner:SetAnimation( PLAYER_RELOAD ) - - self.Owner.NextReload = CurTime() + 1 - - if (SERVER) then - self.Owner:SetFOV( 0, 0.15 ) - self:SetIronsights(false) - end - - if SERVER and self.Owner:Alive() then - local timerName = "ShotgunReload_" .. self.Owner:UniqueID() - timer.Create(timerName, - (self.ShellTime + .05), - shellz, - function() if not IsValid(self) then return end - if IsValid(self.Owner) and IsValid(self.Weapon) then - if self.Owner:Alive() then - self:InsertShell() - end - end end) - end - - elseif self.Owner:IsNPC() then - self.Weapon:DefaultReload(ACT_VM_RELOAD) - end - -end - -function SWEP:Think() - if not IsValid(self) then return end - if not IsValid(self.Owner) then return end - if not self.Owner:IsPlayer() then return end - if self.Owner.NextReload == nil then self.Owner.NextReload = CurTime() + 1 end - local timerName = "ShotgunReload_" .. self.Owner:UniqueID() - --if the owner presses shoot while the timer is in effect, then... - -- if (self.Owner:KeyPressed(IN_ATTACK)) and (timer.Exists(timerName)) and not (self.Owner:KeyDown(IN_SPEED)) then - -- if self:CanPrimaryAttack() then --well first, if we actually can attack, then... - -- timer.Destroy(timerName) -- kill the timer, and - -- self:PrimaryAttack()-- ATTAAAAACK! - -- end - -- end - - if self.InsertingShell == true and self.Owner:Alive() then - vm = self.Owner:GetViewModel()-- its a messy way to do it, but holy shit, it works! - vm:ResetSequence(vm:LookupSequence("after_reload")) -- Fuck you, garry, why the hell can't I reset a sequence in multiplayer? - vm:SetPlaybackRate(.01) -- or if I can, why does facepunch have to be such a shitty community, and your wiki have to be an unreadable goddamn mess? - self.InsertingShell = false -- You get paid for this, what's your excuse? - end - - self:IronSight() - -end - -function SWEP:InsertShell() - - if not IsValid(self) then return end - if not IsValid(self.Owner) then return end - if not self.Owner:IsPlayer() then return end - - local timerName = "ShotgunReload_" .. self.Owner:UniqueID() - if self.Owner:Alive() then - local curwep = self.Owner:GetActiveWeapon() - if curwep:GetClass() != self.Gun then - timer.Destroy(timerName) - return end - - if (self.Weapon:Clip1() >= self.Primary.ClipSize or self.Owner:GetAmmoCount(self.Primary.Ammo) <= 0) then - -- if clip is full or ammo is out, then... - self.Weapon:SendWeaponAnim(ACT_SHOTGUN_RELOAD_FINISH) -- send the pump anim - timer.Destroy(timerName) -- kill the timer - self.Weapon:SetNextPrimaryFire(CurTime()+.55) - self.Weapon:SetNextSecondaryFire(CurTime()+.55) - elseif (self.Weapon:Clip1() <= self.Primary.ClipSize and self.Owner:GetAmmoCount(self.Primary.Ammo) >= 0) then - self.InsertingShell = true --well, I tried! - timer.Simple( .05, function() self:ShellAnimCaller() end) - self.Owner:RemoveAmmo(1, self.Primary.Ammo, false) -- out of the frying pan - self.Weapon:SetClip1(self.Weapon:Clip1() + 1) -- into the fire - end - else - timer.Destroy(timerName) -- kill the timer - end - -end - -if GetConVar("M9KDefaultClip") == nil then - print("M9KDefaultClip is missing! You may have hit the lua limit!") -else - if GetConVar("M9KDefaultClip"):GetInt() != -1 then - SWEP.Primary.DefaultClip = SWEP.Primary.ClipSize * GetConVar("M9KDefaultClip"):GetInt() - end -end - -if GetConVar("M9KUniqueSlots") != nil then - if not (GetConVar("M9KUniqueSlots"):GetBool()) then - SWEP.SlotPos = 2 - end -end \ No newline at end of file +-- Variables that are used on both client and server +SWEP.Gun = ("m9k_dbarrel") -- must be the name of your swep but NO CAPITALS! +if (GetConVar(SWEP.Gun.."_allowed")) != nil then + if not (GetConVar(SWEP.Gun.."_allowed"):GetBool()) then SWEP.Base = "bobs_blacklisted" SWEP.PrintName = SWEP.Gun return end +end +SWEP.Category = "M9K Shotguns" +SWEP.Author = "" +SWEP.Contact = "" +SWEP.Purpose = "" +SWEP.Instructions = "" +SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models +SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models +SWEP.PrintName = "Double Barrel Shotgun" -- Weapon name (Shown on HUD) +SWEP.Slot = 2 -- Slot in the weapon selection menu +SWEP.SlotPos = 21 -- Position in the slot +SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter +SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box +SWEP.BounceWeaponIcon = false -- Should the weapon icon bounce? +SWEP.DrawCrosshair = true -- set false if you want no crosshair +SWEP.Weight = 30 -- rank relative ot other weapons. bigger is better +SWEP.AutoSwitchTo = true -- Auto switch to if we pick it up +SWEP.AutoSwitchFrom = true -- Auto switch from if you pick up a better weapon +SWEP.HoldType = "shotgun" -- how others view you carrying the weapon +-- normal melee melee2 fist knife smg ar2 pistol rpg physgun grenade shotgun crossbow slam passive +-- you're mostly going to use ar2, smg, shotgun or pistol. rpg and crossbow make for good sniper rifles + +SWEP.ViewModelFOV = 70 +SWEP.ViewModelFlip = false +SWEP.ViewModel = "models/weapons/v_doublebarrl.mdl" -- Weapon view model +SWEP.WorldModel = "models/weapons/w_double_barrel_shotgun.mdl" -- Weapon world model +SWEP.Base = "bobs_shotty_base" +SWEP.Spawnable = true +SWEP.AdminSpawnable = true + +SWEP.Primary.Sound = Sound("Double_Barrel.Single") -- script that calls the primary fire sound +SWEP.Primary.RPM = 180 -- This is in Rounds Per Minute +SWEP.Primary.ClipSize = 2 -- Size of a clip +SWEP.Primary.DefaultClip = 30 -- Default number of bullets in a clip +SWEP.Primary.KickUp = 10 -- Maximum up recoil (rise) +SWEP.Primary.KickDown = 5 -- Maximum down recoil (skeet) +SWEP.Primary.KickHorizontal = 5 -- Maximum up recoil (stock) +SWEP.Primary.Automatic = false -- Automatic/Semi Auto +SWEP.Primary.Ammo = "buckshot" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun +-- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets + +SWEP.Secondary.IronFOV = 0 -- How much you 'zoom' in. Less is more! + +SWEP.data = {} --The starting firemode +SWEP.data.ironsights = 1 + +SWEP.ShellTime = 1 + +SWEP.Primary.NumShots = 18 -- How many bullets to shoot per trigger pull, AKA pellets +SWEP.Primary.Damage = 10 -- Base damage per bullet +SWEP.Primary.Spread = .03 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = .03 -- Ironsight accuracy, should be the same for shotguns +-- Because irons don't magically give you less pellet spread! + +-- Enter iron sight info and bone mod info below +SWEP.IronSightsPos = Vector(0, 0, 0) +SWEP.IronSightsAng = Vector(0, 0, 0) +SWEP.SightsPos = Vector(0, 0, 0) +SWEP.SightsAng = Vector(0, 0, 0) +SWEP.RunSightsPos = Vector(11.475, -7.705, -2.787) +SWEP.RunSightsAng = Vector(0.574, 51.638, 5.737) + +SWEP.Secondary.Sound = Sound("dbarrel_dblast") + +local PainMulti = 1 + +if GetConVar("M9KDamageMultiplier") == nil then + PainMulti = 1 + print("M9KDamageMultiplier is missing! You may have hit the lua limit! Reverting multiplier to 1.") +else + PainMulti = GetConVar("M9KDamageMultiplier"):GetFloat() + if PainMulti < 0 then + PainMulti = PainMulti * -1 + print("Your damage multiplier was in the negatives. It has been reverted to a positive number. Your damage multiplier is now "..PainMulti) + end +end + +function NewM9KDamageMultiplierDB(cvar, previous, new) + print("multiplier has been changed ") + if GetConVar("M9KDamageMultiplier") == nil then + PainMulti = 1 + print("M9KDamageMultiplier is missing! You may have hit the lua limit! Reverting multiplier to 1, you will notice no changes.") + else + PainMulti = GetConVar("M9KDamageMultiplier"):GetFloat() + if PainMulti < 0 then + PainMulti = PainMulti * -1 + end + end +end +cvars.AddChangeCallback("M9KDamageMultiplier", NewM9KDamageMultiplierDB) + +function SWEP:SecondaryAttack() + return false +end + +function SWEP:PrimaryAttack() + local timerName = "ShotgunReload_" .. self.Owner:UniqueID() + if (timer.Exists(timerName)) then return end + if self:CanPrimaryAttack() and self.Owner:IsPlayer() then + if !self.Owner:KeyDown(IN_RELOAD) then + self:ShootBulletInformation() + self.Weapon:TakePrimaryAmmo(1) + + if self.Silenced then + self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK_SILENCED ) + self.Weapon:EmitSound(self.Primary.SilencedSound) + else + self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK ) + self.Weapon:EmitSound(self.Primary.Sound) + end + + local fx = EffectData() + fx:SetEntity(self.Weapon) + fx:SetOrigin(self.Owner:GetShootPos()) + fx:SetNormal(self.Owner:GetAimVector()) + fx:SetAttachment(self.MuzzleAttachment) + if GetConVar("M9KGasEffect") != nil then + if GetConVar("M9KGasEffect"):GetBool() then + util.Effect("m9k_rg_muzzle_rifle",fx) + end + end + self.Owner:SetAnimation( PLAYER_ATTACK1 ) + self.Owner:MuzzleFlash() + self.Weapon:SetNextPrimaryFire(CurTime()+1/(self.Primary.RPM/60)) + self:CheckWeaponsAndAmmo() + self.RicochetCoin = (math.random(1,4)) + if self.BoltAction then self:BoltBack() end + end + elseif self:CanPrimaryAttack() and self.Owner:IsNPC() then + self:ShootBulletInformation() + self.Weapon:TakePrimaryAmmo(1) + self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK ) + self.Weapon:EmitSound(self.Primary.Sound) + self.Owner:SetAnimation( PLAYER_ATTACK1 ) + self.Owner:MuzzleFlash() + self.Weapon:SetNextPrimaryFire(CurTime()+1/(self.Primary.RPM/60)) + self.RicochetCoin = (math.random(1,4)) + end +end + + +function SWEP:ShootBulletInformation2() + + local CurrentDamage + local CurrentRecoil + local CurrentCone + local basedamage + + CurrentCone = self.Primary.Spread + + local damagedice = 1 + + basedamage = PainMulti * self.Primary.Damage + CurrentDamage = basedamage * damagedice + CurrentRecoil = self.Primary.Recoil + + self:ShootBullet(CurrentDamage, CurrentRecoil, 31, .06) + +end + +/*--------------------------------------------------------- + Name: SWEP:Reload() + Desc: Reload is being pressed. +---------------------------------------------------------*/ +function SWEP:Reload() + + if not IsValid(self) then return end + if not IsValid(self.Owner) then return end + if not self.Owner:IsPlayer() then return end + + local maxcap = self.Primary.ClipSize + local spaceavail = self.Weapon:Clip1() + local shellz = (maxcap) - (spaceavail) + 1 + + if (timer.Exists("ShotgunReload")) or self.Owner.NextReload > CurTime() or maxcap == spaceavail then return end + + if self.Owner:IsPlayer() then + + self.Weapon:SetNextPrimaryFire(CurTime() + 1) -- wait one second before you can shoot again + self.Weapon:SendWeaponAnim(ACT_SHOTGUN_RELOAD_START) -- sending start reload anim + self.Owner:SetAnimation( PLAYER_RELOAD ) + + self.Owner.NextReload = CurTime() + 1 + + if (SERVER) then + self.Owner:SetFOV( 0, 0.15 ) + self:SetIronsights(false) + end + + if SERVER and self.Owner:Alive() then + local timerName = "ShotgunReload_" .. self.Owner:UniqueID() + timer.Create(timerName, + (self.ShellTime + .05), + shellz, + function() if not IsValid(self) then return end + if IsValid(self.Owner) and IsValid(self.Weapon) then + if self.Owner:Alive() then + self:InsertShell() + end + end end) + end + + elseif self.Owner:IsNPC() then + self.Weapon:DefaultReload(ACT_VM_RELOAD) + end + +end + +function SWEP:Think() + if not IsValid(self) then return end + if not IsValid(self.Owner) then return end + if not self.Owner:IsPlayer() then return end + if self.Owner.NextReload == nil then self.Owner.NextReload = CurTime() + 1 end + local timerName = "ShotgunReload_" .. self.Owner:UniqueID() + --if the owner presses shoot while the timer is in effect, then... + -- if (self.Owner:KeyPressed(IN_ATTACK)) and (timer.Exists(timerName)) and not (self.Owner:KeyDown(IN_SPEED)) then + -- if self:CanPrimaryAttack() then --well first, if we actually can attack, then... + -- timer.Destroy(timerName) -- kill the timer, and + -- self:PrimaryAttack()-- ATTAAAAACK! + -- end + -- end + + if self.InsertingShell == true and self.Owner:Alive() then + vm = self.Owner:GetViewModel()-- its a messy way to do it, but holy shit, it works! + vm:ResetSequence(vm:LookupSequence("after_reload")) -- Fuck you, garry, why the hell can't I reset a sequence in multiplayer? + vm:SetPlaybackRate(.01) -- or if I can, why does facepunch have to be such a shitty community, and your wiki have to be an unreadable goddamn mess? + self.InsertingShell = false -- You get paid for this, what's your excuse? + end + + self:IronSight() + +end + +function SWEP:InsertShell() + + if not IsValid(self) then return end + if not IsValid(self.Owner) then return end + if not self.Owner:IsPlayer() then return end + + local timerName = "ShotgunReload_" .. self.Owner:UniqueID() + if self.Owner:Alive() then + local curwep = self.Owner:GetActiveWeapon() + if curwep:GetClass() != self.Gun then + timer.Destroy(timerName) + return end + + if (self.Weapon:Clip1() >= self.Primary.ClipSize or self.Owner:GetAmmoCount(self.Primary.Ammo) <= 0) then + -- if clip is full or ammo is out, then... + self.Weapon:SendWeaponAnim(ACT_SHOTGUN_RELOAD_FINISH) -- send the pump anim + timer.Destroy(timerName) -- kill the timer + self.Weapon:SetNextPrimaryFire(CurTime()+.55) + self.Weapon:SetNextSecondaryFire(CurTime()+.55) + elseif (self.Weapon:Clip1() <= self.Primary.ClipSize and self.Owner:GetAmmoCount(self.Primary.Ammo) >= 0) then + self.InsertingShell = true --well, I tried! + timer.Simple( .05, function() self:ShellAnimCaller() end) + self.Owner:RemoveAmmo(1, self.Primary.Ammo, false) -- out of the frying pan + self.Weapon:SetClip1(self.Weapon:Clip1() + 1) -- into the fire + end + else + timer.Destroy(timerName) -- kill the timer + end + +end + +if GetConVar("M9KDefaultClip") == nil then + print("M9KDefaultClip is missing! You may have hit the lua limit!") +else + if GetConVar("M9KDefaultClip"):GetInt() != -1 then + SWEP.Primary.DefaultClip = SWEP.Primary.ClipSize * GetConVar("M9KDefaultClip"):GetInt() + end +end + +if GetConVar("M9KUniqueSlots") != nil then + if not (GetConVar("M9KUniqueSlots"):GetBool()) then + SWEP.SlotPos = 2 + end +end +function SWEP:ShootBullet( DirX, DirY, DirZ ) + + local bullet = {} + bullet.Num = 1 + bullet.Src = self.Owner:GetShootPos() -- Source + bullet.Dir = self.Owner:GetAimVector() + (self.Owner:GetAimVector():Angle():Right()*DirX) + (self.Owner:GetAimVector():Angle():Up()*DirY) -- Dir of bullet + bullet.Spread = Vector(0,0,0) -- Aim Cone + bullet.Tracer = 1 -- Show a tracer on every x bullets + bullet.Force = 1 -- Amount of force to give to phys objects + bullet.Damage = 12 + bullet.AmmoType = self.Primary.Ammo + bullet.HullSize = 0 + + self.Owner:FireBullets( bullet ) + + self:ShootEffects() + +end + +function SWEP:PrimaryAttack() + + -- Make sure we can shoot first + if ( !self:CanPrimaryAttack() ) then return end + + -- Play shoot sound + self:EmitSound(self.Primary.Sound) + + self:ShootBullet(0,0,0) + self:ShootBullet(0,0,0) + self:ShootBullet(0.015,0,0) + self:ShootBullet(-0.015,0,0) + self:ShootBullet(0,0.015,0) + self:ShootBullet(0,-0.015,0) + self:ShootBullet(0.015,0.015,0) + self:ShootBullet(-0.015,0.015,0) + self:ShootBullet(-0.015,-0.015,0) + self:ShootBullet(0.015,-0.015,0) + + -- Remove 1 bullet from our clip + self:TakePrimaryAmmo( 1 ) + + + self.Weapon:SetNextPrimaryFire(CurTime()+1/(self.Primary.RPM/60)) +end +SWEP.Primary.KickUp = 0 +SWEP.Primary.Recoil = 0 \ No newline at end of file diff --git a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_dragunov/shared.lua b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_dragunov/shared.lua index c1e92fb..6d7e58a 100644 --- a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_dragunov/shared.lua +++ b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_dragunov/shared.lua @@ -42,7 +42,7 @@ SWEP.Primary.KickUp = 1 -- Maximum up recoil (rise) SWEP.Primary.KickDown = .6 -- Maximum down recoil (skeet) SWEP.Primary.KickHorizontal = .5 -- Maximum up recoil (stock) SWEP.Primary.Automatic = false -- Automatic/Semi Auto -SWEP.Primary.Ammo = "SniperPenetratedRound" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun +SWEP.Primary.Ammo = "ar2" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun -- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets SWEP.Secondary.ScopeZoom = 9 @@ -61,9 +61,9 @@ SWEP.ScopeScale = 0.7 SWEP.ReticleScale = 0.6 SWEP.Primary.NumShots = 1 --how many bullets to shoot per trigger pull -SWEP.Primary.Damage = 90 --base damage per bullet -SWEP.Primary.Spread = .01 --define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .00012 -- ironsight accuracy, should be the same for shotguns +SWEP.Primary.Damage = 50 --base damage per bullet +SWEP.Primary.Spread = 10 --define from-the-hip accuracy 1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = 0 -- ironsight accuracy, should be the same for shotguns -- enter iron sight info and bone mod info below @@ -86,4 +86,6 @@ if GetConVar("M9KUniqueSlots") != nil then if not (GetConVar("M9KUniqueSlots"):GetBool()) then SWEP.SlotPos = 2 end -end \ No newline at end of file +end +SWEP.Primary.KickUp = 5 +SWEP.Primary.Recoil = 0 \ No newline at end of file diff --git a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_fg42/shared.lua b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_fg42/shared.lua index ceed19f..2ee9228 100644 --- a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_fg42/shared.lua +++ b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_fg42/shared.lua @@ -3,7 +3,7 @@ SWEP.Gun = ("m9k_fg42") -- must be the name of your swep but NO CAPITALS! if (GetConVar(SWEP.Gun.."_allowed")) != nil then if not (GetConVar(SWEP.Gun.."_allowed"):GetBool()) then SWEP.Base = "bobs_blacklisted" SWEP.PrintName = SWEP.Gun return end end -SWEP.Category = "M9K Machine Guns" +SWEP.Category = "M9K Assault Rifles" SWEP.Author = "" SWEP.Contact = "" SWEP.Purpose = "" @@ -11,7 +11,7 @@ SWEP.Instructions = "" SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models SWEP.PrintName = "FG 42" -- Weapon name (Shown on HUD) -SWEP.Slot = 3 -- Slot in the weapon selection menu +SWEP.Slot = 1 -- Slot in the weapon selection menu SWEP.SlotPos = 33 -- Position in the slot SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box @@ -34,12 +34,12 @@ SWEP.AdminSpawnable = true SWEP.FiresUnderwater = false SWEP.Primary.Sound = Sound("FG42_weapon.Single") -- Script that calls the primary fire sound -SWEP.Primary.RPM = 900 -- This is in Rounds Per Minute -SWEP.Primary.ClipSize = 20 -- Size of a clip +SWEP.Primary.RPM = 1000 -- This is in Rounds Per Minute +SWEP.Primary.ClipSize = 30 -- Size of a clip SWEP.Primary.DefaultClip = 60 -- Bullets you start with -SWEP.Primary.KickUp = 0.3 -- Maximum up recoil (rise) -SWEP.Primary.KickDown = 0.3 -- Maximum down recoil (skeet) -SWEP.Primary.KickHorizontal = 0.3 -- Maximum up recoil (stock) +SWEP.Primary.KickUp = 0.5 -- Maximum up recoil (rise) +SWEP.Primary.KickDown = 0.5 -- Maximum down recoil (skeet) +SWEP.Primary.KickHorizontal = 0.5 -- Maximum up recoil (stock) SWEP.Primary.Automatic = true -- Automatic = true; Semi Auto = false SWEP.Primary.Ammo = "ar2" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun @@ -51,9 +51,9 @@ SWEP.data = {} --The starting firemode SWEP.data.ironsights = 1 SWEP.Primary.NumShots = 1 -- How many bullets to shoot per trigger pull -SWEP.Primary.Damage = 38 -- Base damage per bullet -SWEP.Primary.Spread = .02 -- Define from-the-hip accuracy (1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .01 -- Ironsight accuracy, should be the same for shotguns +SWEP.Primary.Damage = 25 -- Base damage per bullet +SWEP.Primary.Spread = 0 -- Define from-the-hip accuracy (1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = 0 -- Ironsight accuracy, should be the same for shotguns -- Enter iron sight info and bone mod info below SWEP.IronSightsPos = Vector(3.47, -6.078, 1.93) @@ -75,4 +75,6 @@ if GetConVar("M9KUniqueSlots") != nil then if not (GetConVar("M9KUniqueSlots"):GetBool()) then SWEP.SlotPos = 2 end -end \ No newline at end of file +end +SWEP.Primary.KickUp = 0.5 +SWEP.Primary.Recoil = 0.3 \ No newline at end of file diff --git a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_intervention/shared.lua b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_intervention/shared.lua index 0999250..461a6cc 100644 --- a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_intervention/shared.lua +++ b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_intervention/shared.lua @@ -1,88 +1,90 @@ --- Variables that are used on both client and server -SWEP.Gun = ("m9k_intervention") -- must be the name of your swep but NO CAPITALS! -if (GetConVar(SWEP.Gun.."_allowed")) != nil then - if not (GetConVar(SWEP.Gun.."_allowed"):GetBool()) then SWEP.Base = "bobs_blacklisted" SWEP.PrintName = SWEP.Gun return end -end -SWEP.Category = "M9K Sniper Rifles" -SWEP.Author = "iron angles and models hexed and converted to gmod my Mr Fokkusu" -SWEP.Contact = "" -SWEP.Purpose = "" -SWEP.Instructions = "" -SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models -SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models -SWEP.PrintName = "Intervention" -- Weapon name (Shown on HUD) -SWEP.Slot = 3 -- Slot in the weapon selection menu -SWEP.SlotPos = 42 -- Position in the slot -SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter -SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box -SWEP.BounceWeaponIcon = false -- Should the weapon icon bounce? -SWEP.DrawCrosshair = false -- Set false if you want no crosshair from hip -SWEP.XHair = false -- Used for returning crosshair after scope. Must be the same as DrawCrosshair -SWEP.Weight = 50 -- Rank relative ot other weapons. bigger is better -SWEP.AutoSwitchTo = true -- Auto switch to if we pick it up -SWEP.AutoSwitchFrom = true -- Auto switch from if you pick up a better weapon -SWEP.BoltAction = true -- Is this a bolt action rifle? -SWEP.HoldType = "rpg" -- how others view you carrying the weapon --- normal melee melee2 fist knife smg ar2 pistol rpg physgun grenade shotgun crossbow slam passive --- you're mostly going to use ar2, smg, shotgun or pistol. rpg and crossbow make for good sniper rifles - -SWEP.ViewModelFOV = 70 -SWEP.ViewModelFlip = true -SWEP.ViewModel = "models/weapons/v_snip_int.mdl" -- Weapon view model -SWEP.WorldModel = "models/weapons/w_snip_int.mdl" -- Weapon world model -SWEP.Base = "bobs_scoped_base" -SWEP.Spawnable = true -SWEP.AdminSpawnable = true - -SWEP.Primary.Sound = Sound("Weapon_INT.Single") -- script that calls the primary fire sound -SWEP.Primary.RPM = 35 -- This is in Rounds Per Minute -SWEP.Primary.ClipSize = 5 -- Size of a clip -SWEP.Primary.DefaultClip = 60 -- Bullets you start with -SWEP.Primary.KickUp = 1 -- Maximum up recoil (rise) -SWEP.Primary.KickDown = .6 -- Maximum down recoil (skeet) -SWEP.Primary.KickHorizontal = .4 -- Maximum up recoil (stock) -SWEP.Primary.Automatic = false -- Automatic/Semi Auto -SWEP.Primary.Ammo = "SniperPenetratedRound" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun --- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets - -SWEP.Secondary.ScopeZoom = 10 -SWEP.Secondary.UseACOG = false -- Choose one scope type -SWEP.Secondary.UseMilDot = true -- I mean it, only one -SWEP.Secondary.UseSVD = false -- If you choose more than one, your scope will not show up at all -SWEP.Secondary.UseParabolic = false -SWEP.Secondary.UseElcan = false -SWEP.Secondary.UseGreenDuplex = false -SWEP.Secondary.UseAimpoint = false -SWEP.Secondary.UseMatador = false - -SWEP.data = {} -SWEP.data.ironsights = 1 -SWEP.ScopeScale = 0.7 - -SWEP.Primary.NumShots = 1 --how many bullets to shoot per trigger pull -SWEP.Primary.Damage = 95 --base damage per bullet -SWEP.Primary.Spread = .01 --define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .0001 -- ironsight accuracy, should be the same for shotguns - --- enter iron sight info and bone mod info below - -SWEP.IronSightsPos = Vector (2.2263, -0.0007, 0.115) -SWEP.IronSightsAng = Vector (0, 0, 0) -SWEP.SightsPos = Vector (2.2263, -0.0007, 0.115) -SWEP.SightsAng = Vector (0, 0, 0) -SWEP.RunSightsPos = Vector (-2.3095, -3.0514, 1.3965) -SWEP.RunSightsAng = Vector (-19.8471, -33.9181, 10) - -if GetConVar("M9KDefaultClip") == nil then - print("M9KDefaultClip is missing! You may have hit the lua limit!") -else - if GetConVar("M9KDefaultClip"):GetInt() != -1 then - SWEP.Primary.DefaultClip = SWEP.Primary.ClipSize * GetConVar("M9KDefaultClip"):GetInt() - end -end - -if GetConVar("M9KUniqueSlots") != nil then - if not (GetConVar("M9KUniqueSlots"):GetBool()) then - SWEP.SlotPos = 2 - end -end \ No newline at end of file +-- Variables that are used on both client and server +SWEP.Gun = ("m9k_intervention") -- must be the name of your swep but NO CAPITALS! +if (GetConVar(SWEP.Gun.."_allowed")) != nil then + if not (GetConVar(SWEP.Gun.."_allowed"):GetBool()) then SWEP.Base = "bobs_blacklisted" SWEP.PrintName = SWEP.Gun return end +end +SWEP.Category = "M9K Sniper Rifles" +SWEP.Author = "iron angles and models hexed and converted to gmod my Mr Fokkusu" +SWEP.Contact = "" +SWEP.Purpose = "" +SWEP.Instructions = "" +SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models +SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models +SWEP.PrintName = "Intervention" -- Weapon name (Shown on HUD) +SWEP.Slot = 4 -- Slot in the weapon selection menu +SWEP.SlotPos = 42 -- Position in the slot +SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter +SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box +SWEP.BounceWeaponIcon = false -- Should the weapon icon bounce? +SWEP.DrawCrosshair = false -- Set false if you want no crosshair from hip +SWEP.XHair = false -- Used for returning crosshair after scope. Must be the same as DrawCrosshair +SWEP.Weight = 50 -- Rank relative ot other weapons. bigger is better +SWEP.AutoSwitchTo = true -- Auto switch to if we pick it up +SWEP.AutoSwitchFrom = true -- Auto switch from if you pick up a better weapon +SWEP.BoltAction = true -- Is this a bolt action rifle? +SWEP.HoldType = "rpg" -- how others view you carrying the weapon +-- normal melee melee2 fist knife smg ar2 pistol rpg physgun grenade shotgun crossbow slam passive +-- you're mostly going to use ar2, smg, shotgun or pistol. rpg and crossbow make for good sniper rifles + +SWEP.ViewModelFOV = 70 +SWEP.ViewModelFlip = true +SWEP.ViewModel = "models/weapons/v_snip_int.mdl" -- Weapon view model +SWEP.WorldModel = "models/weapons/w_snip_int.mdl" -- Weapon world model +SWEP.Base = "bobs_scoped_base" +SWEP.Spawnable = true +SWEP.AdminSpawnable = true + +SWEP.Primary.Sound = Sound("Weapon_INT.Single") -- script that calls the primary fire sound +SWEP.Primary.RPM = 45 -- This is in Rounds Per Minute +SWEP.Primary.ClipSize = 5 -- Size of a clip +SWEP.Primary.DefaultClip = 60 -- Bullets you start with +SWEP.Primary.KickUp = 10 -- Maximum up recoil (rise) +SWEP.Primary.KickDown = .6 -- Maximum down recoil (skeet) +SWEP.Primary.KickHorizontal = 10 -- Maximum up recoil (stock) +SWEP.Primary.Automatic = false -- Automatic/Semi Auto +SWEP.Primary.Ammo = "SniperPenetratedRound" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun +-- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets + +SWEP.Secondary.ScopeZoom = 10 +SWEP.Secondary.UseACOG = false -- Choose one scope type +SWEP.Secondary.UseMilDot = true -- I mean it, only one +SWEP.Secondary.UseSVD = false -- If you choose more than one, your scope will not show up at all +SWEP.Secondary.UseParabolic = false +SWEP.Secondary.UseElcan = false +SWEP.Secondary.UseGreenDuplex = false +SWEP.Secondary.UseAimpoint = false +SWEP.Secondary.UseMatador = false + +SWEP.data = {} +SWEP.data.ironsights = 1 +SWEP.ScopeScale = 0.7 + +SWEP.Primary.NumShots = 1 --how many bullets to shoot per trigger pull +SWEP.Primary.Damage = 100 --base damage per bullet +SWEP.Primary.Spread = 0.5 --define from-the-hip accuracy 1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = 0 -- ironsight accuracy, should be the same for shotguns + +-- enter iron sight info and bone mod info below + +SWEP.IronSightsPos = Vector (2.2263, -0.0007, 0.115) +SWEP.IronSightsAng = Vector (0, 0, 0) +SWEP.SightsPos = Vector (2.2263, -0.0007, 0.115) +SWEP.SightsAng = Vector (0, 0, 0) +SWEP.RunSightsPos = Vector (-2.3095, -3.0514, 1.3965) +SWEP.RunSightsAng = Vector (-19.8471, -33.9181, 10) + +if GetConVar("M9KDefaultClip") == nil then + print("M9KDefaultClip is missing! You may have hit the lua limit!") +else + if GetConVar("M9KDefaultClip"):GetInt() != -1 then + SWEP.Primary.DefaultClip = SWEP.Primary.ClipSize * GetConVar("M9KDefaultClip"):GetInt() + end +end + +if GetConVar("M9KUniqueSlots") != nil then + if not (GetConVar("M9KUniqueSlots"):GetBool()) then + SWEP.SlotPos = 2 + end +end +SWEP.Primary.KickUp = 5 +SWEP.Primary.Recoil = 0 \ No newline at end of file diff --git a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_ithacam37/shared.lua b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_ithacam37/shared.lua index 2ab96fe..594314a 100644 --- a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_ithacam37/shared.lua +++ b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_ithacam37/shared.lua @@ -1,79 +1,99 @@ --- Variables that are used on both client and server -SWEP.Gun = ("m9k_ithacam37") -- must be the name of your swep but NO CAPITALS! -if (GetConVar(SWEP.Gun.."_allowed")) != nil then - if not (GetConVar(SWEP.Gun.."_allowed"):GetBool()) then SWEP.Base = "bobs_blacklisted" SWEP.PrintName = SWEP.Gun return end -end -SWEP.Category = "M9K Shotguns" -SWEP.Author = "" -SWEP.Contact = "" -SWEP.Purpose = "" -SWEP.Instructions = "" -SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models -SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models -SWEP.PrintName = "Ithaca M37" -- Weapon name (Shown on HUD) -SWEP.Slot = 3 -- Slot in the weapon selection menu -SWEP.SlotPos = 22 -- Position in the slot -SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter -SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box -SWEP.BounceWeaponIcon = false -- Should the weapon icon bounce? -SWEP.DrawCrosshair = true -- set false if you want no crosshair -SWEP.Weight = 30 -- rank relative ot other weapons. bigger is better -SWEP.AutoSwitchTo = true -- Auto switch to if we pick it up -SWEP.AutoSwitchFrom = true -- Auto switch from if you pick up a better weapon -SWEP.HoldType = "shotgun" -- how others view you carrying the weapon --- normal melee melee2 fist knife smg ar2 pistol rpg physgun grenade shotgun crossbow slam passive --- you're mostly going to use ar2, smg, shotgun or pistol. rpg and crossbow make for good sniper rifles - -SWEP.ViewModelFOV = 70 -SWEP.ViewModelFlip = true -SWEP.ViewModel = "models/weapons/v_ithaca_m37shot.mdl" -- Weapon view model -SWEP.WorldModel = "models/weapons/w_ithaca_m37.mdl" -- Weapon world model -SWEP.Base = "bobs_shotty_base" -SWEP.Spawnable = true -SWEP.AdminSpawnable = true - -SWEP.Primary.Sound = Sound("IthacaM37.Single") -- script that calls the primary fire sound -SWEP.Primary.RPM = 60 -- This is in Rounds Per Minute -SWEP.Primary.ClipSize = 6 -- Size of a clip -SWEP.Primary.DefaultClip = 30 -- Default number of bullets in a clip -SWEP.Primary.KickUp = .9 -- Maximum up recoil (rise) -SWEP.Primary.KickDown = 0.6 -- Maximum down recoil (skeet) -SWEP.Primary.KickHorizontal = 0.6 -- Maximum up recoil (stock) -SWEP.Primary.Automatic = false -- Automatic/Semi Auto -SWEP.Primary.Ammo = "buckshot" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun --- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets - -SWEP.Secondary.IronFOV = 60 -- How much you 'zoom' in. Less is more! -SWEP.ShellTime = .4 - -SWEP.data = {} --The starting firemode -SWEP.data.ironsights = 1 - -SWEP.Primary.NumShots = 8 -- How many bullets to shoot per trigger pull, AKA pellets -SWEP.Primary.Damage = 12 -- Base damage per bullet -SWEP.Primary.Spread = .023 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .023 -- Ironsight accuracy, should be the same for shotguns --- Because irons don't magically give you less pellet spread! - --- Enter iron sight info and bone mod info below -SWEP.IronSightsPos = Vector(2.16, -1.429, 0.6) -SWEP.IronSightsAng = Vector(3, 0, 0) -SWEP.SightsPos = Vector(2.16, -1.429, 0.6) -SWEP.SightsAng = Vector(3, 0, 0) -SWEP.RunSightsPos = Vector(-3.116, -3.935, 0.492) -SWEP.RunSightsAng = Vector(-19.894, -47.624, 10.902) - - -if GetConVar("M9KDefaultClip") == nil then - print("M9KDefaultClip is missing! You may have hit the lua limit!") -else - if GetConVar("M9KDefaultClip"):GetInt() != -1 then - SWEP.Primary.DefaultClip = SWEP.Primary.ClipSize * GetConVar("M9KDefaultClip"):GetInt() - end -end - -if GetConVar("M9KUniqueSlots") != nil then - if not (GetConVar("M9KUniqueSlots"):GetBool()) then - SWEP.SlotPos = 2 - end -end \ No newline at end of file +-- Variables that are used on both client and server +SWEP.Gun = ("m9k_ithacam37") -- must be the name of your swep but NO CAPITALS! +if (GetConVar(SWEP.Gun.."_allowed")) != nil then + if not (GetConVar(SWEP.Gun.."_allowed"):GetBool()) then SWEP.Base = "bobs_blacklisted" SWEP.PrintName = SWEP.Gun return end +end +SWEP.Category = "M9K Shotguns" +SWEP.Author = "" +SWEP.Contact = "" +SWEP.Purpose = "" +SWEP.Instructions = "" +SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models +SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models +SWEP.PrintName = "Ithaca M37" -- Weapon name (Shown on HUD) +SWEP.Slot = 2 -- Slot in the weapon selection menu +SWEP.SlotPos = 22 -- Position in the slot +SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter +SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box +SWEP.BounceWeaponIcon = false -- Should the weapon icon bounce? +SWEP.DrawCrosshair = true -- set false if you want no crosshair +SWEP.Weight = 30 -- rank relative ot other weapons. bigger is better +SWEP.AutoSwitchTo = true -- Auto switch to if we pick it up +SWEP.AutoSwitchFrom = true -- Auto switch from if you pick up a better weapon +SWEP.HoldType = "shotgun" -- how others view you carrying the weapon +-- normal melee melee2 fist knife smg ar2 pistol rpg physgun grenade shotgun crossbow slam passive +-- you're mostly going to use ar2, smg, shotgun or pistol. rpg and crossbow make for good sniper rifles + +SWEP.ViewModelFOV = 70 +SWEP.ViewModelFlip = true +SWEP.ViewModel = "models/weapons/v_ithaca_m37shot.mdl" -- Weapon view model +SWEP.WorldModel = "models/weapons/w_ithaca_m37.mdl" -- Weapon world model +SWEP.Base = "bobs_shotty_base" +SWEP.Spawnable = true +SWEP.AdminSpawnable = true + +SWEP.Primary.Sound = Sound("IthacaM37.Single") -- script that calls the primary fire sound +SWEP.Primary.RPM = 50 -- This is in Rounds Per Minute +SWEP.Primary.ClipSize = 4 -- Size of a clip +SWEP.Primary.DefaultClip = 30 -- Default number of bullets in a clip +SWEP.Primary.KickUp = .9 -- Maximum up recoil (rise) +SWEP.Primary.KickDown = 0.6 -- Maximum down recoil (skeet) +SWEP.Primary.KickHorizontal = 0.6 -- Maximum up recoil (stock) +SWEP.Primary.Automatic = false -- Automatic/Semi Auto +SWEP.Primary.Ammo = "buckshot" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun +-- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets + +SWEP.Secondary.IronFOV = 60 -- How much you 'zoom' in. Less is more! +SWEP.ShellTime = .3 + +SWEP.data = {} --The starting firemode +SWEP.data.ironsights = 1 + +SWEP.Primary.NumShots = 60 -- How many bullets to shoot per trigger pull, AKA pellets +SWEP.Primary.Damage = 2 -- Base damage per bullet +SWEP.Primary.Spread = .06 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = .06 -- Ironsight accuracy, should be the same for shotguns +-- Because irons don't magically give you less pellet spread! + +-- Enter iron sight info and bone mod info below +SWEP.IronSightsPos = Vector(2.16, -1.429, 0.6) +SWEP.IronSightsAng = Vector(3, 0, 0) +SWEP.SightsPos = Vector(2.16, -1.429, 0.6) +SWEP.SightsAng = Vector(3, 0, 0) +SWEP.RunSightsPos = Vector(-3.116, -3.935, 0.492) +SWEP.RunSightsAng = Vector(-19.894, -47.624, 10.902) + + +if GetConVar("M9KDefaultClip") == nil then + print("M9KDefaultClip is missing! You may have hit the lua limit!") +else + if GetConVar("M9KDefaultClip"):GetInt() != -1 then + SWEP.Primary.DefaultClip = SWEP.Primary.ClipSize * GetConVar("M9KDefaultClip"):GetInt() + end +end + +if GetConVar("M9KUniqueSlots") != nil then + if not (GetConVar("M9KUniqueSlots"):GetBool()) then + SWEP.SlotPos = 2 + end +end +function SWEP:ShootBullet( DirX, DirY, DirZ ) + + local bullet = {} + bullet.Num = 1 + bullet.Src = self.Owner:GetShootPos() -- Source + bullet.Dir = self.Owner:GetAimVector() + (self.Owner:GetAimVector():Angle():Right()*DirX) + (self.Owner:GetAimVector():Angle():Up()*DirY) -- Dir of bullet + bullet.Spread = Vector(0,0,0) -- Aim Cone + bullet.Tracer = 1 -- Show a tracer on every x bullets + bullet.Force = 1 -- Amount of force to give to phys objects + bullet.Damage = 9 + bullet.AmmoType = self.Primary.Ammo + bullet.HullSize = 0 + + self.Owner:FireBullets( bullet ) + + self:ShootEffects() + +end +SWEP.Primary.KickUp = 0 +SWEP.Primary.Recoil = 0 \ No newline at end of file diff --git a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_jackhammer/shared.lua b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_jackhammer/shared.lua index 7243cce..3d627fa 100644 --- a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_jackhammer/shared.lua +++ b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_jackhammer/shared.lua @@ -1,77 +1,133 @@ --- Variables that are used on both client and server -SWEP.Gun = ("m9k_jackhammer") -- must be the name of your swep but NO CAPITALS! -if (GetConVar(SWEP.Gun.."_allowed")) != nil then - if not (GetConVar(SWEP.Gun.."_allowed"):GetBool()) then SWEP.Base = "bobs_blacklisted" SWEP.PrintName = SWEP.Gun return end -end -SWEP.Category = "M9K Shotguns" -SWEP.Author = "" -SWEP.Contact = "" -SWEP.Purpose = "" -SWEP.Instructions = "" -SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models -SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models -SWEP.PrintName = "Pancor Jackhammer" -- Weapon name (Shown on HUD) -SWEP.Slot = 3 -- Slot in the weapon selection menu -SWEP.SlotPos = 23 -- Position in the slot -SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter -SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box -SWEP.BounceWeaponIcon = false -- Should the weapon icon bounce? -SWEP.DrawCrosshair = true -- set false if you want no crosshair -SWEP.Weight = 30 -- rank relative ot other weapons. bigger is better -SWEP.AutoSwitchTo = true -- Auto switch to if we pick it up -SWEP.AutoSwitchFrom = true -- Auto switch from if you pick up a better weapon -SWEP.HoldType = "ar2" -- how others view you carrying the weapon --- normal melee melee2 fist knife smg ar2 pistol rpg physgun grenade shotgun crossbow slam passive --- you're mostly going to use ar2, smg, shotgun or pistol. rpg and crossbow make for good sniper rifles - -SWEP.ViewModelFOV = 70 -SWEP.ViewModelFlip = true -SWEP.ViewModel = "models/weapons/v_jackhammer2.mdl" -- Weapon view model -SWEP.WorldModel = "models/weapons/w_pancor_jackhammer.mdl" -- Weapon world model -SWEP.Base = "bobs_gun_base" -SWEP.Spawnable = true -SWEP.AdminSpawnable = true -SWEP.FiresUnderwater = false - -SWEP.Primary.Sound = Sound("Weapon_Jackhammer.Single") -- Script that calls the primary fire sound -SWEP.Primary.RPM = 240 -- This is in Rounds Per Minute -SWEP.Primary.ClipSize = 10 -- Size of a clip -SWEP.Primary.DefaultClip = 30 -- Bullets you start with -SWEP.Primary.KickUp = 1 -- Maximum up recoil (rise) -SWEP.Primary.KickDown = 0.5 -- Maximum down recoil (skeet) -SWEP.Primary.KickHorizontal = 0.4 -- Maximum up recoil (stock) -SWEP.Primary.Automatic = true -- Automatic = true; Semi Auto = false -SWEP.Primary.Ammo = "buckshot" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun --- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets - -SWEP.Secondary.IronFOV = 60 -- How much you 'zoom' in. Less is more! - -SWEP.data = {} --The starting firemode -SWEP.data.ironsights = 1 - -SWEP.Primary.NumShots = 6 -- How many bullets to shoot per trigger pull -SWEP.Primary.Damage = 10 -- Base damage per bullet -SWEP.Primary.Spread = .045 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .045 -- Ironsight accuracy, should be the same for shotguns - --- Enter iron sight info and bone mod info below -SWEP.IronSightsPos = Vector(4.026, -2.296, 0.917) -SWEP.IronSightsAng = Vector(0, 0, 0) -SWEP.SightsPos = Vector(4.026, -2.296, 0.917) -SWEP.SightsAng = Vector(0, 0, 0) -SWEP.RunSightsPos = Vector(-3.116, -3.935, 0.492) -SWEP.RunSightsAng = Vector(-19.894, -47.624, 10.902) - -if GetConVar("M9KDefaultClip") == nil then - print("M9KDefaultClip is missing! You may have hit the lua limit!") -else - if GetConVar("M9KDefaultClip"):GetInt() != -1 then - SWEP.Primary.DefaultClip = SWEP.Primary.ClipSize * GetConVar("M9KDefaultClip"):GetInt() - end -end - -if GetConVar("M9KUniqueSlots") != nil then - if not (GetConVar("M9KUniqueSlots"):GetBool()) then - SWEP.SlotPos = 2 - end -end \ No newline at end of file +-- Variables that are used on both client and server +SWEP.Gun = ("m9k_jackhammer") -- must be the name of your swep but NO CAPITALS! +if (GetConVar(SWEP.Gun.."_allowed")) != nil then + if not (GetConVar(SWEP.Gun.."_allowed"):GetBool()) then SWEP.Base = "bobs_blacklisted" SWEP.PrintName = SWEP.Gun return end +end +SWEP.Category = "M9K Shotguns" +SWEP.Author = "" +SWEP.Contact = "" +SWEP.Purpose = "" +SWEP.Instructions = "" +SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models +SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models +SWEP.PrintName = "Pancor Jackhammer" -- Weapon name (Shown on HUD) +SWEP.Slot = 2 -- Slot in the weapon selection menu +SWEP.SlotPos = 23 -- Position in the slot +SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter +SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box +SWEP.BounceWeaponIcon = false -- Should the weapon icon bounce? +SWEP.DrawCrosshair = true -- set false if you want no crosshair +SWEP.Weight = 30 -- rank relative ot other weapons. bigger is better +SWEP.AutoSwitchTo = true -- Auto switch to if we pick it up +SWEP.AutoSwitchFrom = true -- Auto switch from if you pick up a better weapon +SWEP.HoldType = "ar2" -- how others view you carrying the weapon +-- normal melee melee2 fist knife smg ar2 pistol rpg physgun grenade shotgun crossbow slam passive +-- you're mostly going to use ar2, smg, shotgun or pistol. rpg and crossbow make for good sniper rifles + +SWEP.ViewModelFOV = 70 +SWEP.ViewModelFlip = true +SWEP.ViewModel = "models/weapons/v_jackhammer2.mdl" -- Weapon view model +SWEP.WorldModel = "models/weapons/w_pancor_jackhammer.mdl" -- Weapon world model +SWEP.Base = "bobs_gun_base" +SWEP.Spawnable = true +SWEP.AdminSpawnable = true +SWEP.FiresUnderwater = false + +SWEP.Primary.Sound = Sound("Weapon_Jackhammer.Single") -- Script that calls the primary fire sound +SWEP.Primary.RPM = 240 -- This is in Rounds Per Minute +SWEP.Primary.ClipSize = 10 -- Size of a clip +SWEP.Primary.DefaultClip = 30 -- Bullets you start with +SWEP.Primary.KickUp = 1 -- Maximum up recoil (rise) +SWEP.Primary.KickDown = 0.5 -- Maximum down recoil (skeet) +SWEP.Primary.KickHorizontal = 0.4 -- Maximum up recoil (stock) +SWEP.Primary.Automatic = true -- Automatic = true; Semi Auto = false +SWEP.Primary.Ammo = "buckshot" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun +-- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets + +SWEP.Secondary.IronFOV = 60 -- How much you 'zoom' in. Less is more! + +SWEP.data = {} --The starting firemode +SWEP.data.ironsights = 1 + +SWEP.Primary.NumShots = 60 -- How many bullets to shoot per trigger pull +SWEP.Primary.Damage = 1 -- Base damage per bullet +SWEP.Primary.Spread = .06 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = .06 -- Ironsight accuracy, should be the same for shotguns + +-- Enter iron sight info and bone mod info below +SWEP.IronSightsPos = Vector(4.026, -2.296, 0.917) +SWEP.IronSightsAng = Vector(0, 0, 0) +SWEP.SightsPos = Vector(4.026, -2.296, 0.917) +SWEP.SightsAng = Vector(0, 0, 0) +SWEP.RunSightsPos = Vector(-3.116, -3.935, 0.492) +SWEP.RunSightsAng = Vector(-19.894, -47.624, 10.902) + +if GetConVar("M9KDefaultClip") == nil then + print("M9KDefaultClip is missing! You may have hit the lua limit!") +else + if GetConVar("M9KDefaultClip"):GetInt() != -1 then + SWEP.Primary.DefaultClip = SWEP.Primary.ClipSize * GetConVar("M9KDefaultClip"):GetInt() + end +end + +if GetConVar("M9KUniqueSlots") != nil then + if not (GetConVar("M9KUniqueSlots"):GetBool()) then + SWEP.SlotPos = 2 + end +end +function SWEP:ShootBullet( DirX, DirY, DirZ ) + + local bullet = {} + bullet.Num = 1 + bullet.Src = self.Owner:GetShootPos() -- Source + bullet.Dir = self.Owner:GetAimVector() + (self.Owner:GetAimVector():Angle():Right()*DirX) + (self.Owner:GetAimVector():Angle():Up()*DirY) -- Dir of bullet + bullet.Spread = Vector(0,0,0) -- Aim Cone + bullet.Tracer = 1 -- Show a tracer on every x bullets + bullet.Force = 1 -- Amount of force to give to phys objects + bullet.Damage = 6 + bullet.AmmoType = self.Primary.Ammo + bullet.HullSize = 0 + + self.Owner:FireBullets( bullet ) + + self:ShootEffects() + +end + +function SWEP:PrimaryAttack() + + -- Make sure we can shoot first + if ( !self:CanPrimaryAttack() ) then return end + + -- Play shoot sound + self:EmitSound(self.Primary.Sound) + + self:ShootBullet(0,0,0) + self:ShootBullet(0,0,0) + self:ShootBullet(0.015,0,0) + self:ShootBullet(-0.015,0,0) + self:ShootBullet(0,0.015,0) + self:ShootBullet(0,-0.015,0) + self:ShootBullet(0.015,0.015,0) + self:ShootBullet(-0.015,0.015,0) + self:ShootBullet(-0.015,-0.015,0) + self:ShootBullet(0.015,-0.015,0) + + -- Remove 1 bullet from our clip + self:TakePrimaryAmmo( 1 ) + + + + if CLIENT and !game.SinglePlayer() and !self.Owner:IsNPC() then + + local anglo = Angle(-self.Primary.Recoil) + local eyes = self.Owner:EyeAngles() + eyes.pitch = eyes.pitch + (anglo.pitch/3) + eyes.yaw = eyes.yaw + (anglo.yaw/3) + self.Owner:SetEyeAngles(eyes) + end + + self.Weapon:SetNextPrimaryFire(CurTime()+1/(self.Primary.RPM/60)) +end +SWEP.Primary.KickUp = 0 +SWEP.Primary.Recoil = 0 \ No newline at end of file diff --git a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_m1918bar/shared.lua b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_m1918bar/shared.lua index 830bbfb..0901e44 100644 --- a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_m1918bar/shared.lua +++ b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_m1918bar/shared.lua @@ -3,7 +3,7 @@ SWEP.Gun = ("m9k_m1918bar") -- must be the name of your swep but NO CAPITALS! if (GetConVar(SWEP.Gun.."_allowed")) != nil then if not (GetConVar(SWEP.Gun.."_allowed"):GetBool()) then SWEP.Base = "bobs_blacklisted" SWEP.PrintName = SWEP.Gun return end end -SWEP.Category = "M9K Machine Guns" +SWEP.Category = "M9K Assault Rifles" SWEP.Author = "" SWEP.Contact = "" SWEP.Purpose = "" @@ -34,11 +34,11 @@ SWEP.AdminSpawnable = true SWEP.FiresUnderwater = false SWEP.Primary.Sound = Sound("Weapon_bar1.Single") -- Script that calls the primary fire sound -SWEP.Primary.RPM = 450 -- This is in Rounds Per Minute -SWEP.Primary.ClipSize = 20 -- Size of a clip +SWEP.Primary.RPM = 650 -- This is in Rounds Per Minute +SWEP.Primary.ClipSize = 30 -- Size of a clip SWEP.Primary.DefaultClip = 60 -- Bullets you start with -SWEP.Primary.KickUp = 0.6 -- Maximum up recoil (rise) -SWEP.Primary.KickDown = 0.4 -- Maximum down recoil (skeet) +SWEP.Primary.KickUp = 1 -- Maximum up recoil (rise) +SWEP.Primary.KickDown = 1 -- Maximum down recoil (skeet) SWEP.Primary.KickHorizontal = 0.5 -- Maximum up recoil (stock) SWEP.Primary.Automatic = true -- Automatic = true; Semi Auto = false SWEP.Primary.Ammo = "ar2" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun @@ -50,9 +50,9 @@ SWEP.data = {} --The starting firemode SWEP.data.ironsights = 1 SWEP.Primary.NumShots = 1 -- How many bullets to shoot per trigger pull -SWEP.Primary.Damage = 40 -- Base damage per bullet -SWEP.Primary.Spread = .025 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .015 -- Ironsight accuracy, should be the same for shotguns +SWEP.Primary.Damage = 30 -- Base damage per bullet +SWEP.Primary.Spread = 0 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = 0 -- Ironsight accuracy, should be the same for shotguns -- Enter iron sight info and bone mod info below SWEP.IronSightsPos = Vector(3.313, 0, 1.399) @@ -74,4 +74,6 @@ if GetConVar("M9KUniqueSlots") != nil then if not (GetConVar("M9KUniqueSlots"):GetBool()) then SWEP.SlotPos = 2 end -end \ No newline at end of file +end +SWEP.Primary.KickUp = 0.5 +SWEP.Primary.Recoil = 0.3 \ No newline at end of file diff --git a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_m24/shared.lua b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_m24/shared.lua index fcfc931..4795a16 100644 --- a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_m24/shared.lua +++ b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_m24/shared.lua @@ -1,89 +1,91 @@ --- Variables that are used on both client and server -SWEP.Gun = ("m9k_m24") -- must be the name of your swep but NO CAPITALS! -if (GetConVar(SWEP.Gun.."_allowed")) != nil then - if not (GetConVar(SWEP.Gun.."_allowed"):GetBool()) then SWEP.Base = "bobs_blacklisted" SWEP.PrintName = SWEP.Gun return end -end -SWEP.Category = "M9K Sniper Rifles" -SWEP.Author = "iron angles and models hexed and converted to gmod my Mr Fokkusu" -SWEP.Contact = "" -SWEP.Purpose = "" -SWEP.Instructions = "" -SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models -SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models -SWEP.PrintName = "M24" -- Weapon name (Shown on HUD) -SWEP.Slot = 3 -- Slot in the weapon selection menu -SWEP.SlotPos = 43 -- Position in the slot -SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter -SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box -SWEP.BounceWeaponIcon = false -- Should the weapon icon bounce? -SWEP.DrawCrosshair = false -- Set false if you want no crosshair from hip -SWEP.XHair = false -- Used for returning crosshair after scope. Must be the same as DrawCrosshair -SWEP.Weight = 50 -- Rank relative ot other weapons. bigger is better -SWEP.AutoSwitchTo = true -- Auto switch to if we pick it up -SWEP.AutoSwitchFrom = true -- Auto switch from if you pick up a better weapon -SWEP.BoltAction = true -- Is this a bolt action rifle? -SWEP.HoldType = "rpg" -- how others view you carrying the weapon --- normal melee melee2 fist knife smg ar2 pistol rpg physgun grenade shotgun crossbow slam passive --- you're mostly going to use ar2, smg, shotgun or pistol. rpg and crossbow make for good sniper rifles - -SWEP.ViewModelFOV = 70 -SWEP.ViewModelFlip = true -SWEP.ViewModel = "models/weapons/v_dmg_m24s.mdl" -- Weapon view model -SWEP.WorldModel = "models/weapons/w_snip_m24_6.mdl" -- Weapon world model -SWEP.Base = "bobs_scoped_base" -SWEP.Spawnable = true -SWEP.AdminSpawnable = true - -SWEP.Primary.Sound = Sound("Dmgfok_M24SN.Single") -- script that calls the primary fire sound -SWEP.Primary.RPM = 40 -- This is in Rounds Per Minute -SWEP.Primary.ClipSize = 5 -- Size of a clip -SWEP.Primary.DefaultClip = 60 -- Bullets you start with -SWEP.Primary.KickUp = .6 -- Maximum up recoil (rise) -SWEP.Primary.KickDown = .6 -- Maximum down recoil (skeet) -SWEP.Primary.KickHorizontal = .6 -- Maximum up recoil (stock) -SWEP.Primary.Automatic = false -- Automatic/Semi Auto -SWEP.Primary.Ammo = "SniperPenetratedRound" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun --- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets - -SWEP.Secondary.ScopeZoom = 9 -SWEP.Secondary.UseACOG = false -- Choose one scope type -SWEP.Secondary.UseMilDot = true -- I mean it, only one -SWEP.Secondary.UseSVD = false -- If you choose more than one, your scope will not show up at all -SWEP.Secondary.UseParabolic = false -SWEP.Secondary.UseElcan = false -SWEP.Secondary.UseGreenDuplex = false -SWEP.Secondary.UseAimpoint = false -SWEP.Secondary.UseMatador = false - -SWEP.data = {} -SWEP.data.ironsights = 1 -SWEP.ScopeScale = 0.7 -SWEP.ReticleScale = 0.6 - -SWEP.Primary.NumShots = 1 --how many bullets to shoot per trigger pull -SWEP.Primary.Damage = 97 --base damage per bullet -SWEP.Primary.Spread = .01 --define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .000115 -- ironsight accuracy, should be the same for shotguns - --- enter iron sight info and bone mod info below - -SWEP.IronSightsPos = Vector (2.894, 0, 1.7624) -SWEP.IronSightsAng = Vector (0, 0, 0) -SWEP.SightsPos = Vector (2.894, 0, 1.7624) -SWEP.SightsAng = Vector (0, 0, 0) -SWEP.RunSightsPos = Vector (-2.3095, -3.0514, 2.3965) -SWEP.RunSightsAng = Vector (-19.8471, -33.9181, 10) - -if GetConVar("M9KDefaultClip") == nil then - print("M9KDefaultClip is missing! You may have hit the lua limit!") -else - if GetConVar("M9KDefaultClip"):GetInt() != -1 then - SWEP.Primary.DefaultClip = SWEP.Primary.ClipSize * GetConVar("M9KDefaultClip"):GetInt() - end -end - -if GetConVar("M9KUniqueSlots") != nil then - if not (GetConVar("M9KUniqueSlots"):GetBool()) then - SWEP.SlotPos = 2 - end -end \ No newline at end of file +-- Variables that are used on both client and server +SWEP.Gun = ("m9k_m24") -- must be the name of your swep but NO CAPITALS! +if (GetConVar(SWEP.Gun.."_allowed")) != nil then + if not (GetConVar(SWEP.Gun.."_allowed"):GetBool()) then SWEP.Base = "bobs_blacklisted" SWEP.PrintName = SWEP.Gun return end +end +SWEP.Category = "M9K Sniper Rifles" +SWEP.Author = "iron angles and models hexed and converted to gmod my Mr Fokkusu" +SWEP.Contact = "" +SWEP.Purpose = "" +SWEP.Instructions = "" +SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models +SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models +SWEP.PrintName = "M24" -- Weapon name (Shown on HUD) +SWEP.Slot = 4 -- Slot in the weapon selection menu +SWEP.SlotPos = 43 -- Position in the slot +SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter +SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box +SWEP.BounceWeaponIcon = false -- Should the weapon icon bounce? +SWEP.DrawCrosshair = false -- Set false if you want no crosshair from hip +SWEP.XHair = false -- Used for returning crosshair after scope. Must be the same as DrawCrosshair +SWEP.Weight = 50 -- Rank relative ot other weapons. bigger is better +SWEP.AutoSwitchTo = true -- Auto switch to if we pick it up +SWEP.AutoSwitchFrom = true -- Auto switch from if you pick up a better weapon +SWEP.BoltAction = true -- Is this a bolt action rifle? +SWEP.HoldType = "rpg" -- how others view you carrying the weapon +-- normal melee melee2 fist knife smg ar2 pistol rpg physgun grenade shotgun crossbow slam passive +-- you're mostly going to use ar2, smg, shotgun or pistol. rpg and crossbow make for good sniper rifles + +SWEP.ViewModelFOV = 70 +SWEP.ViewModelFlip = true +SWEP.ViewModel = "models/weapons/v_dmg_m24s.mdl" -- Weapon view model +SWEP.WorldModel = "models/weapons/w_snip_m24_6.mdl" -- Weapon world model +SWEP.Base = "bobs_scoped_base" +SWEP.Spawnable = true +SWEP.AdminSpawnable = true + +SWEP.Primary.Sound = Sound("Dmgfok_M24SN.Single") -- script that calls the primary fire sound +SWEP.Primary.RPM = 45 -- This is in Rounds Per Minute +SWEP.Primary.ClipSize = 5 -- Size of a clip +SWEP.Primary.DefaultClip = 60 -- Bullets you start with +SWEP.Primary.KickUp = 5 -- Maximum up recoil (rise) +SWEP.Primary.KickDown = 0 -- Maximum down recoil (skeet) +SWEP.Primary.KickHorizontal = 5 -- Maximum up recoil (stock) +SWEP.Primary.Automatic = false -- Automatic/Semi Auto +SWEP.Primary.Ammo = "SniperPenetratedRound" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun +-- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets + +SWEP.Secondary.ScopeZoom = 9 +SWEP.Secondary.UseACOG = false -- Choose one scope type +SWEP.Secondary.UseMilDot = true -- I mean it, only one +SWEP.Secondary.UseSVD = false -- If you choose more than one, your scope will not show up at all +SWEP.Secondary.UseParabolic = false +SWEP.Secondary.UseElcan = false +SWEP.Secondary.UseGreenDuplex = false +SWEP.Secondary.UseAimpoint = false +SWEP.Secondary.UseMatador = false + +SWEP.data = {} +SWEP.data.ironsights = 1 +SWEP.ScopeScale = 0.7 +SWEP.ReticleScale = 0.6 + +SWEP.Primary.NumShots = 1 --how many bullets to shoot per trigger pull +SWEP.Primary.Damage = 100 --base damage per bullet +SWEP.Primary.Spread = 0.5 --define from-the-hip accuracy 1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = 0 -- ironsight accuracy, should be the same for shotguns + +-- enter iron sight info and bone mod info below + +SWEP.IronSightsPos = Vector (2.894, 0, 1.7624) +SWEP.IronSightsAng = Vector (0, 0, 0) +SWEP.SightsPos = Vector (2.894, 0, 1.7624) +SWEP.SightsAng = Vector (0, 0, 0) +SWEP.RunSightsPos = Vector (-2.3095, -3.0514, 2.3965) +SWEP.RunSightsAng = Vector (-19.8471, -33.9181, 10) + +if GetConVar("M9KDefaultClip") == nil then + print("M9KDefaultClip is missing! You may have hit the lua limit!") +else + if GetConVar("M9KDefaultClip"):GetInt() != -1 then + SWEP.Primary.DefaultClip = SWEP.Primary.ClipSize * GetConVar("M9KDefaultClip"):GetInt() + end +end + +if GetConVar("M9KUniqueSlots") != nil then + if not (GetConVar("M9KUniqueSlots"):GetBool()) then + SWEP.SlotPos = 2 + end +end +SWEP.Primary.KickUp = 10 +SWEP.Primary.Recoil = 0 \ No newline at end of file diff --git a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_m249lmg/shared.lua b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_m249lmg/shared.lua index a0c966d..b563ec4 100644 --- a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_m249lmg/shared.lua +++ b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_m249lmg/shared.lua @@ -34,11 +34,11 @@ SWEP.AdminSpawnable = true SWEP.FiresUnderwater = false SWEP.Primary.Sound = Sound("Weapon_249M.Single") -- Script that calls the primary fire sound -SWEP.Primary.RPM = 855 -- This is in Rounds Per Minute -SWEP.Primary.ClipSize = 150 -- Size of a clip +SWEP.Primary.RPM = 1000 -- This is in Rounds Per Minute +SWEP.Primary.ClipSize = 50 -- Size of a clip SWEP.Primary.DefaultClip = 300 -- Bullets you start with -SWEP.Primary.KickUp = 0.6 -- Maximum up recoil (rise) -SWEP.Primary.KickDown = 0.4 -- Maximum down recoil (skeet) +SWEP.Primary.KickUp = 0.5 -- Maximum up recoil (rise) +SWEP.Primary.KickDown = 0.5 -- Maximum down recoil (skeet) SWEP.Primary.KickHorizontal = 0.5 -- Maximum up recoil (stock) SWEP.Primary.Automatic = true -- Automatic = true; Semi Auto = false SWEP.Primary.Ammo = "ar2" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun @@ -50,9 +50,9 @@ SWEP.data = {} --The starting firemode SWEP.data.ironsights = 1 SWEP.Primary.NumShots = 1 -- How many bullets to shoot per trigger pull -SWEP.Primary.Damage = 27 -- Base damage per bullet -SWEP.Primary.Spread = .035 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .024 -- Ironsight accuracy, should be the same for shotguns +SWEP.Primary.Damage = 15 -- Base damage per bullet +SWEP.Primary.Spread = 0 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = 0 -- Ironsight accuracy, should be the same for shotguns -- Enter iron sight info and bone mod info below SWEP.IronSightsPos = Vector(-4.015, 0, 1.764) @@ -74,4 +74,6 @@ if GetConVar("M9KUniqueSlots") != nil then if not (GetConVar("M9KUniqueSlots"):GetBool()) then SWEP.SlotPos = 2 end -end \ No newline at end of file +end +SWEP.Primary.KickUp = 0.5 +SWEP.Primary.Recoil = 0.3 \ No newline at end of file diff --git a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_m3/shared.lua b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_m3/shared.lua index 144f2c4..5da807a 100644 --- a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_m3/shared.lua +++ b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_m3/shared.lua @@ -1,80 +1,97 @@ --- Variables that are used on both client and server -SWEP.Gun = ("m9k_m3") -- must be the name of your swep but NO CAPITALS! -if (GetConVar(SWEP.Gun.."_allowed")) != nil then - if not (GetConVar(SWEP.Gun.."_allowed"):GetBool()) then SWEP.Base = "bobs_blacklisted" SWEP.PrintName = SWEP.Gun return end -end -SWEP.Category = "M9K Shotguns" -SWEP.Author = "iron angles and models hexed and converted to gmod my Mr Fokkusu" -SWEP.Contact = "" -SWEP.Purpose = "" -SWEP.Instructions = "" -SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models -SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models -SWEP.PrintName = "Benelli M3" -- Weapon name (Shown on HUD) -SWEP.Slot = 3 -- Slot in the weapon selection menu -SWEP.SlotPos = 24 -- Position in the slot -SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter -SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box -SWEP.BounceWeaponIcon = false -- Should the weapon icon bounce? -SWEP.DrawCrosshair = true -- set false if you want no crosshair -SWEP.Weight = 30 -- rank relative ot other weapons. bigger is better -SWEP.AutoSwitchTo = true -- Auto switch to if we pick it up -SWEP.AutoSwitchFrom = true -- Auto switch from if you pick up a better weapon -SWEP.HoldType = "shotgun" -- how others view you carrying the weapon --- normal melee melee2 fist knife smg ar2 pistol rpg physgun grenade shotgun crossbow slam passive --- you're mostly going to use ar2, smg, shotgun or pistol. rpg and crossbow make for good sniper rifles - -SWEP.ViewModelFOV = 70 -SWEP.ViewModelFlip = true -SWEP.ViewModel = "models/weapons/v_benelli_m3_s90.mdl" -- Weapon view model -SWEP.WorldModel = "models/weapons/w_benelli_m3.mdl" -- Weapon world model -SWEP.Base = "bobs_shotty_base" -SWEP.Spawnable = true -SWEP.AdminSpawnable = true - -SWEP.Primary.Sound = Sound("BenelliM3.Single") -- script that calls the primary fire sound -SWEP.Primary.RPM = 70 -- This is in Rounds Per Minute -SWEP.Primary.ClipSize = 8 -- Size of a clip -SWEP.Primary.DefaultClip = 30 -- Default number of bullets in a clip -SWEP.Primary.KickUp = 0.8 -- Maximum up recoil (rise) -SWEP.Primary.KickDown = 0.5 -- Maximum down recoil (skeet) -SWEP.Primary.KickHorizontal = 0.3 -- Maximum up recoil (stock) -SWEP.Primary.Automatic = false -- Automatic/Semi Auto -SWEP.Primary.Ammo = "buckshot" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun --- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets - -SWEP.Secondary.IronFOV = 60 -- How much you 'zoom' in. Less is more! - -SWEP.data = {} --The starting firemode -SWEP.data.ironsights = 1 - -SWEP.ShellTime = .45 - -SWEP.Primary.NumShots = 9 -- How many bullets to shoot per trigger pull, AKA pellets -SWEP.Primary.Damage = 10 -- Base damage per bullet -SWEP.Primary.Spread = .0326 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .0326 -- Ironsight accuracy, should be the same for shotguns --- Because irons don't magically give you less pellet spread! - --- Enter iron sight info and bone mod info below -SWEP.IronSightsPos = Vector(2.279, -1.007, 1.302) -SWEP.IronSightsAng = Vector(0.47, -0.024, 0) -SWEP.SightsPos = Vector(2.279, -1.007, 1.302) -SWEP.SightsAng = Vector(0.47, -0.024, 0) -SWEP.RunSightsPos = Vector(-7.639, -7.796, 0.865) -SWEP.RunSightsAng = Vector(-17.362, -69.724, 0) - - -if GetConVar("M9KDefaultClip") == nil then - print("M9KDefaultClip is missing! You may have hit the lua limit!") -else - if GetConVar("M9KDefaultClip"):GetInt() != -1 then - SWEP.Primary.DefaultClip = SWEP.Primary.ClipSize * GetConVar("M9KDefaultClip"):GetInt() - end -end - -if GetConVar("M9KUniqueSlots") != nil then - if not (GetConVar("M9KUniqueSlots"):GetBool()) then - SWEP.SlotPos = 2 - end -end \ No newline at end of file +-- Variables that are used on both client and server +SWEP.Gun = ("m9k_m3") -- must be the name of your swep but NO CAPITALS! +if (GetConVar(SWEP.Gun.."_allowed")) != nil then + if not (GetConVar(SWEP.Gun.."_allowed"):GetBool()) then SWEP.Base = "bobs_blacklisted" SWEP.PrintName = SWEP.Gun return end +end +SWEP.Category = "M9K Shotguns" +SWEP.Author = "iron angles and models hexed and converted to gmod my Mr Fokkusu" +SWEP.Contact = "" +SWEP.Purpose = "" +SWEP.Instructions = "" +SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models +SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models +SWEP.PrintName = "Benelli M3" -- Weapon name (Shown on HUD) +SWEP.Slot = 2 -- Slot in the weapon selection menu +SWEP.SlotPos = 24 -- Position in the slot +SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter +SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box +SWEP.BounceWeaponIcon = false -- Should the weapon icon bounce? +SWEP.DrawCrosshair = true -- set false if you want no crosshair +SWEP.Weight = 30 -- rank relative ot other weapons. bigger is better +SWEP.AutoSwitchTo = true -- Auto switch to if we pick it up +SWEP.AutoSwitchFrom = true -- Auto switch from if you pick up a better weapon +SWEP.HoldType = "shotgun" -- how others view you carrying the weapon +-- normal melee melee2 fist knife smg ar2 pistol rpg physgun grenade shotgun crossbow slam passive +-- you're mostly going to use ar2, smg, shotgun or pistol. rpg and crossbow make for good sniper rifles + +SWEP.ViewModelFOV = 70 +SWEP.ViewModelFlip = true +SWEP.ViewModel = "models/weapons/v_benelli_m3_s90.mdl" -- Weapon view model +SWEP.WorldModel = "models/weapons/w_benelli_m3.mdl" -- Weapon world model +SWEP.Base = "bobs_shotty_base" +SWEP.Spawnable = true +SWEP.AdminSpawnable = true + +SWEP.Primary.Sound = Sound("BenelliM3.Single") -- script that calls the primary fire sound +SWEP.Primary.RPM = 50 -- This is in Rounds Per Minute +SWEP.Primary.ClipSize = 4 -- Size of a clip +SWEP.Primary.DefaultClip = 30 -- Default number of bullets in a clip +SWEP.Primary.Automatic = false -- Automatic/Semi Auto +SWEP.Primary.Ammo = "buckshot" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun +-- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets + +SWEP.Secondary.IronFOV = 60 -- How much you 'zoom' in. Less is more! + +SWEP.data = {} --The starting firemode +SWEP.data.ironsights = 1 + +SWEP.ShellTime = .3 + +SWEP.Primary.NumShots = 10 -- How many bullets to shoot per trigger pull, AKA pellets +SWEP.Primary.Damage = 6 -- Base damage per bullet +SWEP.Primary.Spread = .02 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = .02 -- Ironsight accuracy, should be the same for shotguns +-- Because irons don't magically give you less pellet spread! + +-- Enter iron sight info and bone mod info below +SWEP.IronSightsPos = Vector(2.279, -1.007, 1.302) +SWEP.IronSightsAng = Vector(0.47, -0.024, 0) +SWEP.SightsPos = Vector(2.279, -1.007, 1.302) +SWEP.SightsAng = Vector(0.47, -0.024, 0) +SWEP.RunSightsPos = Vector(-7.639, -7.796, 0.865) +SWEP.RunSightsAng = Vector(-17.362, -69.724, 0) + + +if GetConVar("M9KDefaultClip") == nil then + print("M9KDefaultClip is missing! You may have hit the lua limit!") +else + if GetConVar("M9KDefaultClip"):GetInt() != -1 then + SWEP.Primary.DefaultClip = SWEP.Primary.ClipSize * GetConVar("M9KDefaultClip"):GetInt() + end +end + +if GetConVar("M9KUniqueSlots") != nil then + if not (GetConVar("M9KUniqueSlots"):GetBool()) then + SWEP.SlotPos = 2 + end +end +function SWEP:ShootBullet( DirX, DirY, DirZ ) + + local bullet = {} + bullet.Num = 1 + bullet.Src = self.Owner:GetShootPos() -- Source + bullet.Dir = self.Owner:GetAimVector() + (self.Owner:GetAimVector():Angle():Right()*DirX) + (self.Owner:GetAimVector():Angle():Up()*DirY) -- Dir of bullet + bullet.Spread = Vector(0,0,0) -- Aim Cone + bullet.Tracer = 1 -- Show a tracer on every x bullets + bullet.Force = 1 -- Amount of force to give to phys objects + bullet.Damage = 9 + bullet.AmmoType = self.Primary.Ammo + bullet.HullSize = 0 + + self.Owner:FireBullets( bullet ) + + self:ShootEffects() + +end +SWEP.Primary.KickUp = 0 +SWEP.Primary.Recoil = 0 \ No newline at end of file diff --git a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_m60/shared.lua b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_m60/shared.lua index 19e8b3f..2888c17 100644 --- a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_m60/shared.lua +++ b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_m60/shared.lua @@ -34,8 +34,8 @@ SWEP.AdminSpawnable = true SWEP.FiresUnderwater = false SWEP.Primary.Sound = Sound("Weapon_M_60.Single") -- Script that calls the primary fire sound -SWEP.Primary.RPM = 575 -- This is in Rounds Per Minute -SWEP.Primary.ClipSize = 200 -- Size of a clip +SWEP.Primary.RPM = 650 -- This is in Rounds Per Minute +SWEP.Primary.ClipSize = 50 -- Size of a clip SWEP.Primary.DefaultClip = 400 -- Bullets you start with SWEP.Primary.KickUp = 0.6 -- Maximum up recoil (rise) SWEP.Primary.KickDown = 0.4 -- Maximum down recoil (skeet) @@ -50,9 +50,9 @@ SWEP.data = {} --The starting firemode SWEP.data.ironsights = 1 SWEP.Primary.NumShots = 1 -- How many bullets to shoot per trigger pull -SWEP.Primary.Damage = 33 -- Base damage per bullet -SWEP.Primary.Spread = .035 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .025 -- Ironsight accuracy, should be the same for shotguns +SWEP.Primary.Damage = 20 -- Base damage per bullet +SWEP.Primary.Spread = 0 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = 0 -- Ironsight accuracy, should be the same for shotguns -- Enter iron sight info and bone mod info below SWEP.IronSightsPos = Vector(-5.851, -2.763, 3.141) @@ -74,4 +74,6 @@ if GetConVar("M9KUniqueSlots") != nil then if not (GetConVar("M9KUniqueSlots"):GetBool()) then SWEP.SlotPos = 2 end -end \ No newline at end of file +end +SWEP.Primary.KickUp = 0.5 +SWEP.Primary.Recoil = 0.3 \ No newline at end of file diff --git a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_m98b/shared.lua b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_m98b/shared.lua index 7055bd6..81eb434 100644 --- a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_m98b/shared.lua +++ b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_m98b/shared.lua @@ -1,90 +1,85 @@ --- Variables that are used on both client and server -SWEP.Gun = ("m9k_m98b") -- must be the name of your swep but NO CAPITALS! -if (GetConVar(SWEP.Gun.."_allowed")) != nil then - if not (GetConVar(SWEP.Gun.."_allowed"):GetBool()) then SWEP.Base = "bobs_blacklisted" SWEP.PrintName = SWEP.Gun return end -end -SWEP.Category = "M9K Sniper Rifles" -SWEP.Author = "" -SWEP.Contact = "" -SWEP.Purpose = "" -SWEP.Instructions = "" -SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models -SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models -SWEP.PrintName = "Barret M98B" -- Weapon name (Shown on HUD) -SWEP.Slot = 3 -- Slot in the weapon selection menu -SWEP.SlotPos = 44 -- Position in the slot -SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter -SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box -SWEP.BounceWeaponIcon = false -- Should the weapon icon bounce? -SWEP.DrawCrosshair = false -- Set false if you want no crosshair from hip -SWEP.XHair = false -- Used for returning crosshair after scope. Must be the same as DrawCrosshair -SWEP.Weight = 50 -- Rank relative ot other weapons. bigger is better -SWEP.AutoSwitchTo = true -- Auto switch to if we pick it up -SWEP.AutoSwitchFrom = true -- Auto switch from if you pick up a better weapon -SWEP.BoltAction = true -- Is this a bolt action rifle? -SWEP.HoldType = "rpg" -- how others view you carrying the weapon --- normal melee melee2 fist knife smg ar2 pistol rpg physgun grenade shotgun crossbow slam passive --- you're mostly going to use ar2, smg, shotgun or pistol. rpg and crossbow make for good sniper rifles - -SWEP.ViewModelFOV = 70 -SWEP.ViewModelFlip = false -SWEP.ViewModel = "models/weapons/v_m98bravo.mdl" -- Weapon view model -SWEP.WorldModel = "models/weapons/w_barrett_m98b.mdl" -- Weapon world model -SWEP.Base = "bobs_scoped_base" -SWEP.Spawnable = true -SWEP.AdminSpawnable = true - -SWEP.Primary.Sound = Sound("M98.Single") -- script that calls the primary fire sound -SWEP.Primary.RPM = 50 -- This is in Rounds Per Minute -SWEP.Primary.ClipSize = 10 -- Size of a clip -SWEP.Primary.DefaultClip = 60 -- Bullets you start with -SWEP.Primary.KickUp = 1 -- Maximum up recoil (rise) -SWEP.Primary.KickDown = 1 -- Maximum down recoil (skeet) -SWEP.Primary.KickHorizontal = 1 -- Maximum up recoil (stock) -SWEP.Primary.Automatic = false -- Automatic/Semi Auto -SWEP.Primary.Ammo = "SniperPenetratedRound" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun --- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets - -SWEP.Secondary.ScopeZoom = 9 -SWEP.Secondary.UseACOG = false -- Choose one scope type -SWEP.Secondary.UseMilDot = false -- I mean it, only one -SWEP.Secondary.UseSVD = false -- If you choose more than one, your scope will not show up at all -SWEP.Secondary.UseParabolic = true -SWEP.Secondary.UseElcan = false -SWEP.Secondary.UseGreenDuplex = false -SWEP.Secondary.UseAimpoint = false -SWEP.Secondary.UseMatador = false - -SWEP.data = {} -SWEP.data.ironsights = 1 -SWEP.ScopeScale = 0.7 -SWEP.ReticleScale = 0.6 - -SWEP.Primary.NumShots = 1 --how many bullets to shoot per trigger pull -SWEP.Primary.Damage = 90 --base damage per bullet -SWEP.Primary.Spread = .001 --define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .0001 -- ironsight accuracy, should be the same for shotguns - --- enter iron sight info and bone mod info below - -SWEP.IronSightsPos = Vector(-2.196, -2, 1) -SWEP.IronSightsAng = Vector(0, 0, 0) -SWEP.SightsPos = Vector(-2.196, -2, 1) -SWEP.SightsAng = Vector(0, 0, 0) -SWEP.RunSightsPos = Vector(3.714, -3.714, 0.286) -SWEP.RunSightsAng = Vector(-7, 43, 0) - - -if GetConVar("M9KDefaultClip") == nil then - print("M9KDefaultClip is missing! You may have hit the lua limit!") -else - if GetConVar("M9KDefaultClip"):GetInt() != -1 then - SWEP.Primary.DefaultClip = SWEP.Primary.ClipSize * GetConVar("M9KDefaultClip"):GetInt() - end -end - -if GetConVar("M9KUniqueSlots") != nil then - if not (GetConVar("M9KUniqueSlots"):GetBool()) then - SWEP.SlotPos = 2 - end -end \ No newline at end of file +-- Variables that are used on both client and server +SWEP.Gun = ("m9k_m98b") -- must be the name of your swep but NO CAPITALS! +if (GetConVar(SWEP.Gun.."_allowed")) != nil then + if not (GetConVar(SWEP.Gun.."_allowed"):GetBool()) then SWEP.Base = "bobs_blacklisted" SWEP.PrintName = SWEP.Gun return end +end +SWEP.Category = "M9K Sniper Rifles" +SWEP.Author = "" +SWEP.Contact = "" +SWEP.Purpose = "" +SWEP.Instructions = "" +SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models +SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models +SWEP.PrintName = "Barret M98B" -- Weapon name (Shown on HUD) +SWEP.Slot = 4 -- Slot in the weapon selection menu +SWEP.SlotPos = 44 -- Position in the slot +SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter +SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box +SWEP.BounceWeaponIcon = false -- Should the weapon icon bounce? +SWEP.DrawCrosshair = false -- Set false if you want no crosshair from hip +SWEP.XHair = false -- Used for returning crosshair after scope. Must be the same as DrawCrosshair +SWEP.Weight = 50 -- Rank relative ot other weapons. bigger is better +SWEP.AutoSwitchTo = true -- Auto switch to if we pick it up +SWEP.AutoSwitchFrom = true -- Auto switch from if you pick up a better weapon +SWEP.BoltAction = true -- Is this a bolt action rifle? +SWEP.HoldType = "rpg" -- how others view you carrying the weapon +-- normal melee melee2 fist knife smg ar2 pistol rpg physgun grenade shotgun crossbow slam passive +-- you're mostly going to use ar2, smg, shotgun or pistol. rpg and crossbow make for good sniper rifles + +SWEP.ViewModelFOV = 70 +SWEP.ViewModelFlip = false +SWEP.ViewModel = "models/weapons/v_m98bravo.mdl" -- Weapon view model +SWEP.WorldModel = "models/weapons/w_barrett_m98b.mdl" -- Weapon world model +SWEP.Base = "bobs_scoped_base" +SWEP.Spawnable = true +SWEP.AdminSpawnable = true + +SWEP.Primary.Sound = Sound("M98.Single") -- script that calls the primary fire sound +SWEP.Primary.RPM = 45 -- This is in Rounds Per Minute +SWEP.Primary.ClipSize = 5 -- Size of a clip +SWEP.Primary.DefaultClip = 60 -- Bullets you start with +SWEP.Primary.KickUp = 10 -- Maximum up recoil (rise) +SWEP.Primary.KickDown = 0 -- Maximum down recoil (skeet) +SWEP.Primary.KickHorizontal = 10 -- Maximum up recoil (stock) +SWEP.Primary.Automatic = false -- Automatic/Semi Auto +SWEP.Primary.Ammo = "SniperPenetratedRound" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun +-- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets + +SWEP.Secondary.ScopeZoom = 9 +SWEP.Secondary.UseACOG = false -- Choose one scope type +SWEP.Secondary.UseMilDot = false -- I mean it, only one +SWEP.Secondary.UseSVD = false -- If you choose more than one, your scope will not show up at all +SWEP.Secondary.UseParabolic = true +SWEP.Secondary.UseElcan = false +SWEP.Secondary.UseGreenDuplex = false +SWEP.Secondary.UseAimpoint = false +SWEP.Secondary.UseMatador = false + +SWEP.data = {} +SWEP.data.ironsights = 1 +SWEP.ScopeScale = 0.7 +SWEP.ReticleScale = 0.6 + +SWEP.Primary.NumShots = 1 --how many bullets to shoot per trigger pull +SWEP.Primary.Damage = 100 --base damage per bullet +SWEP.Primary.Spread = 0.5 --define from-the-hip accuracy 1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = 0 -- ironsight accuracy, should be the same for shotguns + +-- enter iron sight info and bone mod info below + + +if GetConVar("M9KDefaultClip") == nil then + print("M9KDefaultClip is missing! You may have hit the lua limit!") +else + if GetConVar("M9KDefaultClip"):GetInt() != -1 then + SWEP.Primary.DefaultClip = SWEP.Primary.ClipSize * GetConVar("M9KDefaultClip"):GetInt() + end +end + +if GetConVar("M9KUniqueSlots") != nil then + if not (GetConVar("M9KUniqueSlots"):GetBool()) then + SWEP.SlotPos = 2 + end +end +SWEP.Primary.KickUp = 10 +SWEP.Primary.Recoil = 0 \ No newline at end of file diff --git a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_minigun/shared.lua b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_minigun/shared.lua index f2b4dc0..e69de29 100644 --- a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_minigun/shared.lua +++ b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_minigun/shared.lua @@ -1,125 +0,0 @@ --- Variables that are used on both client and server -SWEP.Gun = ("m9k_minigun") -- must be the name of your swep but NO CAPITALS! -if (GetConVar(SWEP.Gun.."_allowed")) != nil then - if not (GetConVar(SWEP.Gun.."_allowed"):GetBool()) then SWEP.Base = "bobs_blacklisted" SWEP.PrintName = SWEP.Gun return end -end -SWEP.Category = "M9K Machine Guns" -SWEP.Author = "" -SWEP.Contact = "" -SWEP.Purpose = "" -SWEP.Instructions = "" -SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models -SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models -SWEP.PrintName = "M134 Minigun" -- Weapon name (Shown on HUD) -SWEP.Slot = 3 -- Slot in the weapon selection menu -SWEP.SlotPos = 37 -- Position in the slot -SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter -SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box -SWEP.BounceWeaponIcon = false -- Should the weapon icon bounce? -SWEP.DrawCrosshair = true -- set false if you want no crosshair -SWEP.Weight = 30 -- rank relative ot other weapons. bigger is better -SWEP.AutoSwitchTo = true -- Auto switch to if we pick it up -SWEP.AutoSwitchFrom = true -- Auto switch from if you pick up a better weapon -SWEP.HoldType = "crossbow" -- how others view you carrying the weapon --- normal melee melee2 fist knife smg ar2 pistol rpg physgun grenade shotgun crossbow slam passive --- you're mostly going to use ar2, smg, shotgun or pistol. rpg and crossbow make for good sniper rifles - -SWEP.ViewModelFOV = 65 -SWEP.ViewModelFlip = false -SWEP.ViewModel = "models/weapons/v_minigunvulcan.mdl" -- Weapon view model -SWEP.WorldModel = "models/weapons/w_m134_minigun.mdl" -- Weapon world model -SWEP.Base = "bobs_gun_base" -SWEP.Spawnable = true -SWEP.AdminSpawnable = true -SWEP.FiresUnderwater = false - -SWEP.Primary.Sound = Sound("BlackVulcan.Single") -- Script that calls the primary fire sound -SWEP.Primary.RPM = 3500 -- This is in Rounds Per Minute -SWEP.Primary.ClipSize = 100 -- Size of a clip -SWEP.Primary.DefaultClip = 200 -- Bullets you start with -SWEP.Primary.KickUp = 0.5 -- Maximum up recoil (rise) -SWEP.Primary.KickDown = 0.6 -- Maximum down recoil (skeet) -SWEP.Primary.KickHorizontal = 0.6 -- Maximum up recoil (stock) -SWEP.Primary.Automatic = true -- Automatic = true; Semi Auto = false -SWEP.Primary.Ammo = "ar2" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun --- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets - -SWEP.Secondary.IronFOV = 0 -- How much you 'zoom' in. Less is more! - -SWEP.data = {} --The starting firemode -SWEP.data.ironsights = 1 - -SWEP.Primary.NumShots = 1 -- How many bullets to shoot per trigger pull -SWEP.Primary.Damage = 25 -- Base damage per bullet -SWEP.Primary.Spread = .035 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .035 -- Ironsight accuracy, should be the same for shotguns - --- Enter iron sight info and bone mod info below -SWEP.RunSightsPos = Vector(0, -11.148, -8.033) -SWEP.RunSightsAng = Vector(55.082, 0, 0) - -if ((gmod.GetGamemode().Name) == "Murderthon 9000") or ((gmod.GetGamemode().Name) == "Murderthon 9000 beta") then - SWEP.Primary.ClipSize = 100 -- Size of a clip - SWEP.Primary.DefaultClip = 200 -- Bullets you start with -else - SWEP.Primary.ClipSize = 300 -- Size of a clip - SWEP.Primary.DefaultClip = 600 -- Bullets you start with -end - -function SWEP:Reload() - - self.Weapon:DefaultReload(ACT_VM_RELOAD) - if !self.Owner:IsNPC() then - self.ResetSights = CurTime() + self.Owner:GetViewModel():SequenceDuration() end - if ( self.Weapon:Clip1() < self.Primary.ClipSize ) and !self.Owner:IsNPC() then - -- When the current clip < full clip and the rest of your ammo > 0, then - self.Owner:SetFOV( 0, 0.3 ) - -- Zoom = 0 - self:SetIronsights(false) - -- Set the ironsight to false - self.Weapon:SetNWBool("Reloading", true) - end - local waitdammit = (self.Owner:GetViewModel():SequenceDuration()) - self:MiniGunIdle(waitdammit) -end - -function SWEP:MiniGunIdle(wait) - timer.Simple(wait + .05, function() - if self.Weapon != nil then - self.Weapon:SetNWBool("Reloading", false) - if SERVER then - self.Weapon:SendWeaponAnim( ACT_VM_IDLE ) - else return end end - end) -end - -function SWEP:IronSight() - - if self.Owner:KeyDown(IN_SPEED) and not (self.Weapon:GetNWBool("Reloading")) then // If you run then - self.Weapon:SetNextPrimaryFire(CurTime()+0.5) // Make it so you can't shoot for another quarter second - self.IronSightsPos = self.RunSightsPos // Hold it down - self.IronSightsAng = self.RunSightsAng // Hold it down - self:SetIronsights(true, self.Owner) // Set the ironsight true - self.Owner:SetFOV( 0, 0.3 ) // Reset FOV - end - - if self.Owner:KeyReleased(IN_SPEED) then // If you stop running then - self:SetIronsights(false, self.Owner) // Set the ironsight true - self.Owner:SetFOV( 0, 0.3 ) // Reset FOV - end - -end - -if GetConVar("M9KDefaultClip") == nil then - print("M9KDefaultClip is missing! You may have hit the lua limit!") -else - if GetConVar("M9KDefaultClip"):GetInt() != -1 then - SWEP.Primary.DefaultClip = SWEP.Primary.ClipSize * GetConVar("M9KDefaultClip"):GetInt() - end -end - -if GetConVar("M9KUniqueSlots") != nil then - if not (GetConVar("M9KUniqueSlots"):GetBool()) then - SWEP.SlotPos = 2 - end -end \ No newline at end of file diff --git a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_mossberg590/shared.lua b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_mossberg590/shared.lua index 9ba0216..e56d6ca 100644 --- a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_mossberg590/shared.lua +++ b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_mossberg590/shared.lua @@ -1,80 +1,97 @@ --- Variables that are used on both client and server -SWEP.Gun = ("m9k_mossberg590") -- must be the name of your swep but NO CAPITALS! -if (GetConVar(SWEP.Gun.."_allowed")) != nil then - if not (GetConVar(SWEP.Gun.."_allowed"):GetBool()) then SWEP.Base = "bobs_blacklisted" SWEP.PrintName = SWEP.Gun return end -end -SWEP.Category = "M9K Shotguns" -SWEP.Author = "" -SWEP.Contact = "" -SWEP.Purpose = "" -SWEP.Instructions = "" -SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models -SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models -SWEP.PrintName = "Mossberg 590" -- Weapon name (Shown on HUD) -SWEP.Slot = 3 -- Slot in the weapon selection menu -SWEP.SlotPos = 25 -- Position in the slot -SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter -SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box -SWEP.BounceWeaponIcon = false -- Should the weapon icon bounce? -SWEP.DrawCrosshair = true -- set false if you want no crosshair -SWEP.Weight = 30 -- rank relative ot other weapons. bigger is better -SWEP.AutoSwitchTo = true -- Auto switch to if we pick it up -SWEP.AutoSwitchFrom = true -- Auto switch from if you pick up a better weapon -SWEP.HoldType = "shotgun" -- how others view you carrying the weapon --- normal melee melee2 fist knife smg ar2 pistol rpg physgun grenade shotgun crossbow slam passive --- you're mostly going to use ar2, smg, shotgun or pistol. rpg and crossbow make for good sniper rifles - -SWEP.ViewModelFOV = 60 -SWEP.ViewModelFlip = false -SWEP.ViewModel = "models/weapons/v_shot_mberg_590.mdl" -- Weapon view model -SWEP.WorldModel = "models/weapons/w_mossberg_590.mdl" -- Weapon world model -SWEP.Base = "bobs_shotty_base" -SWEP.Spawnable = true -SWEP.AdminSpawnable = true - -SWEP.Primary.Sound = Sound("Mberg_590.Single") -- script that calls the primary fire sound -SWEP.Primary.RPM = 75 -- This is in Rounds Per Minute -SWEP.Primary.ClipSize = 8 -- Size of a clip -SWEP.Primary.DefaultClip = 30 -- Default number of bullets in a clip -SWEP.Primary.KickUp = 1 -- Maximum up recoil (rise) -SWEP.Primary.KickDown = 0.8 -- Maximum down recoil (skeet) -SWEP.Primary.KickHorizontal = 0.8 -- Maximum up recoil (stock) -SWEP.Primary.Automatic = false -- Automatic/Semi Auto -SWEP.Primary.Ammo = "buckshot" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun --- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets - -SWEP.Secondary.IronFOV = 60 -- How much you 'zoom' in. Less is more! -SWEP.ShellTime = .5 - -SWEP.data = {} --The starting firemode -SWEP.data.ironsights = 1 - -SWEP.Primary.NumShots = 10 -- How many bullets to shoot per trigger pull, AKA pellets -SWEP.Primary.Damage = 9 -- Base damage per bullet -SWEP.Primary.Spread = .03 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .03 -- Ironsight accuracy, should be the same for shotguns --- Because irons don't magically give you less pellet spread! - --- Enter iron sight info and bone mod info below -SWEP.IronSightsPos = Vector(-2.72, -3.143, 1.26) -SWEP.IronSightsAng = Vector(0, -0.75, 3) -SWEP.SightsPos = Vector(-2.72, -3.143, 1.26) -SWEP.SightsAng = Vector(0, -0.75, 3) -SWEP.RunSightsPos = Vector(7, -9.429, -0.857) -SWEP.RunSightsAng = Vector(-7, 63, 0) - - - -if GetConVar("M9KDefaultClip") == nil then - print("M9KDefaultClip is missing! You may have hit the lua limit!") -else - if GetConVar("M9KDefaultClip"):GetInt() != -1 then - SWEP.Primary.DefaultClip = SWEP.Primary.ClipSize * GetConVar("M9KDefaultClip"):GetInt() - end -end - -if GetConVar("M9KUniqueSlots") != nil then - if not (GetConVar("M9KUniqueSlots"):GetBool()) then - SWEP.SlotPos = 2 - end -end \ No newline at end of file +-- Variables that are used on both client and server +SWEP.Gun = ("m9k_mossberg590") -- must be the name of your swep but NO CAPITALS! +if (GetConVar(SWEP.Gun.."_allowed")) != nil then + if not (GetConVar(SWEP.Gun.."_allowed"):GetBool()) then SWEP.Base = "bobs_blacklisted" SWEP.PrintName = SWEP.Gun return end +end +SWEP.Category = "M9K Shotguns" +SWEP.Author = "" +SWEP.Contact = "" +SWEP.Purpose = "" +SWEP.Instructions = "" +SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models +SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models +SWEP.PrintName = "Mossberg 590" -- Weapon name (Shown on HUD) +SWEP.Slot = 2 -- Slot in the weapon selection menu +SWEP.SlotPos = 25 -- Position in the slot +SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter +SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box +SWEP.BounceWeaponIcon = false -- Should the weapon icon bounce? +SWEP.DrawCrosshair = true -- set false if you want no crosshair +SWEP.Weight = 30 -- rank relative ot other weapons. bigger is better +SWEP.AutoSwitchTo = true -- Auto switch to if we pick it up +SWEP.AutoSwitchFrom = true -- Auto switch from if you pick up a better weapon +SWEP.HoldType = "shotgun" -- how others view you carrying the weapon +-- normal melee melee2 fist knife smg ar2 pistol rpg physgun grenade shotgun crossbow slam passive +-- you're mostly going to use ar2, smg, shotgun or pistol. rpg and crossbow make for good sniper rifles + +SWEP.ViewModelFOV = 60 +SWEP.ViewModelFlip = false +SWEP.ViewModel = "models/weapons/v_shot_mberg_590.mdl" -- Weapon view model +SWEP.WorldModel = "models/weapons/w_mossberg_590.mdl" -- Weapon world model +SWEP.Base = "bobs_shotty_base" +SWEP.Spawnable = true +SWEP.AdminSpawnable = true + +SWEP.Primary.Sound = Sound("Mberg_590.Single") -- script that calls the primary fire sound +SWEP.Primary.RPM = 50 -- This is in Rounds Per Minute +SWEP.Primary.ClipSize = 4 -- Size of a clip +SWEP.Primary.DefaultClip = 30 -- Default number of bullets in a clip +SWEP.Primary.KickUp = 1 -- Maximum up recoil (rise) +SWEP.Primary.KickDown = 0.8 -- Maximum down recoil (skeet) +SWEP.Primary.KickHorizontal = 0.8 -- Maximum up recoil (stock) +SWEP.Primary.Automatic = false -- Automatic/Semi Auto +SWEP.Primary.Ammo = "buckshot" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun +-- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets + +SWEP.Secondary.IronFOV = 60 -- How much you 'zoom' in. Less is more! +SWEP.ShellTime = .3 + +SWEP.data = {} --The starting firemode +SWEP.data.ironsights = 1 + +-- Because irons don't magically give you less pellet spread! + +-- Enter iron sight info and bone mod info below +SWEP.IronSightsPos = Vector(-2.72, -3.143, 1.26) +SWEP.IronSightsAng = Vector(0, -0.75, 3) +SWEP.SightsPos = Vector(-2.72, -3.143, 1.26) +SWEP.SightsAng = Vector(0, -0.75, 3) +SWEP.RunSightsPos = Vector(7, -9.429, -0.857) +SWEP.RunSightsAng = Vector(-7, 63, 0) + + + +if GetConVar("M9KDefaultClip") == nil then + print("M9KDefaultClip is missing! You may have hit the lua limit!") +else + if GetConVar("M9KDefaultClip"):GetInt() != -1 then + SWEP.Primary.DefaultClip = SWEP.Primary.ClipSize * GetConVar("M9KDefaultClip"):GetInt() + end +end + +if GetConVar("M9KUniqueSlots") != nil then + if not (GetConVar("M9KUniqueSlots"):GetBool()) then + SWEP.SlotPos = 2 + end +end + +function SWEP:ShootBullet( DirX, DirY, DirZ ) + + local bullet = {} + bullet.Num = 1 + bullet.Src = self.Owner:GetShootPos() -- Source + bullet.Dir = self.Owner:GetAimVector() + (self.Owner:GetAimVector():Angle():Right()*DirX) + (self.Owner:GetAimVector():Angle():Up()*DirY) -- Dir of bullet + bullet.Spread = Vector(0,0,0) -- Aim Cone + bullet.Tracer = 1 -- Show a tracer on every x bullets + bullet.Force = 1 -- Amount of force to give to phys objects + bullet.Damage = 9 + bullet.AmmoType = self.Primary.Ammo + bullet.HullSize = 0 + + self.Owner:FireBullets( bullet ) + + self:ShootEffects() + +end +SWEP.Primary.KickUp = 5 +SWEP.Primary.Recoil = 0 \ No newline at end of file diff --git a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_pkm/shared.lua b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_pkm/shared.lua index 92deb92..47f2701 100644 --- a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_pkm/shared.lua +++ b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_pkm/shared.lua @@ -35,11 +35,11 @@ SWEP.AdminSpawnable = true SWEP.FiresUnderwater = false SWEP.Primary.Sound = Sound("pkm.Single") -- Script that calls the primary fire sound -SWEP.Primary.RPM = 750 -- This is in Rounds Per Minute -SWEP.Primary.ClipSize = 100 -- Size of a clip +SWEP.Primary.RPM = 1000 -- This is in Rounds Per Minute +SWEP.Primary.ClipSize = 50 -- Size of a clip SWEP.Primary.DefaultClip = 200 -- Bullets you start with -SWEP.Primary.KickUp = 0.6 -- Maximum up recoil (rise) -SWEP.Primary.KickDown = 0.3 -- Maximum down recoil (skeet) +SWEP.Primary.KickUp = 0.5 -- Maximum up recoil (rise) +SWEP.Primary.KickDown = 0.5 -- Maximum down recoil (skeet) SWEP.Primary.KickHorizontal = 0.5 -- Maximum up recoil (stock) SWEP.Primary.Automatic = true -- Automatic = true; Semi Auto = false SWEP.Primary.Ammo = "ar2" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun @@ -53,9 +53,9 @@ SWEP.data = {} --The starting firemode SWEP.data.ironsights = 1 SWEP.Primary.NumShots = 1 -- How many bullets to shoot per trigger pull -SWEP.Primary.Damage = 33 -- Base damage per bullet -SWEP.Primary.Spread = .035 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .02 -- Ironsight accuracy, should be the same for shotguns +SWEP.Primary.Damage = 15 -- Base damage per bullet +SWEP.Primary.Spread = 0 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = 0 -- Ironsight accuracy, should be the same for shotguns -- Enter iron sight info and bone mod info below SWEP.IronSightsPos = Vector(-2.215, -2.116, 0.36) @@ -77,4 +77,6 @@ if GetConVar("M9KUniqueSlots") != nil then if not (GetConVar("M9KUniqueSlots"):GetBool()) then SWEP.SlotPos = 2 end -end \ No newline at end of file +end +SWEP.Primary.KickUp = 0.5 +SWEP.Primary.Recoil = 0.3 \ No newline at end of file diff --git a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_psg1/shared.lua b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_psg1/shared.lua index 2bb71d6..860f00e 100644 --- a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_psg1/shared.lua +++ b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_psg1/shared.lua @@ -11,7 +11,7 @@ SWEP.Instructions = "" SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models SWEP.PrintName = "PSG-1" -- Weapon name (Shown on HUD) -SWEP.Slot = 3 -- Slot in the weapon selection menu +SWEP.Slot = 4 -- Slot in the weapon selection menu SWEP.SlotPos = 45 -- Position in the slot SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box @@ -61,9 +61,9 @@ SWEP.ScopeScale = 0.7 SWEP.ReticleScale = 0.6 SWEP.Primary.NumShots = 1 --how many bullets to shoot per trigger pull -SWEP.Primary.Damage = 90 --base damage per bullet -SWEP.Primary.Spread = .01 --define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .0001 -- ironsight accuracy, should be the same for shotguns +SWEP.Primary.Damage = 50 --base damage per bullet +SWEP.Primary.Spread = 0.5 --define from-the-hip accuracy 1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = 0 -- ironsight accuracy, should be the same for shotguns -- enter iron sight info and bone mod info below @@ -87,4 +87,6 @@ if GetConVar("M9KUniqueSlots") != nil then if not (GetConVar("M9KUniqueSlots"):GetBool()) then SWEP.SlotPos = 2 end -end \ No newline at end of file +end +SWEP.Primary.KickUp = 5 +SWEP.Primary.Recoil = 0 \ No newline at end of file diff --git a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_remington7615p/shared.lua b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_remington7615p/shared.lua index e4731cb..028eab8 100644 --- a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_remington7615p/shared.lua +++ b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_remington7615p/shared.lua @@ -1,89 +1,91 @@ --- Variables that are used on both client and server -SWEP.Gun = ("m9k_remington7615p") -- must be the name of your swep but NO CAPITALS! -if (GetConVar(SWEP.Gun.."_allowed")) != nil then - if not (GetConVar(SWEP.Gun.."_allowed"):GetBool()) then SWEP.Base = "bobs_blacklisted" SWEP.PrintName = SWEP.Gun return end -end -SWEP.Category = "M9K Sniper Rifles" -SWEP.Author = "" -SWEP.Contact = "" -SWEP.Purpose = "" -SWEP.Instructions = "" -SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models -SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models -SWEP.PrintName = "Remington 7615P" -- Weapon name (Shown on HUD) -SWEP.Slot = 3 -- Slot in the weapon selection menu -SWEP.SlotPos = 46 -- Position in the slot -SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter -SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box -SWEP.BounceWeaponIcon = false -- Should the weapon icon bounce? -SWEP.DrawCrosshair = false -- Set false if you want no crosshair from hip -SWEP.XHair = false -- Used for returning crosshair after scope. Must be the same as DrawCrosshair -SWEP.Weight = 50 -- Rank relative ot other weapons. bigger is better -SWEP.AutoSwitchTo = true -- Auto switch to if we pick it up -SWEP.AutoSwitchFrom = false -- Auto switch from if you pick up a better weapon -SWEP.BoltAction = true -- Is this a bolt action rifle? -SWEP.HoldType = "ar2" -- how others view you carrying the weapon --- normal melee melee2 fist knife smg ar2 pistol rpg physgun grenade shotgun crossbow slam passive --- you're mostly going to use ar2, smg, shotgun or pistol. rpg and crossbow make for good sniper rifles - -SWEP.ViewModelFOV = 70 -SWEP.ViewModelFlip = true -SWEP.ViewModel = "models/weapons/v_remington_7615p.mdl" -- Weapon view model -SWEP.WorldModel = "models/weapons/w_remington_7615p.mdl" -- Weapon world model -SWEP.Base = "bobs_scoped_base" -SWEP.Spawnable = true -SWEP.AdminSpawnable = true - -SWEP.Primary.Sound = Sound("7615p_remington.Single") -- script that calls the primary fire sound -SWEP.Primary.RPM = 50 -- This is in Rounds Per Minute -SWEP.Primary.ClipSize = 10 -- Size of a clip -SWEP.Primary.DefaultClip = 60 -- Bullets you start with -SWEP.Primary.KickUp = 1 -- Maximum up recoil (rise) -SWEP.Primary.KickDown = 1 -- Maximum down recoil (skeet) -SWEP.Primary.KickHorizontal = 1 -- Maximum up recoil (stock) -SWEP.Primary.Automatic = false -- Automatic/Semi Auto -SWEP.Primary.Ammo = "ar2" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun --- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets - -SWEP.Secondary.ScopeZoom = 7 -SWEP.Secondary.UseACOG = false -- Choose one scope type -SWEP.Secondary.UseMilDot = true -- I mean it, only one -SWEP.Secondary.UseSVD = false -- If you choose more than one, your scope will not show up at all -SWEP.Secondary.UseParabolic = false -SWEP.Secondary.UseElcan = false -SWEP.Secondary.UseGreenDuplex = false -SWEP.Secondary.UseAimpoint = false -SWEP.Secondary.UseMatador = false - -SWEP.data = {} -SWEP.data.ironsights = 1 -SWEP.ScopeScale = 0.7 -SWEP.ReticleScale = 0.6 - -SWEP.Primary.NumShots = 1 --how many bullets to shoot per trigger pull -SWEP.Primary.Damage = 35 --base damage per bullet -SWEP.Primary.Spread = .01 --define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .001 -- ironsight accuracy, should be the same for shotguns - --- enter iron sight info and bone mod info below - -SWEP.IronSightsPos = Vector(3.079, -1.333, 0.437) -SWEP.IronSightsAng = Vector(0, 0, 0) -SWEP.SightsPos = Vector(3.079, -1.333, 0.437) -SWEP.SightsAng = Vector(0, 0, 0) -SWEP.RunSightsPos = Vector (-2.3095, -3.0514, 2.3965) -SWEP.RunSightsAng = Vector (-19.8471, -33.9181, 10) - -if GetConVar("M9KDefaultClip") == nil then - print("M9KDefaultClip is missing! You may have hit the lua limit!") -else - if GetConVar("M9KDefaultClip"):GetInt() != -1 then - SWEP.Primary.DefaultClip = SWEP.Primary.ClipSize * GetConVar("M9KDefaultClip"):GetInt() - end -end - -if GetConVar("M9KUniqueSlots") != nil then - if not (GetConVar("M9KUniqueSlots"):GetBool()) then - SWEP.SlotPos = 2 - end -end \ No newline at end of file +-- Variables that are used on both client and server +SWEP.Gun = ("m9k_remington7615p") -- must be the name of your swep but NO CAPITALS! +if (GetConVar(SWEP.Gun.."_allowed")) != nil then + if not (GetConVar(SWEP.Gun.."_allowed"):GetBool()) then SWEP.Base = "bobs_blacklisted" SWEP.PrintName = SWEP.Gun return end +end +SWEP.Category = "M9K Sniper Rifles" +SWEP.Author = "" +SWEP.Contact = "" +SWEP.Purpose = "" +SWEP.Instructions = "" +SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models +SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models +SWEP.PrintName = "Remington 7615P" -- Weapon name (Shown on HUD) +SWEP.Slot = 4 -- Slot in the weapon selection menu +SWEP.SlotPos = 46 -- Position in the slot +SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter +SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box +SWEP.BounceWeaponIcon = false -- Should the weapon icon bounce? +SWEP.DrawCrosshair = false -- Set false if you want no crosshair from hip +SWEP.XHair = false -- Used for returning crosshair after scope. Must be the same as DrawCrosshair +SWEP.Weight = 50 -- Rank relative ot other weapons. bigger is better +SWEP.AutoSwitchTo = true -- Auto switch to if we pick it up +SWEP.AutoSwitchFrom = false -- Auto switch from if you pick up a better weapon +SWEP.BoltAction = true -- Is this a bolt action rifle? +SWEP.HoldType = "ar2" -- how others view you carrying the weapon +-- normal melee melee2 fist knife smg ar2 pistol rpg physgun grenade shotgun crossbow slam passive +-- you're mostly going to use ar2, smg, shotgun or pistol. rpg and crossbow make for good sniper rifles + +SWEP.ViewModelFOV = 70 +SWEP.ViewModelFlip = true +SWEP.ViewModel = "models/weapons/v_remington_7615p.mdl" -- Weapon view model +SWEP.WorldModel = "models/weapons/w_remington_7615p.mdl" -- Weapon world model +SWEP.Base = "bobs_scoped_base" +SWEP.Spawnable = true +SWEP.AdminSpawnable = true + +SWEP.Primary.Sound = Sound("7615p_remington.Single") -- script that calls the primary fire sound +SWEP.Primary.RPM = 45 -- This is in Rounds Per Minute +SWEP.Primary.ClipSize = 5 -- Size of a clip +SWEP.Primary.DefaultClip = 60 -- Bullets you start with +SWEP.Primary.KickUp = 10 -- Maximum up recoil (rise) +SWEP.Primary.KickDown = 1 -- Maximum down recoil (skeet) +SWEP.Primary.KickHorizontal = 10 -- Maximum up recoil (stock) +SWEP.Primary.Automatic = false -- Automatic/Semi Auto +SWEP.Primary.Ammo = "ar2" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun +-- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets + +SWEP.Secondary.ScopeZoom = 7 +SWEP.Secondary.UseACOG = false -- Choose one scope type +SWEP.Secondary.UseMilDot = true -- I mean it, only one +SWEP.Secondary.UseSVD = false -- If you choose more than one, your scope will not show up at all +SWEP.Secondary.UseParabolic = false +SWEP.Secondary.UseElcan = false +SWEP.Secondary.UseGreenDuplex = false +SWEP.Secondary.UseAimpoint = false +SWEP.Secondary.UseMatador = false + +SWEP.data = {} +SWEP.data.ironsights = 1 +SWEP.ScopeScale = 0.7 +SWEP.ReticleScale = 0.6 + +SWEP.Primary.NumShots = 1 --how many bullets to shoot per trigger pull +SWEP.Primary.Damage = 100 --base damage per bullet +SWEP.Primary.Spread = 0.5 --define from-the-hip accuracy 1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = 0 -- ironsight accuracy, should be the same for shotguns + +-- enter iron sight info and bone mod info below + +SWEP.IronSightsPos = Vector(3.079, -1.333, 0.437) +SWEP.IronSightsAng = Vector(0, 0, 0) +SWEP.SightsPos = Vector(3.079, -1.333, 0.437) +SWEP.SightsAng = Vector(0, 0, 0) +SWEP.RunSightsPos = Vector (-2.3095, -3.0514, 2.3965) +SWEP.RunSightsAng = Vector (-19.8471, -33.9181, 10) + +if GetConVar("M9KDefaultClip") == nil then + print("M9KDefaultClip is missing! You may have hit the lua limit!") +else + if GetConVar("M9KDefaultClip"):GetInt() != -1 then + SWEP.Primary.DefaultClip = SWEP.Primary.ClipSize * GetConVar("M9KDefaultClip"):GetInt() + end +end + +if GetConVar("M9KUniqueSlots") != nil then + if not (GetConVar("M9KUniqueSlots"):GetBool()) then + SWEP.SlotPos = 2 + end +end +SWEP.Primary.KickUp = 10 +SWEP.Primary.Recoil = 0 \ No newline at end of file diff --git a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_remington870/shared.lua b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_remington870/shared.lua index a4c8c2a..d850625 100644 --- a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_remington870/shared.lua +++ b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_remington870/shared.lua @@ -1,80 +1,100 @@ --- Variables that are used on both client and server -SWEP.Gun = ("m9k_remington870") -- must be the name of your swep but NO CAPITALS! -if (GetConVar(SWEP.Gun.."_allowed")) != nil then - if not (GetConVar(SWEP.Gun.."_allowed"):GetBool()) then SWEP.Base = "bobs_blacklisted" SWEP.PrintName = SWEP.Gun return end -end -SWEP.Category = "M9K Shotguns" -SWEP.Author = "" -SWEP.Contact = "" -SWEP.Purpose = "" -SWEP.Instructions = "" -SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models -SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models -SWEP.PrintName = "Remington 870" -- Weapon name (Shown on HUD) -SWEP.Slot = 3 -- Slot in the weapon selection menu -SWEP.SlotPos = 26 -- Position in the slot -SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter -SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box -SWEP.BounceWeaponIcon = false -- Should the weapon icon bounce? -SWEP.DrawCrosshair = true -- set false if you want no crosshair -SWEP.Weight = 30 -- rank relative ot other weapons. bigger is better -SWEP.AutoSwitchTo = true -- Auto switch to if we pick it up -SWEP.AutoSwitchFrom = true -- Auto switch from if you pick up a better weapon -SWEP.HoldType = "shotgun" -- how others view you carrying the weapon --- normal melee melee2 fist knife smg ar2 pistol rpg physgun grenade shotgun crossbow slam passive --- you're mostly going to use ar2, smg, shotgun or pistol. rpg and crossbow make for good sniper rifles - -SWEP.ViewModelFOV = 70 -SWEP.ViewModelFlip = false -SWEP.ViewModel = "models/weapons/v_rem870tactical.mdl" -- Weapon view model -SWEP.WorldModel = "models/weapons/w_remington_870_tact.mdl" -- Weapon world model -SWEP.Base = "bobs_shotty_base" -SWEP.Spawnable = true -SWEP.AdminSpawnable = true - -SWEP.Primary.Sound = Sound("WepRem870.Single") -- script that calls the primary fire sound -SWEP.Primary.RPM = 70 -- This is in Rounds Per Minute -SWEP.Primary.ClipSize = 8 -- Size of a clip -SWEP.Primary.DefaultClip = 30 -- Default number of bullets in a clip -SWEP.Primary.KickUp = 1.25 -- Maximum up recoil (rise) -SWEP.Primary.KickDown = 0.8 -- Maximum down recoil (skeet) -SWEP.Primary.KickHorizontal = 0.4 -- Maximum up recoil (stock) -SWEP.Primary.Automatic = false -- Automatic/Semi Auto -SWEP.Primary.Ammo = "buckshot" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun --- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets - -SWEP.Secondary.IronFOV = 60 -- How much you 'zoom' in. Less is more! - -SWEP.data = {} --The starting firemode -SWEP.data.ironsights = 1 - -SWEP.ShellTime = .45 - -SWEP.Primary.NumShots = 9 -- How many bullets to shoot per trigger pull, AKA pellets -SWEP.Primary.Damage = 10 -- Base damage per bullet -SWEP.Primary.Spread = .035 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .035 -- Ironsight accuracy, should be the same for shotguns --- Because irons don't magically give you less pellet spread! - --- Enter iron sight info and bone mod info below -SWEP.IronSightsPos = Vector(-2.014, 0.1, 1.2) -SWEP.IronSightsAng = Vector(0.551, 0.028, 0) -SWEP.SightsPos = Vector(-2.014, 0.1, 1.2) -SWEP.SightsAng = Vector(0.551, 0.028, 0) -SWEP.RunSightsPos = Vector(6.534, -4.646, 1.654) -SWEP.RunSightsAng = Vector(-19.567, 68.622, 0) - - -if GetConVar("M9KDefaultClip") == nil then - print("M9KDefaultClip is missing! You may have hit the lua limit!") -else - if GetConVar("M9KDefaultClip"):GetInt() != -1 then - SWEP.Primary.DefaultClip = SWEP.Primary.ClipSize * GetConVar("M9KDefaultClip"):GetInt() - end -end - -if GetConVar("M9KUniqueSlots") != nil then - if not (GetConVar("M9KUniqueSlots"):GetBool()) then - SWEP.SlotPos = 2 - end -end \ No newline at end of file +-- Variables that are used on both client and server +SWEP.Gun = ("m9k_remington870") -- must be the name of your swep but NO CAPITALS! +if (GetConVar(SWEP.Gun.."_allowed")) != nil then + if not (GetConVar(SWEP.Gun.."_allowed"):GetBool()) then SWEP.Base = "bobs_blacklisted" SWEP.PrintName = SWEP.Gun return end +end +SWEP.Category = "M9K Shotguns" +SWEP.Author = "" +SWEP.Contact = "" +SWEP.Purpose = "" +SWEP.Instructions = "" +SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models +SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models +SWEP.PrintName = "Remington 870" -- Weapon name (Shown on HUD) +SWEP.Slot = 2 -- Slot in the weapon selection menu +SWEP.SlotPos = 26 -- Position in the slot +SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter +SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box +SWEP.BounceWeaponIcon = false -- Should the weapon icon bounce? +SWEP.DrawCrosshair = true -- set false if you want no crosshair +SWEP.Weight = 30 -- rank relative ot other weapons. bigger is better +SWEP.AutoSwitchTo = true -- Auto switch to if we pick it up +SWEP.AutoSwitchFrom = true -- Auto switch from if you pick up a better weapon +SWEP.HoldType = "shotgun" -- how others view you carrying the weapon +-- normal melee melee2 fist knife smg ar2 pistol rpg physgun grenade shotgun crossbow slam passive +-- you're mostly going to use ar2, smg, shotgun or pistol. rpg and crossbow make for good sniper rifles + +SWEP.ViewModelFOV = 70 +SWEP.ViewModelFlip = false +SWEP.ViewModel = "models/weapons/v_rem870tactical.mdl" -- Weapon view model +SWEP.WorldModel = "models/weapons/w_remington_870_tact.mdl" -- Weapon world model +SWEP.Base = "bobs_shotty_base" +SWEP.Spawnable = true +SWEP.AdminSpawnable = true + +SWEP.Primary.Sound = Sound("WepRem870.Single") -- script that calls the primary fire sound +SWEP.Primary.RPM = 50 -- This is in Rounds Per Minute +SWEP.Primary.ClipSize = 4 -- Size of a clip +SWEP.Primary.DefaultClip = 30 -- Default number of bullets in a clip +SWEP.Primary.KickUp = 1.25 -- Maximum up recoil (rise) +SWEP.Primary.KickDown = 0.8 -- Maximum down recoil (skeet) +SWEP.Primary.KickHorizontal = 0.4 -- Maximum up recoil (stock) +SWEP.Primary.Automatic = false -- Automatic/Semi Auto +SWEP.Primary.Ammo = "buckshot" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun +-- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets + +SWEP.Secondary.IronFOV = 60 -- How much you 'zoom' in. Less is more! + +SWEP.data = {} --The starting firemode +SWEP.data.ironsights = 1 + +SWEP.ShellTime = .3 + +SWEP.Primary.NumShots = 30 -- How many bullets to shoot per trigger pull, AKA pellets +SWEP.Primary.Damage = 4-- Base damage per bullet +SWEP.Primary.Spread = .04 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = .04 -- Ironsight accuracy, should be the same for shotguns +-- Because irons don't magically give you less pellet spread! + +-- Enter iron sight info and bone mod info below +SWEP.IronSightsPos = Vector(-2.014, 0.1, 1.2) +SWEP.IronSightsAng = Vector(0.551, 0.028, 0) +SWEP.SightsPos = Vector(-2.014, 0.1, 1.2) +SWEP.SightsAng = Vector(0.551, 0.028, 0) +SWEP.RunSightsPos = Vector(6.534, -4.646, 1.654) +SWEP.RunSightsAng = Vector(-19.567, 68.622, 0) + + +if GetConVar("M9KDefaultClip") == nil then + print("M9KDefaultClip is missing! You may have hit the lua limit!") +else + if GetConVar("M9KDefaultClip"):GetInt() != -1 then + SWEP.Primary.DefaultClip = SWEP.Primary.ClipSize * GetConVar("M9KDefaultClip"):GetInt() + end +end + +if GetConVar("M9KUniqueSlots") != nil then + if not (GetConVar("M9KUniqueSlots"):GetBool()) then + SWEP.SlotPos = 2 + end +end +function SWEP:ShootBullet( DirX, DirY, DirZ ) + + local bullet = {} + bullet.Num = 1 + bullet.Src = self.Owner:GetShootPos() -- Source + bullet.Dir = self.Owner:GetAimVector() + (self.Owner:GetAimVector():Angle():Right()*DirX) + (self.Owner:GetAimVector():Angle():Up()*DirY) -- Dir of bullet + bullet.Spread = Vector(0,0,0) -- Aim Cone + bullet.Tracer = 1 -- Show a tracer on every x bullets + bullet.Force = 1 -- Amount of force to give to phys objects + bullet.Damage = 9 + bullet.AmmoType = self.Primary.Ammo + bullet.HullSize = 0 + + self.Owner:FireBullets( bullet ) + + self:ShootEffects() + +end +SWEP.Primary.KickUp = 0 +SWEP.Primary.Recoil = 0 \ No newline at end of file diff --git a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_sl8/shared.lua b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_sl8/shared.lua index 1c929b9..ec13824 100644 --- a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_sl8/shared.lua +++ b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_sl8/shared.lua @@ -11,7 +11,7 @@ SWEP.Instructions = "" SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models SWEP.PrintName = "HK SL8" -- Weapon name (Shown on HUD) -SWEP.Slot = 3 -- Slot in the weapon selection menu +SWEP.Slot = 4 -- Slot in the weapon selection menu SWEP.SlotPos = 47 -- Position in the slot SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box @@ -38,9 +38,9 @@ SWEP.Primary.Sound = Sound("Weapon_hksl8.Single") -- script that calls the pr SWEP.Primary.RPM = 300 -- This is in Rounds Per Minute SWEP.Primary.ClipSize = 30 -- Size of a clip SWEP.Primary.DefaultClip = 60 -- Bullets you start with -SWEP.Primary.KickUp = .6 -- Maximum up recoil (rise) -SWEP.Primary.KickDown = .6 -- Maximum down recoil (skeet) -SWEP.Primary.KickHorizontal = .6 -- Maximum up recoil (stock) +SWEP.Primary.KickUp = 1 -- Maximum up recoil (rise) +SWEP.Primary.KickDown = 1 -- Maximum down recoil (skeet) +SWEP.Primary.KickHorizontal = 1 -- Maximum up recoil (stock) SWEP.Primary.Automatic = true -- Automatic/Semi Auto SWEP.Primary.Ammo = "ar2" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun -- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets @@ -62,9 +62,9 @@ SWEP.ScopeScale = 0.9 SWEP.ReticleScale = 0.7 SWEP.Primary.NumShots = 1 --how many bullets to shoot per trigger pull -SWEP.Primary.Damage = 60 --base damage per bullet -SWEP.Primary.Spread = .015 --define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .001 -- ironsight accuracy, should be the same for shotguns +SWEP.Primary.Damage = 40 --base damage per bullet +SWEP.Primary.Spread = 0.5 --define from-the-hip accuracy 1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = 0 -- ironsight accuracy, should be the same for shotguns -- enter iron sight info and bone mod info below @@ -87,4 +87,6 @@ if GetConVar("M9KUniqueSlots") != nil then if not (GetConVar("M9KUniqueSlots"):GetBool()) then SWEP.SlotPos = 2 end -end \ No newline at end of file +end +SWEP.Primary.KickUp = 3 +SWEP.Primary.Recoil = 0 \ No newline at end of file diff --git a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_spas12/shared.lua b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_spas12/shared.lua index 2d235cd..8d64d67 100644 --- a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_spas12/shared.lua +++ b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_spas12/shared.lua @@ -11,7 +11,7 @@ SWEP.Instructions = "" SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models SWEP.PrintName = "SPAS 12" -- Weapon name (Shown on HUD) -SWEP.Slot = 3 -- Slot in the weapon selection menu +SWEP.Slot = 2 -- Slot in the weapon selection menu SWEP.SlotPos = 27 -- Position in the slot SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box @@ -44,15 +44,15 @@ SWEP.Primary.Ammo = "buckshot" -- pistol, 357, smg1, ar2, buckshot, slam, Snip -- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets SWEP.Secondary.IronFOV = 60 -- How much you 'zoom' in. Less is more! -SWEP.ShellTime = .4 +SWEP.ShellTime = .3 SWEP.data = {} --The starting firemode SWEP.data.ironsights = 1 -SWEP.Primary.NumShots = 10 -- How many bullets to shoot per trigger pull, AKA pellets -SWEP.Primary.Damage = 10 -- Base damage per bullet -SWEP.Primary.Spread = .03 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .03 -- Ironsight accuracy, should be the same for shotguns +SWEP.Primary.NumShots = 60 -- How many bullets to shoot per trigger pull, AKA pellets +SWEP.Primary.Damage = 1 -- Base damage per bullet +SWEP.Primary.Spread = .06 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = .06 -- Ironsight accuracy, should be the same for shotguns -- Because irons don't magically give you less pellet spread! -- Enter iron sight info and bone mod info below @@ -77,4 +77,24 @@ if GetConVar("M9KUniqueSlots") != nil then if not (GetConVar("M9KUniqueSlots"):GetBool()) then SWEP.SlotPos = 2 end -end \ No newline at end of file +end +function SWEP:ShootBullet( DirX, DirY, DirZ ) + + local bullet = {} + bullet.Num = 1 + bullet.Src = self.Owner:GetShootPos() -- Source + bullet.Dir = self.Owner:GetAimVector() + (self.Owner:GetAimVector():Angle():Right()*DirX) + (self.Owner:GetAimVector():Angle():Up()*DirY) -- Dir of bullet + bullet.Spread = Vector(0,0,0) -- Aim Cone + bullet.Tracer = 1 -- Show a tracer on every x bullets + bullet.Force = 1 -- Amount of force to give to phys objects + bullet.Damage = 6 + bullet.AmmoType = self.Primary.Ammo + bullet.HullSize = 0 + + self.Owner:FireBullets( bullet ) + + self:ShootEffects() + +end +SWEP.Primary.KickUp = 0 +SWEP.Primary.Recoil = 0 \ No newline at end of file diff --git a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_striker12/shared.lua b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_striker12/shared.lua index b7147cc..68bd051 100644 --- a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_striker12/shared.lua +++ b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_striker12/shared.lua @@ -1,74 +1,130 @@ --- Variables that are used on both client and server -SWEP.Gun = ("m9k_striker12") -- must be the name of your swep -if (GetConVar(SWEP.Gun.."_allowed")) != nil then - if not (GetConVar(SWEP.Gun.."_allowed"):GetBool()) then SWEP.Base = "bobs_blacklisted" SWEP.PrintName = SWEP.Gun return end -end -SWEP.Category = "M9K Shotguns" -SWEP.Author = "" -SWEP.Contact = "" -SWEP.Purpose = "" -SWEP.Instructions = "" -SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models -SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models -SWEP.PrintName = "Striker 12" -- Weapon name (Shown on HUD) -SWEP.Slot = 3 -- Slot in the weapon selection menu -SWEP.SlotPos = 28 -- Position in the slot -SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter -SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box -SWEP.BounceWeaponIcon = false -- Should the weapon icon bounce? -SWEP.DrawCrosshair = true -- set false if you want no crosshair -SWEP.Weight = 30 -- rank relative to other weapons. bigger is better -SWEP.AutoSwitchTo = true -- Auto switch to if we pick it up -SWEP.AutoSwitchFrom = true -- Auto switch from if you pick up a better weapon -SWEP.HoldType = "ar2" - -SWEP.ViewModelFOV = 70 -SWEP.ViewModelFlip = true -SWEP.ViewModel = "models/weapons/v_striker_12g.mdl" -- Weapon view model -SWEP.WorldModel = "models/weapons/w_striker_12g.mdl" -- Weapon world model -SWEP.Base = "bobs_shotty_base" -SWEP.Spawnable = true -SWEP.AdminSpawnable = true - -SWEP.Primary.Sound = Sound("ShotStriker12.Single") -- script that calls the primary fire sound -SWEP.Primary.RPM = 365 -- This is in Rounds Per Minute -SWEP.Primary.ClipSize = 12 -- Size of a clip -SWEP.Primary.DefaultClip = 36 -- Default number of bullets in a clip -SWEP.Primary.KickUp = 4 -- Maximum up recoil (rise) -SWEP.Primary.KickDown = 0.5 -- Maximum down recoil (skeet) -SWEP.Primary.KickHorizontal = .6 -- Maximum up recoil (stock) -SWEP.Primary.Automatic = true -- Automatic/Semi Auto -SWEP.Primary.Ammo = "buckshot" - -SWEP.Secondary.IronFOV = 60 -- How much you 'zoom' in. Less is more! - -SWEP.ShellTime = .3 - -SWEP.Primary.NumShots = 6 -- How many bullets to shoot per trigger pull, AKA pellets -SWEP.Primary.Damage = 8 -- Base damage per bullet -SWEP.Primary.Spread = .04 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .04 -- Ironsight accuracy, should be the same for shotguns --- Because irons don't magically give you less pellet spread! - --- Enter iron sight info and bone mod info below -SWEP.IronSightsPos = Vector(3.805, -1.045, 1.805) -SWEP.IronSightsAng = Vector(2.502, 3.431, 0) -SWEP.SightsPos = Vector(3.805, -1.045, 1.805) -SWEP.SightsAng = Vector(2.502, 3.431, 0) -SWEP.RunSightsPos = Vector(-3.237, -6.376, 1.167) -SWEP.RunSightsAng = Vector(-8.391, -63.543, 0) - - -if GetConVar("M9KDefaultClip") == nil then - print("M9KDefaultClip is missing! You may have hit the lua limit!") -else - if GetConVar("M9KDefaultClip"):GetInt() != -1 then - SWEP.Primary.DefaultClip = SWEP.Primary.ClipSize * GetConVar("M9KDefaultClip"):GetInt() - end -end - -if GetConVar("M9KUniqueSlots") != nil then - if not (GetConVar("M9KUniqueSlots"):GetBool()) then - SWEP.SlotPos = 2 - end -end \ No newline at end of file +-- Variables that are used on both client and server +SWEP.Gun = ("m9k_striker12") -- must be the name of your swep +if (GetConVar(SWEP.Gun.."_allowed")) != nil then + if not (GetConVar(SWEP.Gun.."_allowed"):GetBool()) then SWEP.Base = "bobs_blacklisted" SWEP.PrintName = SWEP.Gun return end +end +SWEP.Category = "M9K Shotguns" +SWEP.Author = "" +SWEP.Contact = "" +SWEP.Purpose = "" +SWEP.Instructions = "" +SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models +SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models +SWEP.PrintName = "Striker 12" -- Weapon name (Shown on HUD) +SWEP.Slot = 2 -- Slot in the weapon selection menu +SWEP.SlotPos = 28 -- Position in the slot +SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter +SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box +SWEP.BounceWeaponIcon = false -- Should the weapon icon bounce? +SWEP.DrawCrosshair = true -- set false if you want no crosshair +SWEP.Weight = 30 -- rank relative to other weapons. bigger is better +SWEP.AutoSwitchTo = true -- Auto switch to if we pick it up +SWEP.AutoSwitchFrom = true -- Auto switch from if you pick up a better weapon +SWEP.HoldType = "ar2" + +SWEP.ViewModelFOV = 70 +SWEP.ViewModelFlip = true +SWEP.ViewModel = "models/weapons/v_striker_12g.mdl" -- Weapon view model +SWEP.WorldModel = "models/weapons/w_striker_12g.mdl" -- Weapon world model +SWEP.Base = "bobs_shotty_base" +SWEP.Spawnable = true +SWEP.AdminSpawnable = true + +SWEP.Primary.Sound = Sound("ShotStriker12.Single") -- script that calls the primary fire sound +SWEP.Primary.RPM = 300 -- This is in Rounds Per Minute +SWEP.Primary.ClipSize = 6 -- Size of a clip +SWEP.Primary.DefaultClip = 36 -- Default number of bullets in a clip +SWEP.Primary.KickUp = 4 -- Maximum up recoil (rise) +SWEP.Primary.KickDown = 0.5 -- Maximum down recoil (skeet) +SWEP.Primary.KickHorizontal = .6 -- Maximum up recoil (stock) +SWEP.Primary.Automatic = true -- Automatic/Semi Auto +SWEP.Primary.Ammo = "buckshot" + +SWEP.Secondary.IronFOV = 60 -- How much you 'zoom' in. Less is more! + +SWEP.ShellTime = .3 + +SWEP.Primary.NumShots = 60 -- How many bullets to shoot per trigger pull, AKA pellets +SWEP.Primary.Damage = 1 -- Base damage per bullet +SWEP.Primary.Spread = .06 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = .06 -- Ironsight accuracy, should be the same for shotguns +-- Because irons don't magically give you less pellet spread! + +-- Enter iron sight info and bone mod info below +SWEP.IronSightsPos = Vector(3.805, -1.045, 1.805) +SWEP.IronSightsAng = Vector(2.502, 3.431, 0) +SWEP.SightsPos = Vector(3.805, -1.045, 1.805) +SWEP.SightsAng = Vector(2.502, 3.431, 0) +SWEP.RunSightsPos = Vector(-3.237, -6.376, 1.167) +SWEP.RunSightsAng = Vector(-8.391, -63.543, 0) + + +if GetConVar("M9KDefaultClip") == nil then + print("M9KDefaultClip is missing! You may have hit the lua limit!") +else + if GetConVar("M9KDefaultClip"):GetInt() != -1 then + SWEP.Primary.DefaultClip = SWEP.Primary.ClipSize * GetConVar("M9KDefaultClip"):GetInt() + end +end + +if GetConVar("M9KUniqueSlots") != nil then + if not (GetConVar("M9KUniqueSlots"):GetBool()) then + SWEP.SlotPos = 2 + end +end +function SWEP:ShootBullet( DirX, DirY, DirZ ) + + local bullet = {} + bullet.Num = 1 + bullet.Src = self.Owner:GetShootPos() -- Source + bullet.Dir = self.Owner:GetAimVector() + (self.Owner:GetAimVector():Angle():Right()*DirX) + (self.Owner:GetAimVector():Angle():Up()*DirY) -- Dir of bullet + bullet.Spread = Vector(0,0,0) -- Aim Cone + bullet.Tracer = 1 -- Show a tracer on every x bullets + bullet.Force = 1 -- Amount of force to give to phys objects + bullet.Damage = 6 + bullet.AmmoType = self.Primary.Ammo + bullet.HullSize = 0 + + self.Owner:FireBullets( bullet ) + + self:ShootEffects() + +end + +function SWEP:PrimaryAttack() + + -- Make sure we can shoot first + if ( !self:CanPrimaryAttack() ) then return end + + -- Play shoot sound + self:EmitSound(self.Primary.Sound) + + self:ShootBullet(0,0,0) + self:ShootBullet(0,0,0) + self:ShootBullet(0.015,0,0) + self:ShootBullet(-0.015,0,0) + self:ShootBullet(0,0.015,0) + self:ShootBullet(0,-0.015,0) + self:ShootBullet(0.015,0.015,0) + self:ShootBullet(-0.015,0.015,0) + self:ShootBullet(-0.015,-0.015,0) + self:ShootBullet(0.015,-0.015,0) + + -- Remove 1 bullet from our clip + self:TakePrimaryAmmo( 1 ) + + + + if CLIENT and !game.SinglePlayer() and !self.Owner:IsNPC() then + + local anglo = Angle(-self.Primary.Recoil) + local eyes = self.Owner:EyeAngles() + eyes.pitch = eyes.pitch + (anglo.pitch/3) + eyes.yaw = eyes.yaw + (anglo.yaw/3) + self.Owner:SetEyeAngles(eyes) + end + + self.Weapon:SetNextPrimaryFire(CurTime()+1/(self.Primary.RPM/60)) +end +SWEP.Primary.KickUp = 0 +SWEP.Primary.Recoil = 0 \ No newline at end of file diff --git a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_svt40/shared.lua b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_svt40/shared.lua index 4206a30..74cac1c 100644 --- a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_svt40/shared.lua +++ b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_svt40/shared.lua @@ -11,7 +11,7 @@ SWEP.Instructions = "" SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models SWEP.PrintName = "SVT 40" -- Weapon name (Shown on HUD) -SWEP.Slot = 3 -- Slot in the weapon selection menu +SWEP.Slot = 4 -- Slot in the weapon selection menu SWEP.SlotPos = 48 -- Position in the slot SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box @@ -61,9 +61,9 @@ SWEP.ScopeScale = 0.7 SWEP.ReticleScale = 0.6 SWEP.Primary.NumShots = 1 --how many bullets to shoot per trigger pull -SWEP.Primary.Damage = 80 --base damage per bullet -SWEP.Primary.Spread = .01 --define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .0001 -- ironsight accuracy, should be the same for shotguns +SWEP.Primary.Damage = 50 --base damage per bullet +SWEP.Primary.Spread = .5 --define from-the-hip accuracy 1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = 0 -- ironsight accuracy, should be the same for shotguns -- enter iron sight info and bone mod info below @@ -88,4 +88,6 @@ if GetConVar("M9KUniqueSlots") != nil then if not (GetConVar("M9KUniqueSlots"):GetBool()) then SWEP.SlotPos = 2 end -end \ No newline at end of file +end +SWEP.Primary.KickUp = 5 +SWEP.Primary.Recoil = 0 \ No newline at end of file diff --git a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_svu/shared.lua b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_svu/shared.lua index 614f6fb..adc75e1 100644 --- a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_svu/shared.lua +++ b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_svu/shared.lua @@ -11,7 +11,7 @@ SWEP.Instructions = "" SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models SWEP.PrintName = "Dragunov SVU" -- Weapon name (Shown on HUD) -SWEP.Slot = 3 -- Slot in the weapon selection menu +SWEP.Slot = 4 -- Slot in the weapon selection menu SWEP.SlotPos = 49 -- Position in the slot SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box @@ -61,9 +61,9 @@ SWEP.ScopeScale = 0.7 SWEP.ReticleScale = 0.6 SWEP.Primary.NumShots = 1 --how many bullets to shoot per trigger pull -SWEP.Primary.Damage = 93 --base damage per bullet -SWEP.Primary.Spread = .01 --define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .0001 -- ironsight accuracy, should be the same for shotguns +SWEP.Primary.Damage = 50 --base damage per bullet +SWEP.Primary.Spread = .5 --define from-the-hip accuracy 1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = 0 -- ironsight accuracy, should be the same for shotguns -- enter iron sight info and bone mod info below @@ -86,4 +86,6 @@ if GetConVar("M9KUniqueSlots") != nil then if not (GetConVar("M9KUniqueSlots"):GetBool()) then SWEP.SlotPos = 2 end -end \ No newline at end of file +end +SWEP.Primary.KickUp = 5 +SWEP.Primary.Recoil = 0 \ No newline at end of file diff --git a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_usas/shared.lua b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_usas/shared.lua index 5303b9f..dfc93b6 100644 --- a/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_usas/shared.lua +++ b/m9k_heavy_weapons_fatal_edition/lua/weapons/m9k_usas/shared.lua @@ -1,149 +1,205 @@ --- Variables that are used on both client and server -SWEP.Gun = ("m9k_usas") -- must be the name of your swep but NO CAPITALS! -if (GetConVar(SWEP.Gun.."_allowed")) != nil then - if not (GetConVar(SWEP.Gun.."_allowed"):GetBool()) then SWEP.Base = "bobs_blacklisted" SWEP.PrintName = SWEP.Gun return end -end -SWEP.Category = "M9K Shotguns" -SWEP.Author = "" -SWEP.Contact = "" -SWEP.Purpose = "" -SWEP.Instructions = "" -SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models -SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models -SWEP.PrintName = "USAS" -- Weapon name (Shown on HUD) -SWEP.Slot = 3 -- Slot in the weapon selection menu -SWEP.SlotPos = 29 -- Position in the slot -SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter -SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box -SWEP.BounceWeaponIcon = false -- Should the weapon icon bounce? -SWEP.DrawCrosshair = true -- set false if you want no crosshair -SWEP.Weight = 30 -- rank relative ot other weapons. bigger is better -SWEP.AutoSwitchTo = true -- Auto switch to if we pick it up -SWEP.AutoSwitchFrom = true -- Auto switch from if you pick up a better weapon -SWEP.HoldType = "ar2" -- how others view you carrying the weapon --- normal melee melee2 fist knife smg ar2 pistol rpg physgun grenade shotgun crossbow slam passive --- you're mostly going to use ar2, smg, shotgun or pistol. rpg and crossbow make for good sniper rifles - -SWEP.ViewModelFOV = 70 -SWEP.ViewModelFlip = true -SWEP.ViewModel = "models/weapons/v_usas12_shot.mdl" -- Weapon view model -SWEP.WorldModel = "models/weapons/w_usas_12.mdl" -- Weapon world model -SWEP.Base = "bobs_gun_base" -SWEP.Spawnable = true -SWEP.AdminSpawnable = true - -SWEP.Primary.Sound = Sound("Weapon_usas.Single") -- Script that calls the primary fire sound -SWEP.Primary.RPM = 260 -- This is in Rounds Per Minute -SWEP.Primary.ClipSize = 20 -- Size of a clip -SWEP.Primary.DefaultClip = 60 -- Bullets you start with -SWEP.Primary.KickUp = 1 -- Maximum up recoil (rise) -SWEP.Primary.KickDown = 0.4 -- Maximum down recoil (skeet) -SWEP.Primary.KickHorizontal = 0.7 -- Maximum up recoil (stock) -SWEP.Primary.Automatic = true -- Automatic = true; Semi Auto = false -SWEP.Primary.Ammo = "buckshot" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun --- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets - -SWEP.SelectiveFire = true - -SWEP.Secondary.IronFOV = 55 -- How much you 'zoom' in. Less is more! - -SWEP.data = {} --The starting firemode -SWEP.data.ironsights = 1 - -SWEP.Primary.NumShots = 10 -- How many bullets to shoot per trigger pull -SWEP.Primary.Damage = 7 -- Base damage per bullet -SWEP.Primary.Spread = .048 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) -SWEP.Primary.IronAccuracy = .048 -- Ironsight accuracy, should be the same for shotguns - --- Enter iron sight info and bone mod info below -SWEP.IronSightsPos = Vector(4.519, -2.159, 1.039) -SWEP.IronSightsAng = Vector(0.072, 0.975, 0) -SWEP.SightsPos = Vector(4.519, -2.159, 1.039) -SWEP.SightsAng = Vector(0.072, 0.975, 0) -SWEP.RunSightsPos = Vector (-3.0328, 0, 1.888) -SWEP.RunSightsAng = Vector (-24.2146, -36.522, 10) - -SWEP.ReloadPos = Vector (-3.0328, 0, 1.888) -SWEP.ReloadsAng = Vector (-24.2146, -36.522, 10) - -SWEP.WElements = { - ["fix2"] = { type = "Model", model = "models/hunter/blocks/cube025x05x025.mdl", bone = "ValveBiped.Bip01_R_Hand", rel = "", pos = Vector(22.416, 2.073, -5.571), angle = Angle(0, 0, -90), size = Vector(0.899, 0.118, 0.1), color = Color(0, 0, 0, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} }, - ["magfix"] = { type = "Model", model = "models/XQM/cylinderx1.mdl", bone = "ValveBiped.Bip01_R_Hand", rel = "", pos = Vector(10.482, 1.389, 0.078), angle = Angle(-8.098, 0, 0), size = Vector(0.2, 0.589, 0.589), color = Color(0, 0, 0, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} } -} - -function SWEP:Reload() - - if ( self.Weapon:Clip1() < self.Primary.ClipSize ) and (self.Owner:GetAmmoCount("buckshot") > 0 ) and not (self.Weapon:GetNWBool("Reloading")) then - self.Weapon:SendWeaponAnim(ACT_SHOTGUN_RELOAD_START) - self.Weapon:SetNWBool("Reloading", true) - if SERVER and !self.Owner:IsNPC() then - self.ResetSights = CurTime() + 1.65 - self.Owner:SetFOV( 0, 0.3 ) - self:SetIronsights(false) - end - timer.Simple(.65, function() if not IsValid(self) then return end if not IsValid(self.Owner) then return end if not IsValid(self.Weapon) then return end - if IsValid(self.Owner) and self.Weapon:GetClass() == self.Gun then - self.Weapon:EmitSound(Sound("Weapon_usas.draw")) - end - end) - timer.Simple(.8, function() if not IsValid(self) then return end if not IsValid(self.Owner) then return end if not IsValid(self.Weapon) then return end - if IsValid(self.Owner) and self.Weapon != nil then self:ReloadFinish() end end) - end - -end - -function SWEP:ReloadFinish() -if not IsValid(self) then return end - if IsValid(self.Owner) and self.Weapon != nil then - if self.Owner:Alive() and self.Weapon:GetClass() == self.Gun then - self.Weapon:DefaultReload(ACT_SHOTGUN_RELOAD_FINISH) - - if !self.Owner:IsNPC() then - self.ResetSights = CurTime() + self.Owner:GetViewModel():SequenceDuration() - end - if SERVER and self.Weapon != nil then - if ( self.Weapon:Clip1() < self.Primary.ClipSize ) and !self.Owner:IsNPC() then - self.Owner:SetFOV( 0, 0.3 ) - self:SetIronsights(false) - end - - local waitdammit = (self.Owner:GetViewModel():SequenceDuration()) - timer.Simple(waitdammit + .1, - function() if not IsValid(self) then return end if not IsValid(self.Owner) then return end if not IsValid(self.Weapon) then return end - if self.Weapon == nil then return end - self.Weapon:SetNWBool("Reloading", false) - if self.Owner:KeyDown(IN_ATTACK2) and self.Weapon:GetClass() == self.Gun then - if CLIENT then return end - if self.Scoped == false then - self.Owner:SetFOV( self.Secondary.IronFOV, 0.3 ) - self.IronSightsPos = self.SightsPos -- Bring it up - self.IronSightsAng = self.SightsAng -- Bring it up - self:SetIronsights(true, self.Owner) - self.DrawCrosshair = false - else return end - elseif self.Owner:KeyDown(IN_SPEED) and self.Weapon:GetClass() == self.Gun then - self.Weapon:SetNextPrimaryFire(CurTime()+0.3) -- Make it so you can't shoot for another quarter second - self.IronSightsPos = self.RunSightsPos -- Hold it down - self.IronSightsAng = self.RunSightsAng -- Hold it down - self:SetIronsights(true, self.Owner) -- Set the ironsight true - self.Owner:SetFOV( 0, 0.3 ) - else return end - end) - end - end - end -end - -if GetConVar("M9KDefaultClip") == nil then - print("M9KDefaultClip is missing! You may have hit the lua limit!") -else - if GetConVar("M9KDefaultClip"):GetInt() != -1 then - SWEP.Primary.DefaultClip = SWEP.Primary.ClipSize * GetConVar("M9KDefaultClip"):GetInt() - end -end - -if GetConVar("M9KUniqueSlots") != nil then - if not (GetConVar("M9KUniqueSlots"):GetBool()) then - SWEP.SlotPos = 2 - end -end \ No newline at end of file +-- Variables that are used on both client and server +SWEP.Gun = ("m9k_usas") -- must be the name of your swep but NO CAPITALS! +if (GetConVar(SWEP.Gun.."_allowed")) != nil then + if not (GetConVar(SWEP.Gun.."_allowed"):GetBool()) then SWEP.Base = "bobs_blacklisted" SWEP.PrintName = SWEP.Gun return end +end +SWEP.Category = "M9K Shotguns" +SWEP.Author = "" +SWEP.Contact = "" +SWEP.Purpose = "" +SWEP.Instructions = "" +SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models +SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models +SWEP.PrintName = "USAS" -- Weapon name (Shown on HUD) +SWEP.Slot = 2 -- Slot in the weapon selection menu +SWEP.SlotPos = 29 -- Position in the slot +SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter +SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box +SWEP.BounceWeaponIcon = false -- Should the weapon icon bounce? +SWEP.DrawCrosshair = true -- set false if you want no crosshair +SWEP.Weight = 30 -- rank relative ot other weapons. bigger is better +SWEP.AutoSwitchTo = true -- Auto switch to if we pick it up +SWEP.AutoSwitchFrom = true -- Auto switch from if you pick up a better weapon +SWEP.HoldType = "ar2" -- how others view you carrying the weapon +-- normal melee melee2 fist knife smg ar2 pistol rpg physgun grenade shotgun crossbow slam passive +-- you're mostly going to use ar2, smg, shotgun or pistol. rpg and crossbow make for good sniper rifles + +SWEP.ViewModelFOV = 70 +SWEP.ViewModelFlip = true +SWEP.ViewModel = "models/weapons/v_usas12_shot.mdl" -- Weapon view model +SWEP.WorldModel = "models/weapons/w_usas_12.mdl" -- Weapon world model +SWEP.Base = "bobs_gun_base" +SWEP.Spawnable = true +SWEP.AdminSpawnable = true + +SWEP.Primary.Sound = Sound("Weapon_usas.Single") -- Script that calls the primary fire sound +SWEP.Primary.RPM = 260 -- This is in Rounds Per Minute +SWEP.Primary.ClipSize = 20 -- Size of a clip +SWEP.Primary.DefaultClip = 60 -- Bullets you start with +SWEP.Primary.KickUp = 1 -- Maximum up recoil (rise) +SWEP.Primary.KickDown = 0.4 -- Maximum down recoil (skeet) +SWEP.Primary.KickHorizontal = 0.7 -- Maximum up recoil (stock) +SWEP.Primary.Automatic = true -- Automatic = true; Semi Auto = false +SWEP.Primary.Ammo = "buckshot" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun +-- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets + +SWEP.SelectiveFire = true + +SWEP.Secondary.IronFOV = 55 -- How much you 'zoom' in. Less is more! + +SWEP.data = {} --The starting firemode +SWEP.data.ironsights = 1 + +SWEP.Primary.NumShots = 60 -- How many bullets to shoot per trigger pull +SWEP.Primary.Damage = 1 -- Base damage per bullet +SWEP.Primary.Spread = .06 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact) +SWEP.Primary.IronAccuracy = .06 -- Ironsight accuracy, should be the same for shotguns + +-- Enter iron sight info and bone mod info below +SWEP.IronSightsPos = Vector(4.519, -2.159, 1.039) +SWEP.IronSightsAng = Vector(0.072, 0.975, 0) +SWEP.SightsPos = Vector(4.519, -2.159, 1.039) +SWEP.SightsAng = Vector(0.072, 0.975, 0) +SWEP.RunSightsPos = Vector (-3.0328, 0, 1.888) +SWEP.RunSightsAng = Vector (-24.2146, -36.522, 10) + +SWEP.ReloadPos = Vector (-3.0328, 0, 1.888) +SWEP.ReloadsAng = Vector (-24.2146, -36.522, 10) + +SWEP.WElements = { + ["fix2"] = { type = "Model", model = "models/hunter/blocks/cube025x05x025.mdl", bone = "ValveBiped.Bip01_R_Hand", rel = "", pos = Vector(22.416, 2.073, -5.571), angle = Angle(0, 0, -90), size = Vector(0.899, 0.118, 0.1), color = Color(0, 0, 0, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} }, + ["magfix"] = { type = "Model", model = "models/XQM/cylinderx1.mdl", bone = "ValveBiped.Bip01_R_Hand", rel = "", pos = Vector(10.482, 1.389, 0.078), angle = Angle(-8.098, 0, 0), size = Vector(0.2, 0.589, 0.589), color = Color(0, 0, 0, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} } +} + +function SWEP:Reload() + + if ( self.Weapon:Clip1() < self.Primary.ClipSize ) and (self.Owner:GetAmmoCount("buckshot") > 0 ) and not (self.Weapon:GetNWBool("Reloading")) then + self.Weapon:SendWeaponAnim(ACT_SHOTGUN_RELOAD_START) + self.Weapon:SetNWBool("Reloading", true) + if SERVER and !self.Owner:IsNPC() then + self.ResetSights = CurTime() + 1.65 + self.Owner:SetFOV( 0, 0.3 ) + self:SetIronsights(false) + end + timer.Simple(.65, function() if not IsValid(self) then return end if not IsValid(self.Owner) then return end if not IsValid(self.Weapon) then return end + if IsValid(self.Owner) and self.Weapon:GetClass() == self.Gun then + self.Weapon:EmitSound(Sound("Weapon_usas.draw")) + end + end) + timer.Simple(.8, function() if not IsValid(self) then return end if not IsValid(self.Owner) then return end if not IsValid(self.Weapon) then return end + if IsValid(self.Owner) and self.Weapon != nil then self:ReloadFinish() end end) + end + +end + +function SWEP:ReloadFinish() +if not IsValid(self) then return end + if IsValid(self.Owner) and self.Weapon != nil then + if self.Owner:Alive() and self.Weapon:GetClass() == self.Gun then + self.Weapon:DefaultReload(ACT_SHOTGUN_RELOAD_FINISH) + + if !self.Owner:IsNPC() then + self.ResetSights = CurTime() + self.Owner:GetViewModel():SequenceDuration() + end + if SERVER and self.Weapon != nil then + if ( self.Weapon:Clip1() < self.Primary.ClipSize ) and !self.Owner:IsNPC() then + self.Owner:SetFOV( 0, 0.3 ) + self:SetIronsights(false) + end + + local waitdammit = (self.Owner:GetViewModel():SequenceDuration()) + timer.Simple(waitdammit + .1, + function() if not IsValid(self) then return end if not IsValid(self.Owner) then return end if not IsValid(self.Weapon) then return end + if self.Weapon == nil then return end + self.Weapon:SetNWBool("Reloading", false) + if self.Owner:KeyDown(IN_ATTACK2) and self.Weapon:GetClass() == self.Gun then + if CLIENT then return end + if self.Scoped == false then + self.Owner:SetFOV( self.Secondary.IronFOV, 0.3 ) + self.IronSightsPos = self.SightsPos -- Bring it up + self.IronSightsAng = self.SightsAng -- Bring it up + self:SetIronsights(true, self.Owner) + self.DrawCrosshair = false + else return end + elseif self.Owner:KeyDown(IN_SPEED) and self.Weapon:GetClass() == self.Gun then + self.Weapon:SetNextPrimaryFire(CurTime()+0.3) -- Make it so you can't shoot for another quarter second + self.IronSightsPos = self.RunSightsPos -- Hold it down + self.IronSightsAng = self.RunSightsAng -- Hold it down + self:SetIronsights(true, self.Owner) -- Set the ironsight true + self.Owner:SetFOV( 0, 0.3 ) + else return end + end) + end + end + end +end + +if GetConVar("M9KDefaultClip") == nil then + print("M9KDefaultClip is missing! You may have hit the lua limit!") +else + if GetConVar("M9KDefaultClip"):GetInt() != -1 then + SWEP.Primary.DefaultClip = SWEP.Primary.ClipSize * GetConVar("M9KDefaultClip"):GetInt() + end +end + +if GetConVar("M9KUniqueSlots") != nil then + if not (GetConVar("M9KUniqueSlots"):GetBool()) then + SWEP.SlotPos = 2 + end +end +function SWEP:ShootBullet( DirX, DirY, DirZ ) + + local bullet = {} + bullet.Num = 1 + bullet.Src = self.Owner:GetShootPos() -- Source + bullet.Dir = self.Owner:GetAimVector() + (self.Owner:GetAimVector():Angle():Right()*DirX) + (self.Owner:GetAimVector():Angle():Up()*DirY) -- Dir of bullet + bullet.Spread = Vector(0,0,0) -- Aim Cone + bullet.Tracer = 1 -- Show a tracer on every x bullets + bullet.Force = 1 -- Amount of force to give to phys objects + bullet.Damage = 4 + bullet.AmmoType = self.Primary.Ammo + bullet.HullSize = 0 + + self.Owner:FireBullets( bullet ) + + self:ShootEffects() + +end + +function SWEP:PrimaryAttack() + + -- Make sure we can shoot first + if ( !self:CanPrimaryAttack() ) then return end + + -- Play shoot sound + self:EmitSound(self.Primary.Sound) + + self:ShootBullet(0,0,0) + self:ShootBullet(0,0,0) + self:ShootBullet(0.015,0,0) + self:ShootBullet(-0.015,0,0) + self:ShootBullet(0,0.015,0) + self:ShootBullet(0,-0.015,0) + self:ShootBullet(0.015,0.015,0) + self:ShootBullet(-0.015,0.015,0) + self:ShootBullet(-0.015,-0.015,0) + self:ShootBullet(0.015,-0.015,0) + + -- Remove 1 bullet from our clip + self:TakePrimaryAmmo( 1 ) + + + + if CLIENT and !game.SinglePlayer() and !self.Owner:IsNPC() then + + local anglo = Angle(-self.Primary.Recoil) + local eyes = self.Owner:EyeAngles() + eyes.pitch = eyes.pitch + (anglo.pitch/3) + eyes.yaw = eyes.yaw + (anglo.yaw/3) + self.Owner:SetEyeAngles(eyes) + end + + self.Weapon:SetNextPrimaryFire(CurTime()+1/(self.Primary.RPM/60)) +end +SWEP.Primary.KickUp = 0 +SWEP.Primary.Recoil = 0 \ No newline at end of file