fatal m9k

This commit is contained in:
edshot99 2024-12-21 02:05:30 -06:00
parent 2129885162
commit 0664695fc0
4 changed files with 217 additions and 196 deletions

View File

@ -407,6 +407,14 @@ sound.Add({
})
sound.Add({
name = "readyforlaunch" ,
channel = CHAN_USER_BASE+10,
volume = 1.0,
sound = "weapons/nuke/readyforlaunch.mp3"
})
m9knpw = {}
table.insert(m9knpw, "m9k_davy_crockett_explo")
table.insert(m9knpw, "m9k_gdcwa_matador_90mm")

View File

@ -6,8 +6,8 @@
ENT.Instructions = "LAUNCH"
ENT.Spawnable = false
ENT.AdminOnly = true
ENT.DoNotDuplicate = true
ENT.AdminOnly = true
ENT.DoNotDuplicate = true
ENT.DisableDuplicator = true
if SERVER then
@ -25,6 +25,7 @@ self.Entity:PhysicsInit( SOLID_VPHYSICS ) -- Make us work with physics,
self.Entity:SetMoveType( MOVETYPE_NONE ) --after all, gmod is a physics
self.Entity:SetSolid( SOLID_VPHYSICS ) -- CHEESECAKE! >:3
self.Entity:SetColor(Color(82,102,39,254))
self.Entity:EmitSound("incoming.mp3")
Glow = ents.Create("env_sprite")
Glow:SetKeyValue("model","orangecore2.vmt")

View File

@ -29,8 +29,8 @@ SWEP.ViewModelFlip = false
SWEP.ViewModel = "models/weapons/v_RL7.mdl" -- Weapon view model
SWEP.WorldModel = "models/weapons/w_RL7.mdl" -- Weapon world model
SWEP.Base = "bobs_gun_base"
SWEP.Spawnable = true
SWEP.AdminSpawnable = true
SWEP.Spawnable = false
SWEP.AdminSpawnable = false
SWEP.FiresUnderwater = true
SWEP.Primary.Sound = Sound("") -- Script that calls the primary fire sound
@ -144,6 +144,7 @@ function SWEP:PrimaryAttack()
end
end
self:CheckWeaponsAndAmmo()
self:Remove()
end
end

View File

