mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-16 21:33:46 +03:00
97 lines
5.4 KiB
Lua
97 lines
5.4 KiB
Lua
--[[
|
|
| This file was obtained through the combined efforts
|
|
| of Madbluntz & Plymouth Antiquarian Society.
|
|
|
|
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
|
| Maloy, DrPepper10 @ RIP, Atle!
|
|
|
|
|
| Visit for more: https://plymouth.thetwilightzone.ru/
|
|
--]]
|
|
|
|
if (!file.Exists("autorun/vj_base_autorun.lua","LUA")) then return end
|
|
---------------------------------------------------------------------------------------------------------------------------------------------
|
|
SWEP.Base = "weapon_vj_base"
|
|
SWEP.PrintName = "Desert Eagle"
|
|
SWEP.Author = "DrVrej"
|
|
SWEP.Contact = "http://steamcommunity.com/groups/vrejgaming"
|
|
SWEP.Purpose = "This weapon is made for Players and NPCs"
|
|
SWEP.Instructions = "Controls are like a regular weapon."
|
|
SWEP.Category = "VJ Base"
|
|
-- NPC Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
|
SWEP.NPC_NextPrimaryFire = false -- Next time it can use primary fire
|
|
SWEP.NPC_ReloadSound = {"vj_hlr/hl1_weapon/deagle/desert_eagle_reload.wav"} -- Sounds it plays when the base detects the SNPC playing a reload animation
|
|
SWEP.NPC_CanBePickedUp = false -- Can this weapon be picked up by NPCs? (Ex: Rebels)
|
|
-- Main Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
|
SWEP.MadeForNPCsOnly = true -- Is this weapon meant to be for NPCs only?
|
|
SWEP.WorldModel = "models/vj_hlr/weapons/w_desert_eagle.mdl"
|
|
SWEP.HoldType = "pistol"
|
|
SWEP.Spawnable = false
|
|
SWEP.AdminSpawnable = false
|
|
-- World Model ---------------------------------------------------------------------------------------------------------------------------------------------
|
|
SWEP.WorldModel_Invisible = true -- Should the world model be invisible?
|
|
SWEP.WorldModel_UseCustomPosition = true -- Should the gun use custom position? This can be used to fix guns that are in the crotch
|
|
SWEP.WorldModel_CustomPositionAngle = Vector(80, 0, 0)
|
|
SWEP.WorldModel_CustomPositionOrigin = Vector(0.5, -0.5, -35)
|
|
SWEP.WorldModel_CustomPositionBone = "Bip01 R Hand" -- The bone it will use as the main point
|
|
-- Primary Fire ---------------------------------------------------------------------------------------------------------------------------------------------
|
|
SWEP.Primary.Damage = 15 -- Damage
|
|
SWEP.Primary.ClipSize = 7 -- Max amount of bullets per clip
|
|
SWEP.Primary.Ammo = "357" -- Ammo type
|
|
SWEP.Primary.Sound = {"vj_hlr/hl1_weapon/deagle/desert_eagle_fire.wav"}
|
|
SWEP.Primary.DistantSound = {"vj_hlr/hl1_weapon/deagle/desert_eagle_fire_distant_final.wav"}
|
|
SWEP.PrimaryEffects_ShellType = "VJ_Weapon_PistolShell1"
|
|
SWEP.Primary.TracerType = "VJ_HLR_Tracer"
|
|
|
|
-- Custom
|
|
SWEP.HLR_ValidModels = {"models/vj_hlr/opfor/otis.mdl","models/vj_hlr/opfor/hgrunt.mdl","models/vj_hlr/hl1/hgrunt.mdl","models/vj_hlr/opfor/hgrunt_medic.mdl","models/vj_hlr/opfor/hgrunt_engineer.mdl","models/vj_hlr/opfor_hd/hgrunt.mdl","models/vj_hlr/opfor_hd/hgrunt_medic.mdl","models/vj_hlr/opfor_hd/hgrunt_engineer.mdl"}
|
|
---------------------------------------------------------------------------------------------------------------------------------------------
|
|
function SWEP:CustomOnInitialize()
|
|
timer.Simple(0.1,function() -- Minag mikani modelner tske, yete ooresh model-e, serpe as zenke
|
|
if IsValid(self) && IsValid(self:GetOwner()) then
|
|
if !VJ_HasValue(self.HLR_ValidModels,self:GetOwner():GetModel()) then
|
|
if IsValid(self:GetOwner():GetCreator()) then
|
|
self:GetOwner():GetCreator():PrintMessage(HUD_PRINTTALK,self.PrintName.." removed! It's made for specific NPCs only!")
|
|
end
|
|
self:Remove()
|
|
else
|
|
self.NPC_NextPrimaryFire = false
|
|
if self:GetOwner():GetModel() == "models/vj_hlr/opfor/otis.mdl" then
|
|
self.WorldModel_CustomPositionAngle = Vector(80,0,10)
|
|
self.WorldModel_CustomPositionOrigin = Vector(-0.7,-1.3,-32.5)
|
|
end
|
|
end
|
|
end
|
|
end)
|
|
end
|
|
---------------------------------------------------------------------------------------------------------------------------------------------
|
|
function SWEP:CustomOnDrawWorldModel() -- This is client only!
|
|
if IsValid(self:GetOwner()) then
|
|
self.WorldModel_Invisible = true
|
|
return false
|
|
else
|
|
self.WorldModel_Invisible = false
|
|
return true -- return false to not draw the world model
|
|
end
|
|
end
|
|
---------------------------------------------------------------------------------------------------------------------------------------------
|
|
function SWEP:CustomOnPrimaryAttackEffects()
|
|
self.PrimaryEffects_MuzzleFlash = false
|
|
muz = ents.Create("env_sprite")
|
|
muz:SetKeyValue("model","vj_hl/sprites/muzzleflash2.vmt")
|
|
muz:SetKeyValue("scale",""..math.Rand(0.3,0.5))
|
|
muz:SetKeyValue("GlowProxySize","2.0") -- Size of the glow to be rendered for visibility testing.
|
|
muz:SetKeyValue("HDRColorScale","1.0")
|
|
muz:SetKeyValue("renderfx","14")
|
|
muz:SetKeyValue("rendermode","3") -- Set the render mode to "3" (Glow)
|
|
muz:SetKeyValue("renderamt","255") -- Transparency
|
|
muz:SetKeyValue("disablereceiveshadows","0") -- Disable receiving shadows
|
|
muz:SetKeyValue("framerate","10.0") -- Rate at which the sprite should animate, if at all.
|
|
muz:SetKeyValue("spawnflags","0")
|
|
muz:SetParent(self)
|
|
muz:Fire("SetParentAttachment",self.PrimaryEffects_MuzzleAttachment)
|
|
muz:SetAngles(Angle(math.random(-100, 100), math.random(-100, 100), math.random(-100, 100)))
|
|
muz:Spawn()
|
|
muz:Activate()
|
|
muz:Fire("Kill","",0.08)
|
|
return true
|
|
end |