@ -1,193 +1,204 @@
-- Variables that are used on both client and server
SWEP.Gun = ("m9k_orbital_strike") -- 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 Specialties"
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 = "Orbital Strike Marker" -- Weapon name (Shown on HUD)
SWEP.Slot = 4 -- 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
SWEP.BounceWeaponIcon = false -- Should the weapon icon bounce?
SWEP.DrawCrosshair = false -- Set false if you want no crosshair from hip
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.XHair = false -- Used for returning crosshair after scope. Must be the same as DrawCrosshair
SWEP.HoldType = "camera"
SWEP.ViewModelFOV = 70
SWEP.ViewModelFlip = false
SWEP.ViewModel = "models/weapons/v_invisib.mdl" -- Weapon view model
SWEP.WorldModel = "models/weapons/w_binos.mdl" -- Weapon world model
SWEP.Base = "bobs_scoped_base"
SWEP.Spawnable = true
SWEP.AdminSpawnable = true
SWEP.Primary.Sound = Sound("weapons/satellite/targaquired.mp3") -- script that calls the primary fire sound
SWEP.Primary.RPM = 50 -- This is in Rounds Per Minute
SWEP.Primary.ClipSize = 1 -- Size of a clip
SWEP.Primary.DefaultClip = 1 -- 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 = "SatCannon"
SWEP.Secondary.ScopeZoom = 5
SWEP.Secondary.UseParabolic = false -- Choose your scope type,
SWEP.Secondary.UseACOG = false
SWEP.Secondary.UseMilDot = true
SWEP.Secondary.UseSVD = false
SWEP.Secondary.UseElcan = false
SWEP.Secondary.UseGreenDuplex = false
SWEP.data = {} --The starting firemode
SWEP.data.ironsights = 1
SWEP.ScopeScale = 1
-- enter iron sight info and bone mod info below
SWEP.IronSightsPos = Vector(-3.589, -8.867, -4.124)
SWEP.IronSightsAng = Vector(50.353, 17.884, -19.428)
SWEP.SightsPos = Vector(-3.589, -8.867, -4.124)
SWEP.SightsAng = Vector(50.353, 17.884, -19.428)
SWEP.RunSightsPos = Vector(0, 0, 0)
SWEP.RunSightsAng = Vector(-21.994, 0, 0)
SWEP.ViewModelBoneMods = {
["l-ring-low"] = { scale = Vector(1, 1, 1), pos = Vector(0, 0, 0), angle = Angle(-19.507, 0, 0) },
["r-index-mid"] = { scale = Vector(1, 1, 1), pos = Vector(0, 0, 0), angle = Angle(-71.792, 0, 0) },
["r-middle-low"] = { scale = Vector(1, 1, 1), pos = Vector(0, 0, 0), angle = Angle(-21.483, 1.309, 0) },
["l-upperarm-movement"] = { scale = Vector(1, 1, 1), pos = Vector(0, 0, -0.88), angle = Angle(0, 0, 0) },
["Da Machete"] = { scale = Vector(1, 1, 1), pos = Vector(0, 0.263, -1.826), angle = Angle(0, 0, 0) },
["r-ring-low"] = { scale = Vector(1, 1, 1), pos = Vector(0, 0, 0), angle = Angle(-17.507, 0, 0) },
["r-pinky-mid"] = { scale = Vector(1, 1, 1), pos = Vector(0, 0, 0), angle = Angle(-47.32, 0, 0) },
["r-ring-mid"] = { scale = Vector(1, 1, 1), pos = Vector(0, 0, 0), angle = Angle(-54.065, 0, 0) },
["r-index-low"] = { scale = Vector(1, 1, 1), pos = Vector(0, 0, 0), angle = Angle(-49.646, 0, 0) },
["r-thumb-tip"] = { scale = Vector(1, 1, 1), pos = Vector(0, 0, 0), angle = Angle(-17.666, 0, 0) },
["r-upperarm-movement"] = { scale = Vector(1, 1, 1), pos = Vector(7.394, 2.101, -9.54), angle = Angle(-10.502, -12.632, 68.194) },
["r-pinky-low"] = { scale = Vector(1, 1, 1), pos = Vector(0, 0, 0), angle = Angle(-21.526, 0, 0) },
["r-middle-mid"] = { scale = Vector(1, 1, 1), pos = Vector(0, 0, 0), angle = Angle(-37.065, 0, 0) },
["r-thumb-mid"] = { scale = Vector(1, 1, 1), pos = Vector(0, 0, 0), angle = Angle(-4.816, 18.775, -30.143) },
["l-index-low"] = { scale = Vector(1, 1, 1), pos = Vector(0, 0, 0), angle = Angle(-49.646, 0, 0) },
["r-thumb-low"] = { scale = Vector(1, 1, 1), pos = Vector(0, 0, 0), angle = Angle(-0.982, 0, 0) }
}
SWEP.VElements = {
["binos"] = { type = "Model", model = "models/weapons/binos.mdl", bone = "r-thumb-low", rel = "", pos = Vector(3.907, -0.109, -1.125), angle = Angle(-2.829, 27.281, 105.791), size = Vector(0.5, 0.5, 0.5), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} }
}
SWEP.PoorBastard = false
SWEP.NextShoot = 0
function SWEP:PrimaryAttack()
self.PoorBastard = false
if not IsFirstTimePredicted() then return end
if self:CanPrimaryAttack() and self.Owner:IsPlayer() and self.NextShoot <= CurTime() then
if !self.Owner:KeyDown(IN_SPEED) and !self.Owner:KeyDown(IN_RELOAD) then
local mark = self.Owner:GetEyeTrace()
if mark.HitSky then
self.Owner:EmitSound("player/suit_denydevice.wav")
end
local skytrace = {}
skytrace.start = mark.HitPos
skytrace.endpos = mark.HitPos + Vector(0,0,65000)
skycheck = util.TraceLine(skytrace)
if skycheck.HitSky then
if SERVER then
local Sky = skycheck.HitPos - Vector(0,0,10)
local Ground = mark.HitPos
Satellite = ents.Create("m9k_oribital_cannon")
Satellite.Ground = Ground
Satellite.Sky = Sky
Satellite.Owner = self.Owner
Satellite:SetPos(Sky) //was sky but for testing, its this
Satellite:Spawn()
end
if SERVER then self.Owner:EmitSound(self.Primary.Sound) end
self.Weapon:TakePrimaryAmmo(1)
self.Weapon:SetNextPrimaryFire(CurTime()+15)
self.NextShoot = CurTime() + 15
self:CheckWeaponsAndAmmo()
self:Reload()
elseif mark.Entity:IsPlayer() or mark.Entity:IsNPC() then
self.PoorBastard = true
thetarget = mark.Entity
skytrace2 = {}
skytrace2.start = thetarget:GetPos()
skytrace2.endpos = thetarget:GetPos() + Vector(0,0,65000)
skytrace2.filter = thetarget
skycheck2 = util.TraceLine(skytrace2)
if skycheck2.HitSky then //someone's gonna be in big trouble
sky2 = skycheck2.HitPos - Vector(0,0,10)
if SERVER then
Satellite = ents.Create("m9k_oribital_cannon")
--Satellite.Ground = Ground
Satellite.PoorBastard = true
Satellite.Target = thetarget
Satellite.Sky = sky2
Satellite.Owner = self.Owner
Satellite:SetPos(sky2)
Satellite:Spawn()
end
self.Owner:EmitSound(self.Primary.Sound)
self.Weapon:TakePrimaryAmmo(1)
self.Weapon:SetNextPrimaryFire(CurTime()+15)
self.NextShoot = CurTime() + 15
self:CheckWeaponsAndAmmo()
self:Reload()
else
self.Owner:EmitSound("player/suit_denydevice.wav")
end
else
self.Owner:EmitSound("player/suit_denydevice.wav")
end
end
end
end
function SWEP:CheckWeaponsAndAmmo()
if SERVER and self.Weapon != nil then
if self.Weapon:Clip1() == 0 && self.Owner:GetAmmoCount( self.Weapon:GetPrimaryAmmoType() ) == 0 and (GetConVar("M9KWeaponStrip"):GetBool()) then
timer.Simple(.1, function() if SERVER then if not IsValid(self) then return end
if not IsValid(self.Owner) then return end
self.Owner:StripWeapon(self.Gun)
end end)
else
self:Reload()
end
end
end
if GetConVar("OrbitalStrikeAdminOnly") == nil then
print("OrbitalStrikeAdminOnly is missing! You may have hit the lua limit!")
else
if GetConVar("OrbitalStrikeAdminOnly"):GetInt() == 1 then
SWEP.Spawnable = false
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
-- Variables that are used on both client and server
SWEP.Gun = ("m9k_orbital_strike") -- 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 Specialties"
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 = "Tactical Nuke Marker" -- Weapon name (Shown on HUD)
SWEP.Slot = 4 -- 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
SWEP.BounceWeaponIcon = false -- Should the weapon icon bounce?
SWEP.DrawCrosshair = false -- Set false if you want no crosshair from hip
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.XHair = false -- Used for returning crosshair after scope. Must be the same as DrawCrosshair
SWEP.HoldType = "camera"
SWEP.ViewModelFOV = 70
SWEP.ViewModelFlip = false
SWEP.ViewModel = "models/weapons/v_invisib.mdl" -- Weapon view model
SWEP.WorldModel = "models/weapons/w_binos.mdl" -- Weapon world model
SWEP.Base = "bobs_scoped_base"
SWEP.Spawnable = false
SWEP.AdminSpawnable = false
SWEP.Primary.Sound = Sound("") -- script that calls the primary fire sound
SWEP.Primary.RPM = 50 -- This is in Rounds Per Minute
SWEP.Primary.ClipSize = 1 -- Size of a clip
SWEP.Primary.DefaultClip = 1 -- 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 = "SatCannon"
SWEP.Secondary.ScopeZoom = 5
SWEP.Secondary.UseParabolic = false -- Choose your scope type,
SWEP.Secondary.UseACOG = false
SWEP.Secondary.UseMilDot = true
SWEP.Secondary.UseSVD = false
SWEP.Secondary.UseElcan = false
SWEP.Secondary.UseGreenDuplex = false
SWEP.data = {} --The starting firemode
SWEP.data.ironsights = 1
SWEP.ScopeScale = 1
-- enter iron sight info and bone mod info below
SWEP.IronSightsPos = Vector(-3.589, -8.867, -4.124)
SWEP.IronSightsAng = Vector(50.353, 17.884, -19.428)
SWEP.SightsPos = Vector(-3.589, -8.867, -4.124)
SWEP.SightsAng = Vector(50.353, 17.884, -19.428)
SWEP.RunSightsPos = Vector(0, 0, 0)
SWEP.RunSightsAng = Vector(-21.994, 0, 0)
SWEP.ViewModelBoneMods = {
["l-ring-low"] = { scale = Vector(1, 1, 1), pos = Vector(0, 0, 0), angle = Angle(-19.507, 0, 0) },
["r-index-mid"] = { scale = Vector(1, 1, 1), pos = Vector(0, 0, 0), angle = Angle(-71.792, 0, 0) },
["r-middle-low"] = { scale = Vector(1, 1, 1), pos = Vector(0, 0, 0), angle = Angle(-21.483, 1.309, 0) },
["l-upperarm-movement"] = { scale = Vector(1, 1, 1), pos = Vector(0, 0, -0.88), angle = Angle(0, 0, 0) },
["Da Machete"] = { scale = Vector(1, 1, 1), pos = Vector(0, 0.263, -1.826), angle = Angle(0, 0, 0) },
["r-ring-low"] = { scale = Vector(1, 1, 1), pos = Vector(0, 0, 0), angle = Angle(-17.507, 0, 0) },
["r-pinky-mid"] = { scale = Vector(1, 1, 1), pos = Vector(0, 0, 0), angle = Angle(-47.32, 0, 0) },
["r-ring-mid"] = { scale = Vector(1, 1, 1), pos = Vector(0, 0, 0), angle = Angle(-54.065, 0, 0) },
["r-index-low"] = { scale = Vector(1, 1, 1), pos = Vector(0, 0, 0), angle = Angle(-49.646, 0, 0) },
["r-thumb-tip"] = { scale = Vector(1, 1, 1), pos = Vector(0, 0, 0), angle = Angle(-17.666, 0, 0) },
["r-upperarm-movement"] = { scale = Vector(1, 1, 1), pos = Vector(7.394, 2.101, -9.54), angle = Angle(-10.502, -12.632, 68.194) },
["r-pinky-low"] = { scale = Vector(1, 1, 1), pos = Vector(0, 0, 0), angle = Angle(-21.526, 0, 0) },
["r-middle-mid"] = { scale = Vector(1, 1, 1), pos = Vector(0, 0, 0), angle = Angle(-37.065, 0, 0) },
["r-thumb-mid"] = { scale = Vector(1, 1, 1), pos = Vector(0, 0, 0), angle = Angle(-4.816, 18.775, -30.143) },
["l-index-low"] = { scale = Vector(1, 1, 1), pos = Vector(0, 0, 0), angle = Angle(-49.646, 0, 0) },
["r-thumb-low"] = { scale = Vector(1, 1, 1), pos = Vector(0, 0, 0), angle = Angle(-0.982, 0, 0) }
}
SWEP.VElements = {
["binos"] = { type = "Model", model = "models/weapons/binos.mdl", bone = "r-thumb-low", rel = "", pos = Vector(3.907, -0.109, -1.125), angle = Angle(-2.829, 27.281, 105.791), size = Vector(0.5, 0.5, 0.5), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} }
}
SWEP.PoorBastard = false
SWEP.NextShoot = 0
function SWEP:Equip()
if self.Owner:GetNWInt("playerStreak") != 25 then
self.Weapon:Remove()
self.Owner:Kill()
print(""..self.Owner:Nick().." tried to be a dirty boy and get the nuke with a console command!")
end
end
function SWEP:PrimaryAttack()
self.PoorBastard = false
if not IsFirstTimePredicted() then return end
if self:CanPrimaryAttack() and self.Owner:IsPlayer() and self.NextShoot <= CurTime() then
if self.Owner:KeyDown(IN_ATTACK2) then
local mark = self.Owner:GetEyeTrace()
if mark.HitSky then
self.Owner:EmitSound("player/suit_denydevice.wav")
end
local skytrace = {}
skytrace.start = mark.HitPos
skytrace.endpos = mark.HitPos + Vector(0,0,65000)
skycheck = util.TraceLine(skytrace)
if skycheck.HitSky then
if SERVER then
local Sky = skycheck.HitPos - Vector(100,100,100)
local Ground = mark.HitPos
Satellite = ents.Create("m9k_launched_davycrockett")
Satellite.Ground = Ground
Satellite.Sky = Sky - Vector(0,0,10)
Satellite.Owner = self.Owner
Satellite:SetPos(Sky) //was sky but for testing, its this
Satellite:SetAngles(Angle(0, 0, 180))
Satellite:Spawn()
self:Remove()
end
if SERVER then self.Owner:EmitSound(self.Primary.Sound) end
self.Weapon:TakePrimaryAmmo(1)
self.Weapon:SetNextPrimaryFire(CurTime()+15)
self.NextShoot = CurTime() + 1
self:CheckWeaponsAndAmmo()
self:Reload()
elseif mark.Entity:IsPlayer() or mark.Entity:IsNPC() then
self.PoorBastard = true
thetarget = mark.Entity
skytrace2 = {}
skytrace2.start = thetarget:GetPos()
skytrace2.endpos = thetarget:GetPos() + Vector(0,0,0)
skytrace2.filter = thetarget
skycheck2 = util.TraceLine(skytrace2)
if skycheck2.HitSky then //someone's gonna be in big trouble
sky2 = skycheck2.HitPos - Vector(0,0,10)
if SERVER then
Satellite = ents.Create("m9k_launched_davycrockett")
--Satellite.Ground = Ground
Satellite.PoorBastard = true
Satellite.Target = thetarget
Satellite.Sky = sky2
Satellite.Owner = self.Owner
Satellite:SetPos(sky2)
Satellite:SetAngles(180,90,90)
Satellite:Spawn()
end
self.Owner:EmitSound(self.Primary.Sound)
self.Weapon:TakePrimaryAmmo(1)
self.Weapon:SetNextPrimaryFire(CurTime()+15)
self.NextShoot = CurTime() + 15
self:CheckWeaponsAndAmmo()
self:Reload()
else
self.Owner:EmitSound("player/suit_denydevice.wav")
end
else
self.Owner:EmitSound("player/suit_denydevice.wav")
end
end
end
end
function SWEP:CheckWeaponsAndAmmo()
if SERVER and self.Weapon != nil then
if self.Weapon:Clip1() == 0 && self.Owner:GetAmmoCount( self.Weapon:GetPrimaryAmmoType() ) == 0 and (GetConVar("M9KWeaponStrip"):GetBool()) then
timer.Simple(.1, function() if SERVER then if not IsValid(self) then return end
if not IsValid(self.Owner) then return end
self.Owner:StripWeapon(self.Gun)
end end)
else
self:Reload()
end
end
end
if GetConVar("OrbitalStrikeAdminOnly") == nil then
print("OrbitalStrikeAdminOnly is missing! You may have hit the lua limit!")
else
if GetConVar("OrbitalStrikeAdminOnly"):GetInt() == 1 then
SWEP.Spawnable = false
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