Залив
This commit is contained in:
69
gamemodes/cod_custom/entities/weapons/tdm_grenade.lua
Normal file
69
gamemodes/cod_custom/entities/weapons/tdm_grenade.lua
Normal file
@@ -0,0 +1,69 @@
|
||||
AddCSLuaFile()
|
||||
|
||||
SWEP.PrintName = "Grenade"
|
||||
SWEP.Slot = 0
|
||||
SWEP.SlotPos = 4
|
||||
SWEP.Instructions = ""
|
||||
SWEP.ViewModel = "models/tdmg/wep/c_lethal_frag.mdl"
|
||||
SWEP.ViewModelFOV = 75
|
||||
SWEP.UseHands = true
|
||||
|
||||
SWEP.Primary.Automatic = false
|
||||
SWEP.Primary.ClipSize = -1
|
||||
SWEP.Primary.DefaultClip = -1
|
||||
SWEP.Secondary.ClipSize = -1
|
||||
SWEP.Secondary.DefaultClip = -1
|
||||
SWEP.Secondary.Automatic = false
|
||||
|
||||
SWEP.DrawAmmo = false
|
||||
|
||||
function SWEP:Initialize()
|
||||
self:SetHoldType("grenade")
|
||||
end
|
||||
|
||||
function SWEP:Throw()
|
||||
self:SendWeaponAnim(ACT_VM_PRIMARYATTACK)
|
||||
|
||||
local ply = self:GetOwner()
|
||||
timer.Simple(0.1, function()
|
||||
if !IsValid(ply) then return end
|
||||
ply:SetAnimation(PLAYER_ATTACK1)
|
||||
end)
|
||||
|
||||
if SERVER then
|
||||
timer.Simple(0.5, function()
|
||||
if !IsValid(ply) or !IsValid(self) then return end
|
||||
|
||||
local class = "tdm_frag"
|
||||
if self.IsFlash then
|
||||
class = "tdm_flash"
|
||||
end
|
||||
|
||||
local ent = ents.Create(class)
|
||||
ent:SetPos(ply:EyePos()+ply:GetForward()*16)
|
||||
ent.Player = ply
|
||||
ent:Spawn()
|
||||
ent:GetPhysicsObject():SetVelocity(ply:GetAimVector()*750+Vector(0,0,50))
|
||||
|
||||
ply:ViewPunch(Angle(10,0,0))
|
||||
ply:EmitSound("tdmg/wep/knife_miss.wav")
|
||||
end)
|
||||
timer.Simple(1, function()
|
||||
if !IsValid(ply) or !IsValid(self) then return end
|
||||
|
||||
ply:SetActiveWeapon(nil)
|
||||
ply:SelectWeapon(ply.FastKnifeBeforeWep)
|
||||
self:Remove()
|
||||
end)
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
function SWEP:PrimaryAttack() end
|
||||
|
||||
function SWEP:SecondaryAttack() end
|
||||
|
||||
function SWEP:Reload() end
|
||||
|
||||
function SWEP:DrawWorldModel() end
|
||||
101
gamemodes/cod_custom/entities/weapons/tdm_infection_knife.lua
Normal file
101
gamemodes/cod_custom/entities/weapons/tdm_infection_knife.lua
Normal file
@@ -0,0 +1,101 @@
|
||||
|
||||
AddCSLuaFile()
|
||||
|
||||
SWEP.PrintName = "Knife"
|
||||
SWEP.Slot = 0
|
||||
SWEP.SlotPos = 4
|
||||
SWEP.Spawnable = true
|
||||
|
||||
SWEP.ViewModel = Model( "models/tdmg/wep/c_knife.mdl" )
|
||||
SWEP.WorldModel = ""
|
||||
SWEP.ViewModelFOV = 70
|
||||
SWEP.UseHands = true
|
||||
|
||||
SWEP.Primary.ClipSize = -1
|
||||
SWEP.Primary.DefaultClip = -1
|
||||
SWEP.Primary.Automatic = true
|
||||
SWEP.Primary.Ammo = "none"
|
||||
|
||||
SWEP.Secondary.ClipSize = -1
|
||||
SWEP.Secondary.DefaultClip = -1
|
||||
SWEP.Secondary.Automatic = true
|
||||
SWEP.Secondary.Ammo = "none"
|
||||
|
||||
SWEP.DrawAmmo = false
|
||||
|
||||
SWEP.HitDistance = 48
|
||||
|
||||
local SwingSound = Sound( "WeaponFrag.Throw" )
|
||||
local HitSound = Sound( "Flesh.ImpactHard" )
|
||||
|
||||
function SWEP:Initialize()
|
||||
self:SetHoldType( "fist" )
|
||||
end
|
||||
|
||||
function SWEP:PrimaryAttack()
|
||||
self:SetNextPrimaryFire(CurTime()+0.75)
|
||||
self:SendWeaponAnim(ACT_VM_HITRIGHT)
|
||||
self:SetAnimation(PLAYER_ATTACK1)
|
||||
if SERVER then
|
||||
timer.Simple(0.1, function()
|
||||
if !IsValid(self) then return end
|
||||
self:DealDamage()
|
||||
end)
|
||||
end
|
||||
timer.Simple(0.6, function()
|
||||
if !IsValid(self) then return end
|
||||
self:SendWeaponAnim(ACT_VM_IDLE)
|
||||
end)
|
||||
end
|
||||
|
||||
function SWEP:SecondaryAttack() end
|
||||
|
||||
function SWEP:DealDamage()
|
||||
local tr = util.TraceLine( {
|
||||
start = self.Owner:GetShootPos(),
|
||||
endpos = self.Owner:GetShootPos() + self.Owner:GetAimVector() * self.HitDistance,
|
||||
filter = self.Owner,
|
||||
mask = MASK_SHOT_HULL
|
||||
} )
|
||||
|
||||
if ( !IsValid( tr.Entity ) ) then
|
||||
tr = util.TraceHull( {
|
||||
start = self.Owner:GetShootPos(),
|
||||
endpos = self.Owner:GetShootPos() + self.Owner:GetAimVector() * self.HitDistance,
|
||||
filter = self.Owner,
|
||||
mins = Vector( -10, -10, -8 ),
|
||||
maxs = Vector( 10, 10, 8 ),
|
||||
mask = MASK_SHOT_HULL
|
||||
} )
|
||||
end
|
||||
|
||||
local tar = tr.Entity
|
||||
if IsValid(tar) then
|
||||
tar:TakeDamage(100, self:GetOwner(), self)
|
||||
if tar:IsPlayer() or tar:IsNPC() then
|
||||
self:EmitSound("tdmg/wep/melee_knife_0"..math.random(1,2)..".wav")
|
||||
else
|
||||
self:EmitSound("tdmg/wep/knife_impact_world"..math.random(1,2)..".wav")
|
||||
end
|
||||
else
|
||||
self:EmitSound("tdmg/wep/knife_swing_miss"..math.random(1,2)..".wav")
|
||||
end
|
||||
end
|
||||
|
||||
function SWEP:OnDrop()
|
||||
self:Remove()
|
||||
end
|
||||
|
||||
function SWEP:Deploy()
|
||||
self:EmitSound("tdmg/wep/knife_deploy.wav")
|
||||
self:SendWeaponAnim(ACT_VM_DRAW)
|
||||
timer.Simple(1, function()
|
||||
if !IsValid(self) then return end
|
||||
self:SendWeaponAnim(ACT_VM_IDLE)
|
||||
end)
|
||||
return true
|
||||
end
|
||||
|
||||
function SWEP:Holster()
|
||||
return true
|
||||
end
|
||||
86
gamemodes/cod_custom/entities/weapons/tdm_knife.lua
Normal file
86
gamemodes/cod_custom/entities/weapons/tdm_knife.lua
Normal file
@@ -0,0 +1,86 @@
|
||||
AddCSLuaFile()
|
||||
|
||||
SWEP.PrintName = "Knife"
|
||||
SWEP.Slot = 0
|
||||
SWEP.SlotPos = 4
|
||||
SWEP.Instructions = ""
|
||||
SWEP.ViewModel = "models/tdmg/wep/c_combat_knife.mdl"
|
||||
SWEP.ViewModelFOV = 75
|
||||
SWEP.UseHands = true
|
||||
|
||||
SWEP.Primary.Automatic = false
|
||||
SWEP.Primary.ClipSize = -1
|
||||
SWEP.Primary.DefaultClip = -1
|
||||
SWEP.Secondary.ClipSize = -1
|
||||
SWEP.Secondary.DefaultClip = -1
|
||||
SWEP.Secondary.Automatic = false
|
||||
|
||||
SWEP.HitDistance = 56
|
||||
|
||||
SWEP.DrawAmmo = false
|
||||
|
||||
function SWEP:Initialize()
|
||||
self:SetHoldType("knife")
|
||||
end
|
||||
|
||||
function SWEP:Knifing()
|
||||
self:SendWeaponAnim(ACT_VM_PRIMARYATTACK)
|
||||
|
||||
local ply = self:GetOwner()
|
||||
ply:ViewPunch(Angle(0,-20,10))
|
||||
timer.Simple(0.1, function()
|
||||
if !IsValid(ply) then return end
|
||||
ply:SetAnimation(PLAYER_ATTACK1)
|
||||
end)
|
||||
|
||||
if SERVER then
|
||||
ply:EmitSound("tdmg/wep/knife_miss.wav")
|
||||
timer.Simple(0.15, function()
|
||||
if !IsValid(ply) or !IsValid(self) then return end
|
||||
|
||||
local tr = util.TraceLine( {
|
||||
start = self.Owner:GetShootPos(),
|
||||
endpos = self.Owner:GetShootPos() + self.Owner:GetAimVector() * self.HitDistance,
|
||||
filter = self.Owner,
|
||||
mask = MASK_SHOT_HULL
|
||||
} )
|
||||
|
||||
if ( !IsValid( tr.Entity ) ) then
|
||||
tr = util.TraceHull( {
|
||||
start = self.Owner:GetShootPos(),
|
||||
endpos = self.Owner:GetShootPos() + self.Owner:GetAimVector() * self.HitDistance,
|
||||
filter = self.Owner,
|
||||
mins = Vector( -16, -16, -8 ),
|
||||
maxs = Vector( 16, 16, 8 ),
|
||||
mask = MASK_SHOT_HULL
|
||||
} )
|
||||
end
|
||||
|
||||
local ent = tr.Entity
|
||||
|
||||
if IsValid(ent) and (ent:IsPlayer() or ent:IsNPC()) then
|
||||
ent:TakeDamage(250, ply, self)
|
||||
ply:EmitSound("tdmg/wep/knife_hit"..math.random(1,3)..".wav")
|
||||
elseif tr.Hit then
|
||||
ply:EmitSound("physics/concrete/rock_impact_hard"..math.random(1,6)..".wav")
|
||||
end
|
||||
end)
|
||||
timer.Simple(0.5, function()
|
||||
if !IsValid(ply) or !IsValid(self) then return end
|
||||
|
||||
ply:SetActiveWeapon(nil)
|
||||
ply:SelectWeapon(ply.FastKnifeBeforeWep)
|
||||
self:Remove()
|
||||
end)
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
function SWEP:PrimaryAttack() end
|
||||
|
||||
function SWEP:SecondaryAttack() end
|
||||
|
||||
function SWEP:Reload() end
|
||||
|
||||
function SWEP:DrawWorldModel() end
|
||||
111
gamemodes/cod_custom/entities/weapons/tdm_radio.lua
Normal file
111
gamemodes/cod_custom/entities/weapons/tdm_radio.lua
Normal file
@@ -0,0 +1,111 @@
|
||||
AddCSLuaFile()
|
||||
|
||||
SWEP.PrintName = "Radio"
|
||||
SWEP.Slot = 0
|
||||
SWEP.SlotPos = 4
|
||||
SWEP.Instructions = "LMB - Mark Position, RMB - Zoom"
|
||||
SWEP.ViewModel = "models/tdmg/wep/chands_smallradio.mdl"
|
||||
SWEP.ViewModelFOV = 75
|
||||
SWEP.UseHands = true
|
||||
|
||||
SWEP.Primary.Automatic = false
|
||||
SWEP.Secondary.Automatic = false
|
||||
|
||||
SWEP.DrawAmmo = false
|
||||
|
||||
function SWEP:Initialize()
|
||||
self.Called = false
|
||||
self.FOVED = false
|
||||
self.EndAfter = 0
|
||||
self.PosTable = {}
|
||||
self:SetNWBool('drawarrow', true)
|
||||
if not self.Killstreak then
|
||||
self.Killstreak = "package"
|
||||
end
|
||||
end
|
||||
|
||||
function SWEP:Deploy()
|
||||
self:SendWeaponAnim(ACT_VM_DRAW)
|
||||
self:SetHoldType("slam")
|
||||
return true
|
||||
end
|
||||
|
||||
function SWEP:CheckSky()
|
||||
local tr = self:GetOwner():GetEyeTrace().HitPos
|
||||
|
||||
local tr2 = util.TraceLine({
|
||||
start = tr,
|
||||
endpos = tr+Vector(0,0,99999),
|
||||
filter = function( ent ) return ( ent:GetClass() == "prop_static" ) end,
|
||||
})
|
||||
|
||||
return tr2.HitSky
|
||||
end
|
||||
|
||||
function SWEP:PrimaryAttack()
|
||||
if self.Called then return end
|
||||
if not self:CheckSky() then return end
|
||||
self.Called = true
|
||||
self:SendWeaponAnim(ACT_VM_PULLBACK)
|
||||
timer.Simple(0.3, function()
|
||||
if !IsValid(self) then return end
|
||||
self:EmitSound("tdmg/radio_apply.wav")
|
||||
self:SendWeaponAnim(ACT_VM_IDLE)
|
||||
end)
|
||||
if SERVER then
|
||||
local ply = self:GetOwner()
|
||||
local pos = ply:GetEyeTrace().HitPos
|
||||
local cannext = true
|
||||
if self.ManyTimes then
|
||||
table.insert(self.PosTable, pos)
|
||||
pos = self.PosTable
|
||||
|
||||
self.EndAfter = self.EndAfter - 1
|
||||
if self.EndAfter > 0 then
|
||||
cannext = false
|
||||
end
|
||||
end
|
||||
if cannext then
|
||||
ply:SetFOV(0, 0.25)
|
||||
self:SetNWBool('drawarrow', false)
|
||||
timer.Simple(0.3, function()
|
||||
if !IsValid(self) then return end
|
||||
COD:ChooseKillstreakRadio(ply, self, pos)
|
||||
end)
|
||||
timer.Simple(1.2, function()
|
||||
if !IsValid(self) then return end
|
||||
if IsValid(ply) then
|
||||
ply:SelectWeapon(ply.RadioBeforeWep)
|
||||
end
|
||||
self:Remove()
|
||||
end)
|
||||
else
|
||||
timer.Simple(1, function()
|
||||
if !IsValid(self) then return end
|
||||
self.Called = false
|
||||
end)
|
||||
end
|
||||
end
|
||||
timer.Simple(0.4, function()
|
||||
if !IsValid(self) then return end
|
||||
if self.EndAfter == 0 then
|
||||
self:SendWeaponAnim(ACT_VM_HOLSTER)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function SWEP:SecondaryAttack()
|
||||
if self.Called then return end
|
||||
if SERVER then
|
||||
local ply = self:GetOwner()
|
||||
if not self.FOVED then
|
||||
self.FOVED = true
|
||||
ply:SetFOV(50, 0.25)
|
||||
else
|
||||
self.FOVED = false
|
||||
ply:SetFOV(0, 0.25)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function SWEP:DrawWorldModel() end
|
||||
@@ -0,0 +1,192 @@
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Name: SetupWeaponHoldTypeForAI
|
||||
Desc: Sets up ACT translations from generic activities to NPC specific activies. In a seperate file to clean up the init.lua
|
||||
Not all NPCs have support for all animations (for example Citizens don't have pistol animations)
|
||||
This only supports the holdtypes the default NPC models can support
|
||||
All of these are taken directly from IMPLEMENT_ACTTABLE() macro of the C++ weapons
|
||||
-----------------------------------------------------------]]
|
||||
function SWEP:SetupWeaponHoldTypeForAI( t )
|
||||
|
||||
self.ActivityTranslateAI = {}
|
||||
|
||||
-- Default is pistol/revolver for reasons
|
||||
self.ActivityTranslateAI[ ACT_IDLE ] = ACT_IDLE_PISTOL
|
||||
self.ActivityTranslateAI[ ACT_IDLE_ANGRY ] = ACT_IDLE_ANGRY_PISTOL
|
||||
self.ActivityTranslateAI[ ACT_RANGE_ATTACK1 ] = ACT_RANGE_ATTACK_PISTOL
|
||||
self.ActivityTranslateAI[ ACT_RELOAD ] = ACT_RELOAD_PISTOL
|
||||
self.ActivityTranslateAI[ ACT_WALK_AIM ] = ACT_WALK_AIM_PISTOL
|
||||
self.ActivityTranslateAI[ ACT_RUN_AIM ] = ACT_RUN_AIM_PISTOL
|
||||
self.ActivityTranslateAI[ ACT_GESTURE_RANGE_ATTACK1 ] = ACT_GESTURE_RANGE_ATTACK_PISTOL
|
||||
self.ActivityTranslateAI[ ACT_RELOAD_LOW ] = ACT_RELOAD_PISTOL_LOW
|
||||
|
||||
self.ActivityTranslateAI[ ACT_RANGE_ATTACK1_LOW ] = ACT_RANGE_ATTACK_PISTOL_LOW
|
||||
self.ActivityTranslateAI[ ACT_COVER_LOW ] = ACT_COVER_PISTOL_LOW
|
||||
self.ActivityTranslateAI[ ACT_RANGE_AIM_LOW ] = ACT_RANGE_AIM_PISTOL_LOW
|
||||
self.ActivityTranslateAI[ ACT_GESTURE_RELOAD ] = ACT_GESTURE_RELOAD_PISTOL
|
||||
|
||||
self.ActivityTranslateAI[ ACT_WALK ] = ACT_WALK_PISTOL
|
||||
self.ActivityTranslateAI[ ACT_RUN ] = ACT_RUN_PISTOL
|
||||
|
||||
self.ActivityTranslateAI[ ACT_IDLE_RELAXED ] = ACT_IDLE_PISTOL
|
||||
self.ActivityTranslateAI[ ACT_IDLE_STIMULATED ] = ACT_IDLE_STIMULATED
|
||||
self.ActivityTranslateAI[ ACT_IDLE_AGITATED ] = ACT_IDLE_ANGRY_PISTOL
|
||||
self.ActivityTranslateAI[ ACT_IDLE_STEALTH ] = ACT_IDLE_STEALTH_PISTOL
|
||||
|
||||
self.ActivityTranslateAI[ ACT_WALK_RELAXED ] = ACT_WALK
|
||||
self.ActivityTranslateAI[ ACT_WALK_STIMULATED ] = ACT_WALK_STIMULATED
|
||||
self.ActivityTranslateAI[ ACT_WALK_AGITATED ] = ACT_WALK_AIM_PISTOL
|
||||
self.ActivityTranslateAI[ ACT_WALK_STEALTH ] = ACT_WALK_STEALTH_PISTOL
|
||||
|
||||
self.ActivityTranslateAI[ ACT_RUN_RELAXED ] = ACT_RUN
|
||||
self.ActivityTranslateAI[ ACT_RUN_STIMULATED ] = ACT_RUN_STIMULATED
|
||||
self.ActivityTranslateAI[ ACT_RUN_AGITATED ] = ACT_RUN_AIM_PISTOL
|
||||
self.ActivityTranslateAI[ ACT_RUN_STEALTH ] = ACT_RUN_STEALTH_PISTOL
|
||||
|
||||
self.ActivityTranslateAI[ ACT_IDLE_AIM_RELAXED ] = ACT_IDLE_PISTOL
|
||||
self.ActivityTranslateAI[ ACT_IDLE_AIM_STIMULATED ] = ACT_IDLE_ANGRY_PISTOL
|
||||
self.ActivityTranslateAI[ ACT_IDLE_AIM_AGITATED ] = ACT_IDLE_ANGRY_PISTOL
|
||||
self.ActivityTranslateAI[ ACT_IDLE_AIM_STEALTH ] = ACT_IDLE_STEALTH_PISTOL
|
||||
|
||||
self.ActivityTranslateAI[ ACT_WALK_AIM_RELAXED ] = ACT_WALK
|
||||
self.ActivityTranslateAI[ ACT_WALK_AIM_STIMULATED ] = ACT_WALK_AIM_PISTOL
|
||||
self.ActivityTranslateAI[ ACT_WALK_AIM_AGITATED ] = ACT_WALK_AIM_PISTOL
|
||||
self.ActivityTranslateAI[ ACT_WALK_AIM_STEALTH ] = ACT_WALK_AIM_STEALTH_PISTOL
|
||||
|
||||
self.ActivityTranslateAI[ ACT_RUN_AIM_RELAXED ] = ACT_RUN
|
||||
self.ActivityTranslateAI[ ACT_RUN_AIM_STIMULATED ] = ACT_RUN_AIM_PISTOL
|
||||
self.ActivityTranslateAI[ ACT_RUN_AIM_AGITATED ] = ACT_RUN_AIM_PISTOL
|
||||
self.ActivityTranslateAI[ ACT_RUN_AIM_STEALTH ] = ACT_RUN_AIM_STEALTH_PISTOL
|
||||
|
||||
self.ActivityTranslateAI[ ACT_CROUCHIDLE_STIMULATED] = ACT_CROUCHIDLE_STIMULATED
|
||||
self.ActivityTranslateAI[ ACT_CROUCHIDLE_AIM_STIMULATED ] = ACT_RANGE_AIM_PISTOL_LOW
|
||||
self.ActivityTranslateAI[ ACT_CROUCHIDLE_AGITATED ] = ACT_RANGE_AIM_PISTOL_LOW
|
||||
|
||||
self.ActivityTranslateAI[ ACT_READINESS_RELAXED_TO_STIMULATED ] = ACT_READINESS_PISTOL_RELAXED_TO_STIMULATED
|
||||
self.ActivityTranslateAI[ ACT_READINESS_RELAXED_TO_STIMULATED_WALK ] = ACT_READINESS_PISTOL_RELAXED_TO_STIMULATED_WALK
|
||||
self.ActivityTranslateAI[ ACT_READINESS_AGITATED_TO_STIMULATED ] = ACT_READINESS_PISTOL_AGITATED_TO_STIMULATED
|
||||
self.ActivityTranslateAI[ ACT_READINESS_STIMULATED_TO_RELAXED ] = ACT_READINESS_PISTOL_STIMULATED_TO_RELAXED
|
||||
|
||||
if ( t == "ar2" || t == "smg" ) then
|
||||
|
||||
self.ActivityTranslateAI[ ACT_RANGE_ATTACK1 ] = ACT_RANGE_ATTACK_AR2
|
||||
self.ActivityTranslateAI[ ACT_RELOAD ] = ACT_RELOAD_SMG1
|
||||
self.ActivityTranslateAI[ ACT_IDLE ] = ACT_IDLE_SMG1
|
||||
self.ActivityTranslateAI[ ACT_IDLE_ANGRY ] = ACT_IDLE_ANGRY_SMG1
|
||||
|
||||
self.ActivityTranslateAI[ ACT_WALK ] = ACT_WALK_RIFLE
|
||||
self.ActivityTranslateAI[ ACT_WALK_AIM ] = ACT_WALK_AIM_RIFLE
|
||||
|
||||
self.ActivityTranslateAI[ ACT_IDLE_RELAXED ] = ACT_IDLE_SMG1_RELAXED
|
||||
self.ActivityTranslateAI[ ACT_IDLE_STIMULATED ] = ACT_IDLE_SMG1_STIMULATED
|
||||
self.ActivityTranslateAI[ ACT_IDLE_AGITATED ] = ACT_IDLE_ANGRY_SMG1
|
||||
|
||||
self.ActivityTranslateAI[ ACT_WALK_RELAXED ] = ACT_WALK_RIFLE_RELAXED
|
||||
self.ActivityTranslateAI[ ACT_WALK_STIMULATED ] = ACT_WALK_RIFLE_STIMULATED
|
||||
self.ActivityTranslateAI[ ACT_WALK_AGITATED ] = ACT_WALK_AIM_RIFLE
|
||||
|
||||
self.ActivityTranslateAI[ ACT_RUN_RELAXED ] = ACT_RUN_RIFLE_RELAXED
|
||||
self.ActivityTranslateAI[ ACT_RUN_STIMULATED ] = ACT_RUN_RIFLE_STIMULATED
|
||||
self.ActivityTranslateAI[ ACT_RUN_AGITATED ] = ACT_RUN_AIM_RIFLE
|
||||
|
||||
self.ActivityTranslateAI[ ACT_IDLE_AIM_RELAXED ] = ACT_IDLE_SMG1_RELAXED
|
||||
self.ActivityTranslateAI[ ACT_IDLE_AIM_STIMULATED ] = ACT_IDLE_AIM_RIFLE_STIMULATED
|
||||
self.ActivityTranslateAI[ ACT_IDLE_AIM_AGITATED ] = ACT_IDLE_ANGRY_SMG1
|
||||
|
||||
self.ActivityTranslateAI[ ACT_WALK_AIM_RELAXED ] = ACT_WALK_RIFLE_RELAXED
|
||||
self.ActivityTranslateAI[ ACT_WALK_AIM_STIMULATED ] = ACT_WALK_AIM_RIFLE_STIMULATED
|
||||
self.ActivityTranslateAI[ ACT_WALK_AIM_AGITATED ] = ACT_WALK_AIM_RIFLE
|
||||
|
||||
self.ActivityTranslateAI[ ACT_RUN_AIM_RELAXED ] = ACT_RUN_RIFLE_RELAXED
|
||||
self.ActivityTranslateAI[ ACT_RUN_AIM_STIMULATED ] = ACT_RUN_AIM_RIFLE_STIMULATED
|
||||
self.ActivityTranslateAI[ ACT_RUN_AIM_AGITATED ] = ACT_RUN_AIM_RIFLE
|
||||
|
||||
self.ActivityTranslateAI[ ACT_WALK_CROUCH ] = ACT_WALK_CROUCH_RIFLE
|
||||
self.ActivityTranslateAI[ ACT_WALK_CROUCH_AIM ] = ACT_WALK_CROUCH_AIM_RIFLE
|
||||
self.ActivityTranslateAI[ ACT_RUN ] = ACT_RUN_RIFLE
|
||||
self.ActivityTranslateAI[ ACT_RUN_AIM ] = ACT_RUN_AIM_RIFLE
|
||||
self.ActivityTranslateAI[ ACT_RUN_CROUCH ] = ACT_RUN_CROUCH_RIFLE
|
||||
self.ActivityTranslateAI[ ACT_RUN_CROUCH_AIM ] = ACT_RUN_CROUCH_AIM_RIFLE
|
||||
self.ActivityTranslateAI[ ACT_GESTURE_RANGE_ATTACK1 ] = ACT_GESTURE_RANGE_ATTACK_AR2
|
||||
self.ActivityTranslateAI[ ACT_RANGE_ATTACK1_LOW ] = ACT_RANGE_ATTACK_SMG1_LOW
|
||||
self.ActivityTranslateAI[ ACT_COVER_LOW ] = ACT_COVER_SMG1_LOW
|
||||
self.ActivityTranslateAI[ ACT_RANGE_AIM_LOW ] = ACT_RANGE_AIM_AR2_LOW
|
||||
self.ActivityTranslateAI[ ACT_RELOAD_LOW ] = ACT_RELOAD_SMG1_LOW
|
||||
self.ActivityTranslateAI[ ACT_GESTURE_RELOAD ] = ACT_GESTURE_RELOAD_SMG1
|
||||
|
||||
-- Extra overrides for SMG holdtype
|
||||
if ( t == "smg" ) then
|
||||
self.ActivityTranslateAI[ ACT_RANGE_ATTACK1 ] = ACT_RANGE_ATTACK_SMG1
|
||||
self.ActivityTranslateAI[ ACT_GESTURE_RANGE_ATTACK1 ] = ACT_GESTURE_RANGE_ATTACK_SMG1
|
||||
self.ActivityTranslateAI[ ACT_RANGE_AIM_LOW ] = ACT_RANGE_AIM_SMG1_LOW
|
||||
end
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
if ( t == "shotgun" || t == "crossbow" ) then
|
||||
self.ActivityTranslateAI[ ACT_IDLE ] = ACT_IDLE_SMG1
|
||||
|
||||
self.ActivityTranslateAI[ ACT_RANGE_ATTACK1 ] = ACT_RANGE_ATTACK_SHOTGUN
|
||||
self.ActivityTranslateAI[ ACT_RELOAD ] = ACT_RELOAD_SHOTGUN
|
||||
self.ActivityTranslateAI[ ACT_WALK ] = ACT_WALK_RIFLE
|
||||
self.ActivityTranslateAI[ ACT_IDLE_ANGRY ] = ACT_IDLE_ANGRY_SHOTGUN
|
||||
|
||||
self.ActivityTranslateAI[ ACT_IDLE_RELAXED ] = ACT_IDLE_SHOTGUN_RELAXED
|
||||
self.ActivityTranslateAI[ ACT_IDLE_STIMULATED ] = ACT_IDLE_SHOTGUN_STIMULATED
|
||||
self.ActivityTranslateAI[ ACT_IDLE_AGITATED ] = ACT_IDLE_SHOTGUN_AGITATED
|
||||
|
||||
self.ActivityTranslateAI[ ACT_WALK_RELAXED ] = ACT_WALK_RIFLE_RELAXED
|
||||
self.ActivityTranslateAI[ ACT_WALK_STIMULATED ] = ACT_WALK_RIFLE_STIMULATED
|
||||
self.ActivityTranslateAI[ ACT_WALK_AGITATED ] = ACT_WALK_AIM_RIFLE
|
||||
|
||||
self.ActivityTranslateAI[ ACT_RUN_RELAXED ] = ACT_RUN_RIFLE_RELAXED
|
||||
self.ActivityTranslateAI[ ACT_RUN_STIMULATED ] = ACT_RUN_RIFLE_STIMULATED
|
||||
self.ActivityTranslateAI[ ACT_RUN_AGITATED ] = ACT_RUN_AIM_RIFLE
|
||||
|
||||
self.ActivityTranslateAI[ ACT_IDLE_AIM_RELAXED ] = ACT_IDLE_SMG1_RELAXED
|
||||
self.ActivityTranslateAI[ ACT_IDLE_AIM_STIMULATED ] = ACT_IDLE_AIM_RIFLE_STIMULATED
|
||||
self.ActivityTranslateAI[ ACT_IDLE_AIM_AGITATED ] = ACT_IDLE_ANGRY_SMG1
|
||||
|
||||
self.ActivityTranslateAI[ ACT_WALK_AIM_RELAXED ] = ACT_WALK_RIFLE_RELAXED
|
||||
self.ActivityTranslateAI[ ACT_WALK_AIM_STIMULATED ] = ACT_WALK_AIM_RIFLE_STIMULATED
|
||||
self.ActivityTranslateAI[ ACT_WALK_AIM_AGITATED ] = ACT_WALK_AIM_RIFLE
|
||||
|
||||
self.ActivityTranslateAI[ ACT_RUN_AIM_RELAXED ] = ACT_RUN_RIFLE_RELAXED
|
||||
self.ActivityTranslateAI[ ACT_RUN_AIM_STIMULATED ] = ACT_RUN_AIM_RIFLE_STIMULATED
|
||||
self.ActivityTranslateAI[ ACT_RUN_AIM_AGITATED ] = ACT_RUN_AIM_RIFLE
|
||||
|
||||
self.ActivityTranslateAI[ ACT_WALK_AIM ] = ACT_WALK_AIM_SHOTGUN
|
||||
self.ActivityTranslateAI[ ACT_WALK_CROUCH ] = ACT_WALK_CROUCH_RIFLE
|
||||
self.ActivityTranslateAI[ ACT_WALK_CROUCH_AIM ] = ACT_WALK_CROUCH_AIM_RIFLE
|
||||
self.ActivityTranslateAI[ ACT_RUN ] = ACT_RUN_RIFLE
|
||||
self.ActivityTranslateAI[ ACT_RUN_AIM ] = ACT_RUN_AIM_SHOTGUN
|
||||
self.ActivityTranslateAI[ ACT_RUN_CROUCH ] = ACT_RUN_CROUCH_RIFLE
|
||||
self.ActivityTranslateAI[ ACT_RUN_CROUCH_AIM ] = ACT_RUN_CROUCH_AIM_RIFLE
|
||||
self.ActivityTranslateAI[ ACT_GESTURE_RANGE_ATTACK1 ] = ACT_GESTURE_RANGE_ATTACK_SHOTGUN
|
||||
self.ActivityTranslateAI[ ACT_RANGE_ATTACK1_LOW ] = ACT_RANGE_ATTACK_SHOTGUN_LOW
|
||||
self.ActivityTranslateAI[ ACT_RELOAD_LOW ] = ACT_RELOAD_SHOTGUN_LOW
|
||||
self.ActivityTranslateAI[ ACT_GESTURE_RELOAD ] = ACT_GESTURE_RELOAD_SHOTGUN
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
if ( t == "rpg" ) then
|
||||
self.ActivityTranslateAI[ ACT_RANGE_ATTACK1 ] = ACT_RANGE_ATTACK_RPG
|
||||
|
||||
self.ActivityTranslateAI[ ACT_IDLE_RELAXED ] = ACT_IDLE_RPG_RELAXED
|
||||
self.ActivityTranslateAI[ ACT_IDLE_STIMULATED ] = ACT_IDLE_ANGRY_RPG
|
||||
self.ActivityTranslateAI[ ACT_IDLE_AGITATED ] = ACT_IDLE_ANGRY_RPG
|
||||
|
||||
self.ActivityTranslateAI[ ACT_IDLE ] = ACT_IDLE_RPG
|
||||
self.ActivityTranslateAI[ ACT_IDLE_ANGRY ] = ACT_IDLE_ANGRY_RPG
|
||||
self.ActivityTranslateAI[ ACT_WALK ] = ACT_WALK_RPG
|
||||
self.ActivityTranslateAI[ ACT_WALK_CROUCH ] = ACT_WALK_CROUCH_RPG
|
||||
self.ActivityTranslateAI[ ACT_RUN ] = ACT_RUN_RPG
|
||||
self.ActivityTranslateAI[ ACT_RUN_CROUCH ] = ACT_RUN_CROUCH_RPG
|
||||
self.ActivityTranslateAI[ ACT_COVER_LOW ] = ACT_COVER_LOW_RPG
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
end
|
||||
212
gamemodes/cod_custom/entities/weapons/weapon_base/cl_init.lua
Normal file
212
gamemodes/cod_custom/entities/weapons/weapon_base/cl_init.lua
Normal file
@@ -0,0 +1,212 @@
|
||||
|
||||
include( "ai_translations.lua" )
|
||||
include( "sh_anim.lua" )
|
||||
include( "shared.lua" )
|
||||
|
||||
SWEP.Slot = 0 -- Slot in the weapon selection menu
|
||||
SWEP.SlotPos = 10 -- Position in the slot
|
||||
SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter
|
||||
SWEP.DrawCrosshair = true -- Should draw the default crosshair
|
||||
SWEP.DrawWeaponInfoBox = true -- Should draw the weapon info box
|
||||
SWEP.BounceWeaponIcon = true -- Should the weapon icon bounce?
|
||||
SWEP.SwayScale = 1.0 -- The scale of the viewmodel sway
|
||||
SWEP.BobScale = 1.0 -- The scale of the viewmodel bob
|
||||
|
||||
SWEP.RenderGroup = RENDERGROUP_OPAQUE
|
||||
|
||||
-- Override this in your SWEP to set the icon in the weapon selection
|
||||
SWEP.WepSelectIcon = surface.GetTextureID( "weapons/swep" )
|
||||
|
||||
-- This is the corner of the speech bubble
|
||||
SWEP.SpeechBubbleLid = surface.GetTextureID( "gui/speech_lid" )
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
You can draw to the HUD here - it will only draw when
|
||||
the client has the weapon deployed..
|
||||
-----------------------------------------------------------]]
|
||||
function SWEP:DrawHUD()
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Checks the objects before any action is taken
|
||||
This is to make sure that the entities haven't been removed
|
||||
-----------------------------------------------------------]]
|
||||
function SWEP:DrawWeaponSelection( x, y, wide, tall, alpha )
|
||||
|
||||
-- Set us up the texture
|
||||
surface.SetDrawColor( 255, 255, 255, alpha )
|
||||
surface.SetTexture( self.WepSelectIcon )
|
||||
|
||||
-- Lets get a sin wave to make it bounce
|
||||
local fsin = 0
|
||||
|
||||
if ( self.BounceWeaponIcon == true ) then
|
||||
fsin = math.sin( CurTime() * 10 ) * 5
|
||||
end
|
||||
|
||||
-- Borders
|
||||
y = y + 10
|
||||
x = x + 10
|
||||
wide = wide - 20
|
||||
|
||||
-- Draw that mother
|
||||
surface.DrawTexturedRect( x + fsin, y - fsin, wide - fsin * 2 , ( wide / 2 ) + fsin )
|
||||
|
||||
-- Draw weapon info box
|
||||
self:PrintWeaponInfo( x + wide + 20, y + tall * 0.95, alpha )
|
||||
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
This draws the weapon info box
|
||||
-----------------------------------------------------------]]
|
||||
function SWEP:PrintWeaponInfo( x, y, alpha )
|
||||
|
||||
if ( self.DrawWeaponInfoBox == false ) then return end
|
||||
|
||||
if (self.InfoMarkup == nil ) then
|
||||
local str
|
||||
local title_color = "<color=230,230,230,255>"
|
||||
local text_color = "<color=150,150,150,255>"
|
||||
|
||||
str = "<font=HudSelectionText>"
|
||||
if ( self.Author != "" ) then str = str .. title_color .. "Author:</color>\t" .. text_color .. self.Author .. "</color>\n" end
|
||||
if ( self.Contact != "" ) then str = str .. title_color .. "Contact:</color>\t" .. text_color .. self.Contact .. "</color>\n\n" end
|
||||
if ( self.Purpose != "" ) then str = str .. title_color .. "Purpose:</color>\n" .. text_color .. self.Purpose .. "</color>\n\n" end
|
||||
if ( self.Instructions != "" ) then str = str .. title_color .. "Instructions:</color>\n" .. text_color .. self.Instructions .. "</color>\n" end
|
||||
str = str .. "</font>"
|
||||
|
||||
self.InfoMarkup = markup.Parse( str, 250 )
|
||||
end
|
||||
|
||||
surface.SetDrawColor( 60, 60, 60, alpha )
|
||||
surface.SetTexture( self.SpeechBubbleLid )
|
||||
|
||||
surface.DrawTexturedRect( x, y - 64 - 5, 128, 64 )
|
||||
draw.RoundedBox( 8, x - 5, y - 6, 260, self.InfoMarkup:GetHeight() + 18, Color( 60, 60, 60, alpha ) )
|
||||
|
||||
self.InfoMarkup:Draw( x + 5, y + 5, nil, nil, alpha )
|
||||
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Name: SWEP:FreezeMovement()
|
||||
Desc: Return true to freeze moving the view
|
||||
-----------------------------------------------------------]]
|
||||
function SWEP:FreezeMovement()
|
||||
return false
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Name: SWEP:ViewModelDrawn( viewModel )
|
||||
Desc: Called straight after the viewmodel has been drawn
|
||||
-----------------------------------------------------------]]
|
||||
function SWEP:ViewModelDrawn( vm )
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Name: OnRestore
|
||||
Desc: Called immediately after a "load"
|
||||
-----------------------------------------------------------]]
|
||||
function SWEP:OnRestore()
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Name: CustomAmmoDisplay
|
||||
Desc: Return a table
|
||||
-----------------------------------------------------------]]
|
||||
function SWEP:CustomAmmoDisplay()
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Name: GetViewModelPosition
|
||||
Desc: Allows you to re-position the view model
|
||||
-----------------------------------------------------------]]
|
||||
function SWEP:GetViewModelPosition( pos, ang )
|
||||
|
||||
return pos, ang
|
||||
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Name: TranslateFOV
|
||||
Desc: Allows the weapon to translate the player's FOV (clientside)
|
||||
-----------------------------------------------------------]]
|
||||
function SWEP:TranslateFOV( current_fov )
|
||||
|
||||
return current_fov
|
||||
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Name: DrawWorldModel
|
||||
Desc: Draws the world model (not the viewmodel)
|
||||
-----------------------------------------------------------]]
|
||||
function SWEP:DrawWorldModel()
|
||||
|
||||
self:DrawModel()
|
||||
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Name: DrawWorldModelTranslucent
|
||||
Desc: Draws the world model (not the viewmodel)
|
||||
-----------------------------------------------------------]]
|
||||
function SWEP:DrawWorldModelTranslucent()
|
||||
|
||||
self:DrawModel()
|
||||
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Name: AdjustMouseSensitivity
|
||||
Desc: Allows you to adjust the mouse sensitivity.
|
||||
-----------------------------------------------------------]]
|
||||
function SWEP:AdjustMouseSensitivity()
|
||||
|
||||
return nil
|
||||
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Name: GetTracerOrigin
|
||||
Desc: Allows you to override where the tracer comes from (in first person view)
|
||||
returning anything but a vector indicates that you want the default action
|
||||
-----------------------------------------------------------]]
|
||||
function SWEP:GetTracerOrigin()
|
||||
|
||||
--[[
|
||||
local ply = self:GetOwner()
|
||||
local pos = ply:EyePos() + ply:EyeAngles():Right() * -5
|
||||
return pos
|
||||
--]]
|
||||
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Name: FireAnimationEvent
|
||||
Desc: Allows you to override weapon animation events
|
||||
-----------------------------------------------------------]]
|
||||
function SWEP:FireAnimationEvent( pos, ang, event, options )
|
||||
|
||||
if ( !self.CSMuzzleFlashes ) then return end
|
||||
|
||||
-- CS Muzzle flashes
|
||||
if ( event == 5001 or event == 5011 or event == 5021 or event == 5031 ) then
|
||||
|
||||
local data = EffectData()
|
||||
data:SetFlags( 0 )
|
||||
data:SetEntity( self.Owner:GetViewModel() )
|
||||
data:SetAttachment( math.floor( ( event - 4991 ) / 10 ) )
|
||||
data:SetScale( 1 )
|
||||
|
||||
if ( self.CSMuzzleX ) then
|
||||
util.Effect( "CS_MuzzleFlash_X", data )
|
||||
else
|
||||
util.Effect( "CS_MuzzleFlash", data )
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
end
|
||||
104
gamemodes/cod_custom/entities/weapons/weapon_base/init.lua
Normal file
104
gamemodes/cod_custom/entities/weapons/weapon_base/init.lua
Normal file
@@ -0,0 +1,104 @@
|
||||
|
||||
AddCSLuaFile( "cl_init.lua" )
|
||||
AddCSLuaFile( "ai_translations.lua" )
|
||||
AddCSLuaFile( "sh_anim.lua" )
|
||||
AddCSLuaFile( "shared.lua" )
|
||||
|
||||
include( "ai_translations.lua" )
|
||||
include( "sh_anim.lua" )
|
||||
include( "shared.lua" )
|
||||
|
||||
SWEP.Weight = 5 -- Decides whether we should switch from/to this
|
||||
SWEP.AutoSwitchTo = true -- Auto switch to if we pick it up
|
||||
SWEP.AutoSwitchFrom = true -- Auto switch from if you pick up a better weapon
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Name: OnRestore
|
||||
Desc: The game has just been reloaded. This is usually the right place
|
||||
to call the GetNW* functions to restore the script's values.
|
||||
-----------------------------------------------------------]]
|
||||
function SWEP:OnRestore()
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Name: AcceptInput
|
||||
Desc: Accepts input, return true to override/accept input
|
||||
-----------------------------------------------------------]]
|
||||
function SWEP:AcceptInput( name, activator, caller, data )
|
||||
return false
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Name: KeyValue
|
||||
Desc: Called when a keyvalue is added to us
|
||||
-----------------------------------------------------------]]
|
||||
function SWEP:KeyValue( key, value )
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Name: Equip
|
||||
Desc: A player or NPC has picked the weapon up
|
||||
-----------------------------------------------------------]]
|
||||
function SWEP:Equip( newOwner )
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Name: EquipAmmo
|
||||
Desc: The player has picked up the weapon and has taken the ammo from it
|
||||
The weapon will be removed immidiately after this call.
|
||||
-----------------------------------------------------------]]
|
||||
function SWEP:EquipAmmo( newOwner )
|
||||
end
|
||||
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Name: OnDrop
|
||||
Desc: Weapon was dropped
|
||||
-----------------------------------------------------------]]
|
||||
function SWEP:OnDrop()
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Name: ShouldDropOnDie
|
||||
Desc: Should this weapon be dropped when its owner dies?
|
||||
-----------------------------------------------------------]]
|
||||
function SWEP:ShouldDropOnDie()
|
||||
return true
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Name: GetCapabilities
|
||||
Desc: For NPCs, returns what they should try to do with it.
|
||||
-----------------------------------------------------------]]
|
||||
function SWEP:GetCapabilities()
|
||||
|
||||
return CAP_WEAPON_RANGE_ATTACK1
|
||||
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Name: NPCShoot_Secondary
|
||||
Desc: NPC tried to fire secondary attack
|
||||
-----------------------------------------------------------]]
|
||||
function SWEP:NPCShoot_Secondary( shootPos, shootDir )
|
||||
|
||||
self:SecondaryAttack()
|
||||
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Name: NPCShoot_Secondary
|
||||
Desc: NPC tried to fire primary attack
|
||||
-----------------------------------------------------------]]
|
||||
function SWEP:NPCShoot_Primary( shootPos, shootDir )
|
||||
|
||||
self:PrimaryAttack()
|
||||
|
||||
end
|
||||
|
||||
-- These tell the NPC how to use the weapon
|
||||
AccessorFunc( SWEP, "fNPCMinBurst", "NPCMinBurst" )
|
||||
AccessorFunc( SWEP, "fNPCMaxBurst", "NPCMaxBurst" )
|
||||
AccessorFunc( SWEP, "fNPCFireRate", "NPCFireRate" )
|
||||
AccessorFunc( SWEP, "fNPCMinRestTime", "NPCMinRest" )
|
||||
AccessorFunc( SWEP, "fNPCMaxRestTime", "NPCMaxRest" )
|
||||
@@ -0,0 +1,87 @@
|
||||
|
||||
local ActIndex = {
|
||||
[ "pistol" ] = ACT_HL2MP_IDLE_PISTOL,
|
||||
[ "smg" ] = ACT_HL2MP_IDLE_SMG1,
|
||||
[ "grenade" ] = ACT_HL2MP_IDLE_GRENADE,
|
||||
[ "ar2" ] = ACT_HL2MP_IDLE_AR2,
|
||||
[ "shotgun" ] = ACT_HL2MP_IDLE_SHOTGUN,
|
||||
[ "rpg" ] = ACT_HL2MP_IDLE_RPG,
|
||||
[ "physgun" ] = ACT_HL2MP_IDLE_PHYSGUN,
|
||||
[ "crossbow" ] = ACT_HL2MP_IDLE_CROSSBOW,
|
||||
[ "melee" ] = ACT_HL2MP_IDLE_MELEE,
|
||||
[ "slam" ] = ACT_HL2MP_IDLE_SLAM,
|
||||
[ "normal" ] = ACT_HL2MP_IDLE,
|
||||
[ "fist" ] = ACT_HL2MP_IDLE_FIST,
|
||||
[ "melee2" ] = ACT_HL2MP_IDLE_MELEE2,
|
||||
[ "passive" ] = ACT_HL2MP_IDLE_PASSIVE,
|
||||
[ "knife" ] = ACT_HL2MP_IDLE_KNIFE,
|
||||
[ "duel" ] = ACT_HL2MP_IDLE_DUEL,
|
||||
[ "camera" ] = ACT_HL2MP_IDLE_CAMERA,
|
||||
[ "magic" ] = ACT_HL2MP_IDLE_MAGIC,
|
||||
[ "revolver" ] = ACT_HL2MP_IDLE_REVOLVER
|
||||
}
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Name: SetWeaponHoldType
|
||||
Desc: Sets up the translation table, to translate from normal
|
||||
standing idle pose, to holding weapon pose.
|
||||
-----------------------------------------------------------]]
|
||||
function SWEP:SetWeaponHoldType( t )
|
||||
|
||||
t = string.lower( t )
|
||||
local index = ActIndex[ t ]
|
||||
|
||||
if ( index == nil ) then
|
||||
Msg( "SWEP:SetWeaponHoldType - ActIndex[ \"" .. t .. "\" ] isn't set! (defaulting to normal)\n" )
|
||||
t = "normal"
|
||||
index = ActIndex[ t ]
|
||||
end
|
||||
|
||||
self.ActivityTranslate = {}
|
||||
self.ActivityTranslate[ ACT_MP_STAND_IDLE ] = index
|
||||
self.ActivityTranslate[ ACT_MP_WALK ] = index + 1
|
||||
self.ActivityTranslate[ ACT_MP_RUN ] = index + 2
|
||||
self.ActivityTranslate[ ACT_MP_CROUCH_IDLE ] = index + 3
|
||||
self.ActivityTranslate[ ACT_MP_CROUCHWALK ] = index + 4
|
||||
self.ActivityTranslate[ ACT_MP_ATTACK_STAND_PRIMARYFIRE ] = index + 5
|
||||
self.ActivityTranslate[ ACT_MP_ATTACK_CROUCH_PRIMARYFIRE ] = index + 5
|
||||
self.ActivityTranslate[ ACT_MP_RELOAD_STAND ] = index + 6
|
||||
self.ActivityTranslate[ ACT_MP_RELOAD_CROUCH ] = index + 6
|
||||
self.ActivityTranslate[ ACT_MP_JUMP ] = index + 7
|
||||
self.ActivityTranslate[ ACT_RANGE_ATTACK1 ] = index + 8
|
||||
self.ActivityTranslate[ ACT_MP_SWIM ] = index + 9
|
||||
|
||||
-- "normal" jump animation doesn't exist
|
||||
if ( t == "normal" ) then
|
||||
self.ActivityTranslate[ ACT_MP_JUMP ] = ACT_HL2MP_JUMP_SLAM
|
||||
end
|
||||
|
||||
self:SetupWeaponHoldTypeForAI( t )
|
||||
|
||||
end
|
||||
|
||||
-- Default hold pos is the pistol
|
||||
SWEP:SetWeaponHoldType( "pistol" )
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Name: weapon:TranslateActivity()
|
||||
Desc: Translate a player's Activity into a weapon's activity
|
||||
So for example, ACT_HL2MP_RUN becomes ACT_HL2MP_RUN_PISTOL
|
||||
Depending on how you want the player to be holding the weapon
|
||||
-----------------------------------------------------------]]
|
||||
function SWEP:TranslateActivity( act )
|
||||
|
||||
if ( self.Owner:IsNPC() ) then
|
||||
if ( self.ActivityTranslateAI[ act ] ) then
|
||||
return self.ActivityTranslateAI[ act ]
|
||||
end
|
||||
return -1
|
||||
end
|
||||
|
||||
if ( self.ActivityTranslate[ act ] != nil ) then
|
||||
return self.ActivityTranslate[ act ]
|
||||
end
|
||||
|
||||
return -1
|
||||
|
||||
end
|
||||
273
gamemodes/cod_custom/entities/weapons/weapon_base/shared.lua
Normal file
273
gamemodes/cod_custom/entities/weapons/weapon_base/shared.lua
Normal file
@@ -0,0 +1,273 @@
|
||||
|
||||
-- Variables that are used on both client and server
|
||||
|
||||
SWEP.PrintName = "Scripted Weapon" -- 'Nice' Weapon name (Shown on HUD)
|
||||
SWEP.Author = ""
|
||||
SWEP.Contact = ""
|
||||
SWEP.Purpose = ""
|
||||
SWEP.Instructions = ""
|
||||
|
||||
SWEP.ViewModelFOV = 62
|
||||
SWEP.ViewModelFlip = false
|
||||
SWEP.ViewModel = "models/weapons/v_pistol.mdl"
|
||||
SWEP.WorldModel = "models/weapons/w_357.mdl"
|
||||
|
||||
SWEP.Spawnable = false
|
||||
SWEP.AdminOnly = false
|
||||
|
||||
SWEP.Primary.ClipSize = 8 -- Size of a clip
|
||||
SWEP.Primary.DefaultClip = 32 -- Default number of bullets in a clip
|
||||
SWEP.Primary.Automatic = false -- Automatic/Semi Auto
|
||||
SWEP.Primary.Ammo = "Pistol"
|
||||
|
||||
SWEP.Secondary.ClipSize = 8 -- Size of a clip
|
||||
SWEP.Secondary.DefaultClip = 32 -- Default number of bullets in a clip
|
||||
SWEP.Secondary.Automatic = false -- Automatic/Semi Auto
|
||||
SWEP.Secondary.Ammo = "Pistol"
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Name: SWEP:Initialize()
|
||||
Desc: Called when the weapon is first loaded
|
||||
-----------------------------------------------------------]]
|
||||
function SWEP:Initialize()
|
||||
|
||||
self:SetHoldType( "pistol" )
|
||||
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Name: SWEP:PrimaryAttack()
|
||||
Desc: +attack1 has been pressed
|
||||
-----------------------------------------------------------]]
|
||||
function SWEP:PrimaryAttack()
|
||||
|
||||
-- Make sure we can shoot first
|
||||
if ( !self:CanPrimaryAttack() ) then return end
|
||||
|
||||
-- Play shoot sound
|
||||
self:EmitSound( "Weapon_AR2.Single" )
|
||||
|
||||
-- Shoot 9 bullets, 150 damage, 0.75 aimcone
|
||||
self:ShootBullet( 150, 1, 0.01, self.Primary.Ammo )
|
||||
|
||||
-- Remove 1 bullet from our clip
|
||||
self:TakePrimaryAmmo( 1 )
|
||||
|
||||
-- Punch the player's view
|
||||
if ( !self.Owner:IsNPC() ) then self.Owner:ViewPunch( Angle( -1, 0, 0 ) ) end
|
||||
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Name: SWEP:SecondaryAttack()
|
||||
Desc: +attack2 has been pressed
|
||||
-----------------------------------------------------------]]
|
||||
function SWEP:SecondaryAttack()
|
||||
|
||||
-- Make sure we can shoot first
|
||||
if ( !self:CanSecondaryAttack() ) then return end
|
||||
|
||||
-- Play shoot sound
|
||||
self:EmitSound("Weapon_Shotgun.Single")
|
||||
|
||||
-- Shoot 9 bullets, 150 damage, 0.75 aimcone
|
||||
self:ShootBullet( 150, 9, 0.2, self.Secondary.Ammo )
|
||||
|
||||
-- Remove 1 bullet from our clip
|
||||
self:TakeSecondaryAmmo( 1 )
|
||||
|
||||
-- Punch the player's view
|
||||
if ( !self.Owner:IsNPC() ) then self.Owner:ViewPunch( Angle( -10, 0, 0 ) ) end
|
||||
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Name: SWEP:Reload()
|
||||
Desc: Reload is being pressed
|
||||
-----------------------------------------------------------]]
|
||||
function SWEP:Reload()
|
||||
self:DefaultReload( ACT_VM_RELOAD )
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Name: SWEP:Think()
|
||||
Desc: Called every frame
|
||||
-----------------------------------------------------------]]
|
||||
function SWEP:Think()
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Name: SWEP:Holster( weapon_to_swap_to )
|
||||
Desc: Weapon wants to holster
|
||||
RetV: Return true to allow the weapon to holster
|
||||
-----------------------------------------------------------]]
|
||||
function SWEP:Holster( wep )
|
||||
return true
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Name: SWEP:Deploy()
|
||||
Desc: Whip it out
|
||||
-----------------------------------------------------------]]
|
||||
function SWEP:Deploy()
|
||||
return true
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Name: SWEP:ShootEffects()
|
||||
Desc: A convenience function to create shoot effects
|
||||
-----------------------------------------------------------]]
|
||||
function SWEP:ShootEffects()
|
||||
|
||||
self:SendWeaponAnim( ACT_VM_PRIMARYATTACK ) -- View model animation
|
||||
self.Owner:MuzzleFlash() -- Crappy muzzle light
|
||||
self.Owner:SetAnimation( PLAYER_ATTACK1 ) -- 3rd Person Animation
|
||||
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Name: SWEP:ShootBullet()
|
||||
Desc: A convenience function to shoot bullets
|
||||
-----------------------------------------------------------]]
|
||||
function SWEP:ShootBullet( damage, num_bullets, aimcone, ammo_type, force, tracer )
|
||||
|
||||
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 = tracer || 5 -- Show a tracer on every x bullets
|
||||
bullet.Force = force || 1 -- Amount of force to give to phys objects
|
||||
bullet.Damage = damage
|
||||
bullet.AmmoType = ammo_type || self.Primary.Ammo
|
||||
|
||||
self.Owner:FireBullets( bullet )
|
||||
|
||||
self:ShootEffects()
|
||||
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Name: SWEP:TakePrimaryAmmo()
|
||||
Desc: A convenience function to remove ammo
|
||||
-----------------------------------------------------------]]
|
||||
function SWEP:TakePrimaryAmmo( num )
|
||||
|
||||
-- Doesn't use clips
|
||||
if ( self:Clip1() <= 0 ) then
|
||||
|
||||
if ( self:Ammo1() <= 0 ) then return end
|
||||
|
||||
self.Owner:RemoveAmmo( num, self:GetPrimaryAmmoType() )
|
||||
|
||||
return end
|
||||
|
||||
self:SetClip1( self:Clip1() - num )
|
||||
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Name: SWEP:TakeSecondaryAmmo()
|
||||
Desc: A convenience function to remove ammo
|
||||
-----------------------------------------------------------]]
|
||||
function SWEP:TakeSecondaryAmmo( num )
|
||||
|
||||
-- Doesn't use clips
|
||||
if ( self:Clip2() <= 0 ) then
|
||||
|
||||
if ( self:Ammo2() <= 0 ) then return end
|
||||
|
||||
self.Owner:RemoveAmmo( num, self:GetSecondaryAmmoType() )
|
||||
|
||||
return end
|
||||
|
||||
self:SetClip2( self:Clip2() - num )
|
||||
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Name: SWEP:CanPrimaryAttack()
|
||||
Desc: Helper function for checking for no ammo
|
||||
-----------------------------------------------------------]]
|
||||
function SWEP:CanPrimaryAttack()
|
||||
|
||||
if ( self:Clip1() <= 0 ) then
|
||||
|
||||
self:EmitSound( "Weapon_Pistol.Empty" )
|
||||
self:SetNextPrimaryFire( CurTime() + 0.2 )
|
||||
self:Reload()
|
||||
return false
|
||||
|
||||
end
|
||||
|
||||
return true
|
||||
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Name: SWEP:CanSecondaryAttack()
|
||||
Desc: Helper function for checking for no ammo
|
||||
-----------------------------------------------------------]]
|
||||
function SWEP:CanSecondaryAttack()
|
||||
|
||||
if ( self:Clip2() <= 0 ) then
|
||||
|
||||
self:EmitSound( "Weapon_Pistol.Empty" )
|
||||
self:SetNextSecondaryFire( CurTime() + 0.2 )
|
||||
return false
|
||||
|
||||
end
|
||||
|
||||
return true
|
||||
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Name: OnRemove
|
||||
Desc: Called just before entity is deleted
|
||||
-----------------------------------------------------------]]
|
||||
function SWEP:OnRemove()
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Name: OwnerChanged
|
||||
Desc: When weapon is dropped or picked up by a new player
|
||||
-----------------------------------------------------------]]
|
||||
function SWEP:OwnerChanged()
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Name: Ammo1
|
||||
Desc: Returns how much of ammo1 the player has
|
||||
-----------------------------------------------------------]]
|
||||
function SWEP:Ammo1()
|
||||
return self.Owner:GetAmmoCount( self:GetPrimaryAmmoType() )
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Name: Ammo2
|
||||
Desc: Returns how much of ammo2 the player has
|
||||
-----------------------------------------------------------]]
|
||||
function SWEP:Ammo2()
|
||||
return self.Owner:GetAmmoCount( self:GetSecondaryAmmoType() )
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Name: SetDeploySpeed
|
||||
Desc: Sets the weapon deploy speed.
|
||||
This value needs to match on client and server.
|
||||
-----------------------------------------------------------]]
|
||||
function SWEP:SetDeploySpeed( speed )
|
||||
self.m_WeaponDeploySpeed = tonumber( speed )
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Name: DoImpactEffect
|
||||
Desc: Callback so the weapon can override the impact effects it makes
|
||||
return true to not do the default thing - which is to call UTIL_ImpactTrace in c++
|
||||
-----------------------------------------------------------]]
|
||||
function SWEP:DoImpactEffect( tr, nDamageType )
|
||||
|
||||
return false
|
||||
|
||||
end
|
||||
@@ -0,0 +1,54 @@
|
||||
if (!file.Exists("autorun/vj_base_autorun.lua","LUA")) then return end
|
||||
---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.Base = "weapon_vj_base"
|
||||
SWEP.PrintName = "AK47"
|
||||
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"
|
||||
-- Client Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
if CLIENT then
|
||||
SWEP.Slot = 1 -- Which weapon slot you want your SWEP to be in? (1 2 3 4 5 6)
|
||||
SWEP.SlotPos = 1 -- Which part of that slot do you want the SWEP to be in? (1 2 3 4 5 6)
|
||||
SWEP.SwayScale = 2 -- Default is 1, The scale of the viewmodel sway
|
||||
end
|
||||
-- NPC Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.NPC_NextPrimaryFire = 0.12 -- Next time it can use primary fire
|
||||
SWEP.NPC_CustomSpread = 0.8 -- This is added on top of the custom spread that's set inside the SNPC! | Starting from 1: Closer to 0 = better accuracy, Farther than 1 = worse accuracy
|
||||
-- Main Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.HoldType = "ar2"
|
||||
SWEP.ViewModelFOV = 70 -- Player FOV for the view model
|
||||
SWEP.Spawnable = true
|
||||
SWEP.AdminSpawnable = false
|
||||
-- Primary Fire ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.Primary.AllowFireInWater = true -- If true, you will be able to use primary fire in water
|
||||
SWEP.Primary.Damage = 16 -- Damage
|
||||
SWEP.Primary.PlayerDamage = 16 -- Only applies for players | "Same" = Same as self.Primary.Damage, "Double" = Double the self.Primary.Damage OR put a number to be different from self.Primary.Damage
|
||||
SWEP.Primary.Force = 5 -- Force applied on the object the bullet hits
|
||||
SWEP.Primary.ClipSize = 30 -- Max amount of bullets per clip
|
||||
SWEP.Primary.Recoil = 0.3 -- How much recoil does the player get?
|
||||
SWEP.Primary.Cone = 5 -- How accurate is the bullet? (Players)
|
||||
SWEP.Primary.Delay = 0.01 -- Time until it can shoot again
|
||||
SWEP.Primary.Automatic = true -- Is it automatic?
|
||||
SWEP.Primary.Ammo = "AR2" -- Ammo type
|
||||
SWEP.Primary.Sound = {"viper/weapons/akilo47/weap_akilo47_fire_plr_01.ogg", "viper/weapons/akilo47/weap_akilo47_fire_plr_02.ogg", "viper/weapons/akilo47/weap_akilo47_fire_plr_03.ogg", "viper/weapons/akilo47/weap_akilo47_fire_plr_04.ogg", "viper/weapons/akilo47/weap_akilo47_fire_plr_05.ogg", "viper/weapons/akilo47/weap_akilo47_fire_plr_06.ogg"}
|
||||
SWEP.Primary.DistantSound = {"viper/weapons/akilo47/weap_akilo47_fire_plr_01.ogg", "viper/weapons/akilo47/weap_akilo47_fire_plr_02.ogg", "viper/weapons/akilo47/weap_akilo47_fire_plr_03.ogg", "viper/weapons/akilo47/weap_akilo47_fire_plr_04.ogg", "viper/weapons/akilo47/weap_akilo47_fire_plr_05.ogg", "viper/weapons/akilo47/weap_akilo47_fire_plr_06.ogg"}
|
||||
SWEP.PrimaryEffects_MuzzleAttachment = 1
|
||||
SWEP.PrimaryEffects_ShellAttachment = "ejectbrass"
|
||||
SWEP.PrimaryEffects_ShellType = "VJ_Weapon_PistolShell1"
|
||||
SWEP.MadeForNPCsOnly = true -- Is this weapon meant to be for NPCs only?
|
||||
-- Deployment Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.DelayOnDeploy = 0.4 -- Time until it can shoot again after deploying the weapon
|
||||
SWEP.AnimTbl_Deploy = {ACT_VM_IDLE_TO_LOWERED}
|
||||
-- Reload Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.HasReloadSound = true -- Does it have a reload sound? Remember even if this is set to false, the animation sound will still play!
|
||||
SWEP.ReloadSound = "vj_weapons/glock_17/reload.wav"
|
||||
SWEP.Reload_TimeUntilAmmoIsSet = 1.5 -- Time until ammo is set to the weapon
|
||||
SWEP.Reload_TimeUntilFinished = 2 -- How much time until the player can play idle animation, shoot, etc.
|
||||
|
||||
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(-8, -5, 180)
|
||||
SWEP.WorldModel_CustomPositionOrigin = Vector(0, 4, 1)
|
||||
|
||||
SWEP.WorldModel = "models/tdmg/invasion/w_akm.mdl"
|
||||
@@ -0,0 +1,54 @@
|
||||
if (!file.Exists("autorun/vj_base_autorun.lua","LUA")) then return end
|
||||
---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.Base = "weapon_vj_base"
|
||||
SWEP.PrintName = "M14"
|
||||
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"
|
||||
-- Client Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
if CLIENT then
|
||||
SWEP.Slot = 1 -- Which weapon slot you want your SWEP to be in? (1 2 3 4 5 6)
|
||||
SWEP.SlotPos = 1 -- Which part of that slot do you want the SWEP to be in? (1 2 3 4 5 6)
|
||||
SWEP.SwayScale = 2 -- Default is 1, The scale of the viewmodel sway
|
||||
end
|
||||
-- NPC Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.NPC_NextPrimaryFire = 0.3 -- Next time it can use primary fire
|
||||
SWEP.NPC_CustomSpread = 0.3 -- This is added on top of the custom spread that's set inside the SNPC! | Starting from 1: Closer to 0 = better accuracy, Farther than 1 = worse accuracy
|
||||
-- Main Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.HoldType = "ar2"
|
||||
SWEP.ViewModelFOV = 70 -- Player FOV for the view model
|
||||
SWEP.Spawnable = true
|
||||
SWEP.AdminSpawnable = false
|
||||
-- Primary Fire ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.Primary.AllowFireInWater = true -- If true, you will be able to use primary fire in water
|
||||
SWEP.Primary.Damage = 25 -- Damage
|
||||
SWEP.Primary.PlayerDamage = 25 -- Only applies for players | "Same" = Same as self.Primary.Damage, "Double" = Double the self.Primary.Damage OR put a number to be different from self.Primary.Damage
|
||||
SWEP.Primary.Force = 5 -- Force applied on the object the bullet hits
|
||||
SWEP.Primary.ClipSize = 30 -- Max amount of bullets per clip
|
||||
SWEP.Primary.Recoil = 0.3 -- How much recoil does the player get?
|
||||
SWEP.Primary.Cone = 5 -- How accurate is the bullet? (Players)
|
||||
SWEP.Primary.Delay = 0.01 -- Time until it can shoot again
|
||||
SWEP.Primary.Automatic = true -- Is it automatic?
|
||||
SWEP.Primary.Ammo = "AR2" -- Ammo type
|
||||
SWEP.Primary.Sound = {"viper/weapons/mike14/weap_mike14_fire_plr_01.ogg"}
|
||||
SWEP.Primary.DistantSound = {"viper/weapons/mike14/weap_mike14_fire_plr_01.ogg"}
|
||||
SWEP.PrimaryEffects_MuzzleAttachment = 1
|
||||
SWEP.PrimaryEffects_ShellAttachment = "ejectbrass"
|
||||
SWEP.PrimaryEffects_ShellType = "VJ_Weapon_PistolShell1"
|
||||
SWEP.MadeForNPCsOnly = true -- Is this weapon meant to be for NPCs only?
|
||||
-- Deployment Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.DelayOnDeploy = 0.4 -- Time until it can shoot again after deploying the weapon
|
||||
SWEP.AnimTbl_Deploy = {ACT_VM_IDLE_TO_LOWERED}
|
||||
-- Reload Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.HasReloadSound = true -- Does it have a reload sound? Remember even if this is set to false, the animation sound will still play!
|
||||
SWEP.ReloadSound = "vj_weapons/glock_17/reload.wav"
|
||||
SWEP.Reload_TimeUntilAmmoIsSet = 1.5 -- Time until ammo is set to the weapon
|
||||
SWEP.Reload_TimeUntilFinished = 2 -- How much time until the player can play idle animation, shoot, etc.
|
||||
|
||||
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(-8, -5, 180)
|
||||
SWEP.WorldModel_CustomPositionOrigin = Vector(0, 2, 0)
|
||||
|
||||
SWEP.WorldModel = "models/tdmg/invasion/w_mini14.mdl"
|
||||
@@ -0,0 +1,57 @@
|
||||
if (!file.Exists("autorun/vj_base_autorun.lua","LUA")) then return end
|
||||
---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.Base = "weapon_vj_base"
|
||||
SWEP.PrintName = "M24"
|
||||
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"
|
||||
-- Client Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
if CLIENT then
|
||||
SWEP.Slot = 1 -- Which weapon slot you want your SWEP to be in? (1 2 3 4 5 6)
|
||||
SWEP.SlotPos = 1 -- Which part of that slot do you want the SWEP to be in? (1 2 3 4 5 6)
|
||||
SWEP.SwayScale = 2 -- Default is 1, The scale of the viewmodel sway
|
||||
end
|
||||
-- NPC Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.NPC_NextPrimaryFire = 1.5 -- Next time it can use primary fire
|
||||
SWEP.NPC_CustomSpread = 0.1 -- This is added on top of the custom spread that's set inside the SNPC! | Starting from 1: Closer to 0 = better accuracy, Farther than 1 = worse accuracy
|
||||
-- Main Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.HoldType = "rpg"
|
||||
SWEP.ViewModelFOV = 70 -- Player FOV for the view model
|
||||
SWEP.Spawnable = true
|
||||
SWEP.AdminSpawnable = false
|
||||
-- Primary Fire ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.Primary.AllowFireInWater = true -- If true, you will be able to use primary fire in water
|
||||
SWEP.Primary.Damage = 50 -- Damage
|
||||
SWEP.Primary.PlayerDamage = 50 -- Only applies for players | "Same" = Same as self.Primary.Damage, "Double" = Double the self.Primary.Damage OR put a number to be different from self.Primary.Damage
|
||||
SWEP.Primary.Force = 5 -- Force applied on the object the bullet hits
|
||||
SWEP.Primary.ClipSize = 5 -- Max amount of bullets per clip
|
||||
SWEP.Primary.Recoil = 0.3 -- How much recoil does the player get?
|
||||
SWEP.Primary.Cone = 5 -- How accurate is the bullet? (Players)
|
||||
SWEP.Primary.Delay = 0.01 -- Time until it can shoot again
|
||||
SWEP.Primary.Automatic = true -- Is it automatic?
|
||||
SWEP.Primary.Ammo = "AR2" -- Ammo type
|
||||
SWEP.Primary.Sound = {"weapons/romeo700/weap_romeo700_fire_bang_plr_01.ogg"}
|
||||
SWEP.Primary.DistantSound = {"weapons/romeo700/weap_romeo700_fire_bang_plr_01.ogg"}
|
||||
SWEP.PrimaryEffects_MuzzleAttachment = 1
|
||||
SWEP.PrimaryEffects_ShellAttachment = "ejectbrass"
|
||||
SWEP.PrimaryEffects_ShellType = "VJ_Weapon_PistolShell1"
|
||||
SWEP.MadeForNPCsOnly = true -- Is this weapon meant to be for NPCs only?
|
||||
-- Deployment Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.DelayOnDeploy = 0.4 -- Time until it can shoot again after deploying the weapon
|
||||
SWEP.AnimTbl_Deploy = {ACT_VM_IDLE_TO_LOWERED}
|
||||
-- Reload Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.HasReloadSound = true -- Does it have a reload sound? Remember even if this is set to false, the animation sound will still play!
|
||||
SWEP.ReloadSound = "vj_weapons/reload_boltaction.wav"
|
||||
SWEP.Reload_TimeUntilAmmoIsSet = 1.5 -- Time until ammo is set to the weapon
|
||||
SWEP.Reload_TimeUntilFinished = 2 -- How much time until the player can play idle animation, shoot, etc.
|
||||
|
||||
SWEP.NPC_ExtraFireSound = {"vj_weapons/perform_boltaction.wav"} -- Plays an extra sound after it fires (Example: Bolt action sound)
|
||||
SWEP.NPC_ExtraFireSoundTime = 0.4 -- How much time until it plays the sound (After Firing)?
|
||||
|
||||
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(-8, -5, 180)
|
||||
SWEP.WorldModel_CustomPositionOrigin = Vector(0, 4, 1)
|
||||
|
||||
SWEP.WorldModel = "models/tdmg/invasion/w_m40.mdl"
|
||||
@@ -0,0 +1,54 @@
|
||||
if (!file.Exists("autorun/vj_base_autorun.lua","LUA")) then return end
|
||||
---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.Base = "weapon_vj_base"
|
||||
SWEP.PrintName = "M249"
|
||||
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"
|
||||
-- Client Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
if CLIENT then
|
||||
SWEP.Slot = 1 -- Which weapon slot you want your SWEP to be in? (1 2 3 4 5 6)
|
||||
SWEP.SlotPos = 1 -- Which part of that slot do you want the SWEP to be in? (1 2 3 4 5 6)
|
||||
SWEP.SwayScale = 2 -- Default is 1, The scale of the viewmodel sway
|
||||
end
|
||||
-- NPC Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.NPC_NextPrimaryFire = 0.1 -- Next time it can use primary fire
|
||||
SWEP.NPC_CustomSpread = 1 -- This is added on top of the custom spread that's set inside the SNPC! | Starting from 1: Closer to 0 = better accuracy, Farther than 1 = worse accuracy
|
||||
-- Main Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.HoldType = "ar2"
|
||||
SWEP.ViewModelFOV = 70 -- Player FOV for the view model
|
||||
SWEP.Spawnable = true
|
||||
SWEP.AdminSpawnable = false
|
||||
-- Primary Fire ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.Primary.AllowFireInWater = true -- If true, you will be able to use primary fire in water
|
||||
SWEP.Primary.Damage = 10 -- Damage
|
||||
SWEP.Primary.PlayerDamage = 10 -- Only applies for players | "Same" = Same as self.Primary.Damage, "Double" = Double the self.Primary.Damage OR put a number to be different from self.Primary.Damage
|
||||
SWEP.Primary.Force = 5 -- Force applied on the object the bullet hits
|
||||
SWEP.Primary.ClipSize = 100 -- Max amount of bullets per clip
|
||||
SWEP.Primary.Recoil = 0.3 -- How much recoil does the player get?
|
||||
SWEP.Primary.Cone = 5 -- How accurate is the bullet? (Players)
|
||||
SWEP.Primary.Delay = 0.01 -- Time until it can shoot again
|
||||
SWEP.Primary.Automatic = true -- Is it automatic?
|
||||
SWEP.Primary.Ammo = "AR2" -- Ammo type
|
||||
SWEP.Primary.Sound = {"viper/weapons/scharlie/weap_scharlie_fire_plr_02.ogg"}
|
||||
SWEP.Primary.DistantSound = {"viper/weapons/scharlie/weap_scharlie_fire_plr_02.ogg"}
|
||||
SWEP.PrimaryEffects_MuzzleAttachment = 1
|
||||
SWEP.PrimaryEffects_ShellAttachment = "ejectbrass"
|
||||
SWEP.PrimaryEffects_ShellType = "VJ_Weapon_PistolShell1"
|
||||
SWEP.MadeForNPCsOnly = true -- Is this weapon meant to be for NPCs only?
|
||||
-- Deployment Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.DelayOnDeploy = 0.4 -- Time until it can shoot again after deploying the weapon
|
||||
SWEP.AnimTbl_Deploy = {ACT_VM_IDLE_TO_LOWERED}
|
||||
-- Reload Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.HasReloadSound = true -- Does it have a reload sound? Remember even if this is set to false, the animation sound will still play!
|
||||
SWEP.ReloadSound = "vj_weapons/glock_17/reload.wav"
|
||||
SWEP.Reload_TimeUntilAmmoIsSet = 1.5 -- Time until ammo is set to the weapon
|
||||
SWEP.Reload_TimeUntilFinished = 2 -- How much time until the player can play idle animation, shoot, etc.
|
||||
|
||||
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(-8, -5, 180)
|
||||
SWEP.WorldModel_CustomPositionOrigin = Vector(0, 4, 1)
|
||||
|
||||
SWEP.WorldModel = "models/tdmg/invasion/w_m249.mdl"
|
||||
@@ -0,0 +1,54 @@
|
||||
if (!file.Exists("autorun/vj_base_autorun.lua","LUA")) then return end
|
||||
---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.Base = "weapon_vj_base"
|
||||
SWEP.PrintName = "M4A1"
|
||||
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"
|
||||
-- Client Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
if CLIENT then
|
||||
SWEP.Slot = 1 -- Which weapon slot you want your SWEP to be in? (1 2 3 4 5 6)
|
||||
SWEP.SlotPos = 1 -- Which part of that slot do you want the SWEP to be in? (1 2 3 4 5 6)
|
||||
SWEP.SwayScale = 2 -- Default is 1, The scale of the viewmodel sway
|
||||
end
|
||||
-- NPC Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.NPC_NextPrimaryFire = 0.12 -- Next time it can use primary fire
|
||||
SWEP.NPC_CustomSpread = 0.8 -- This is added on top of the custom spread that's set inside the SNPC! | Starting from 1: Closer to 0 = better accuracy, Farther than 1 = worse accuracy
|
||||
-- Main Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.HoldType = "ar2"
|
||||
SWEP.ViewModelFOV = 70 -- Player FOV for the view model
|
||||
SWEP.Spawnable = true
|
||||
SWEP.AdminSpawnable = false
|
||||
-- Primary Fire ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.Primary.AllowFireInWater = true -- If true, you will be able to use primary fire in water
|
||||
SWEP.Primary.Damage = 16 -- Damage
|
||||
SWEP.Primary.PlayerDamage = 16 -- Only applies for players | "Same" = Same as self.Primary.Damage, "Double" = Double the self.Primary.Damage OR put a number to be different from self.Primary.Damage
|
||||
SWEP.Primary.Force = 5 -- Force applied on the object the bullet hits
|
||||
SWEP.Primary.ClipSize = 30 -- Max amount of bullets per clip
|
||||
SWEP.Primary.Recoil = 0.3 -- How much recoil does the player get?
|
||||
SWEP.Primary.Cone = 5 -- How accurate is the bullet? (Players)
|
||||
SWEP.Primary.Delay = 0.01 -- Time until it can shoot again
|
||||
SWEP.Primary.Automatic = true -- Is it automatic?
|
||||
SWEP.Primary.Ammo = "AR2" -- Ammo type
|
||||
SWEP.Primary.Sound = {"viper/weapons/mike4/weap_mike4_fire_plr_01.ogg", "viper/weapons/mike4/weap_mike4_fire_plr_02.ogg", "viper/weapons/mike4/weap_mike4_fire_plr_03.ogg", "viper/weapons/mike4/weap_mike4_fire_plr_04.ogg", "viper/weapons/mike4/weap_mike4_fire_plr_05.ogg", "viper/weapons/mike4/weap_mike4_fire_plr_06.ogg"}
|
||||
SWEP.Primary.DistantSound = {"viper/weapons/mike4/weap_mike4_fire_plr_01.ogg", "viper/weapons/mike4/weap_mike4_fire_plr_02.ogg", "viper/weapons/mike4/weap_mike4_fire_plr_03.ogg", "viper/weapons/mike4/weap_mike4_fire_plr_04.ogg", "viper/weapons/mike4/weap_mike4_fire_plr_05.ogg", "viper/weapons/mike4/weap_mike4_fire_plr_06.ogg"}
|
||||
SWEP.PrimaryEffects_MuzzleAttachment = 1
|
||||
SWEP.PrimaryEffects_ShellAttachment = "ejectbrass"
|
||||
SWEP.PrimaryEffects_ShellType = "VJ_Weapon_PistolShell1"
|
||||
SWEP.MadeForNPCsOnly = true -- Is this weapon meant to be for NPCs only?
|
||||
-- Deployment Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.DelayOnDeploy = 0.4 -- Time until it can shoot again after deploying the weapon
|
||||
SWEP.AnimTbl_Deploy = {ACT_VM_IDLE_TO_LOWERED}
|
||||
-- Reload Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.HasReloadSound = true -- Does it have a reload sound? Remember even if this is set to false, the animation sound will still play!
|
||||
SWEP.ReloadSound = "vj_weapons/glock_17/reload.wav"
|
||||
SWEP.Reload_TimeUntilAmmoIsSet = 1.5 -- Time until ammo is set to the weapon
|
||||
SWEP.Reload_TimeUntilFinished = 2 -- How much time until the player can play idle animation, shoot, etc.
|
||||
|
||||
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(-8, -5, 180)
|
||||
SWEP.WorldModel_CustomPositionOrigin = Vector(0, 4, 1)
|
||||
|
||||
SWEP.WorldModel = "models/tdmg/invasion/w_m16.mdl"
|
||||
@@ -0,0 +1,54 @@
|
||||
if (!file.Exists("autorun/vj_base_autorun.lua","LUA")) then return end
|
||||
---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.Base = "weapon_vj_base"
|
||||
SWEP.PrintName = "M9"
|
||||
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"
|
||||
-- Client Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
if CLIENT then
|
||||
SWEP.Slot = 1 -- Which weapon slot you want your SWEP to be in? (1 2 3 4 5 6)
|
||||
SWEP.SlotPos = 1 -- Which part of that slot do you want the SWEP to be in? (1 2 3 4 5 6)
|
||||
SWEP.SwayScale = 2 -- Default is 1, The scale of the viewmodel sway
|
||||
end
|
||||
-- NPC Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.NPC_NextPrimaryFire = 0.18 -- Next time it can use primary fire
|
||||
SWEP.NPC_CustomSpread = 0.5 -- This is added on top of the custom spread that's set inside the SNPC! | Starting from 1: Closer to 0 = better accuracy, Farther than 1 = worse accuracy
|
||||
-- Main Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.HoldType = "revolver"
|
||||
SWEP.ViewModelFOV = 70 -- Player FOV for the view model
|
||||
SWEP.Spawnable = true
|
||||
SWEP.AdminSpawnable = false
|
||||
-- Primary Fire ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.Primary.AllowFireInWater = true -- If true, you will be able to use primary fire in water
|
||||
SWEP.Primary.Damage = 9 -- Damage
|
||||
SWEP.Primary.PlayerDamage = 9 -- Only applies for players | "Same" = Same as self.Primary.Damage, "Double" = Double the self.Primary.Damage OR put a number to be different from self.Primary.Damage
|
||||
SWEP.Primary.Force = 5 -- Force applied on the object the bullet hits
|
||||
SWEP.Primary.ClipSize = 15 -- Max amount of bullets per clip
|
||||
SWEP.Primary.Recoil = 0.3 -- How much recoil does the player get?
|
||||
SWEP.Primary.Cone = 5 -- How accurate is the bullet? (Players)
|
||||
SWEP.Primary.Delay = 0.01 -- Time until it can shoot again
|
||||
SWEP.Primary.Automatic = true -- Is it automatic?
|
||||
SWEP.Primary.Ammo = "AR2" -- Ammo type
|
||||
SWEP.Primary.Sound = {"weapons/mike9/weap_mike9a3_fire_plr_01.ogg"}
|
||||
SWEP.Primary.DistantSound = {"weapons/mike9/weap_mike9a3_fire_plr_01.ogg"}
|
||||
SWEP.PrimaryEffects_MuzzleAttachment = 1
|
||||
SWEP.PrimaryEffects_ShellAttachment = "ejectbrass"
|
||||
SWEP.PrimaryEffects_ShellType = "VJ_Weapon_PistolShell1"
|
||||
SWEP.MadeForNPCsOnly = true -- Is this weapon meant to be for NPCs only?
|
||||
-- Deployment Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.DelayOnDeploy = 0.4 -- Time until it can shoot again after deploying the weapon
|
||||
SWEP.AnimTbl_Deploy = {ACT_VM_IDLE_TO_LOWERED}
|
||||
-- Reload Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.HasReloadSound = true -- Does it have a reload sound? Remember even if this is set to false, the animation sound will still play!
|
||||
SWEP.ReloadSound = "vj_weapons/glock_17/reload.wav"
|
||||
SWEP.Reload_TimeUntilAmmoIsSet = 1.5 -- Time until ammo is set to the weapon
|
||||
SWEP.Reload_TimeUntilFinished = 2 -- How much time until the player can play idle animation, shoot, etc.
|
||||
|
||||
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(-8, -5, 180)
|
||||
SWEP.WorldModel_CustomPositionOrigin = Vector(0, 0, -1.5)
|
||||
|
||||
SWEP.WorldModel = "models/tdmg/wep/m18.mdl"
|
||||
@@ -0,0 +1,54 @@
|
||||
if (!file.Exists("autorun/vj_base_autorun.lua","LUA")) then return end
|
||||
---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.Base = "weapon_vj_base"
|
||||
SWEP.PrintName = "Makarov"
|
||||
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"
|
||||
-- Client Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
if CLIENT then
|
||||
SWEP.Slot = 1 -- Which weapon slot you want your SWEP to be in? (1 2 3 4 5 6)
|
||||
SWEP.SlotPos = 1 -- Which part of that slot do you want the SWEP to be in? (1 2 3 4 5 6)
|
||||
SWEP.SwayScale = 2 -- Default is 1, The scale of the viewmodel sway
|
||||
end
|
||||
-- NPC Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.NPC_NextPrimaryFire = 0.2 -- Next time it can use primary fire
|
||||
SWEP.NPC_CustomSpread = 0.5 -- This is added on top of the custom spread that's set inside the SNPC! | Starting from 1: Closer to 0 = better accuracy, Farther than 1 = worse accuracy
|
||||
-- Main Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.HoldType = "revolver"
|
||||
SWEP.ViewModelFOV = 70 -- Player FOV for the view model
|
||||
SWEP.Spawnable = true
|
||||
SWEP.AdminSpawnable = false
|
||||
-- Primary Fire ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.Primary.AllowFireInWater = true -- If true, you will be able to use primary fire in water
|
||||
SWEP.Primary.Damage = 14 -- Damage
|
||||
SWEP.Primary.PlayerDamage = 14 -- Only applies for players | "Same" = Same as self.Primary.Damage, "Double" = Double the self.Primary.Damage OR put a number to be different from self.Primary.Damage
|
||||
SWEP.Primary.Force = 5 -- Force applied on the object the bullet hits
|
||||
SWEP.Primary.ClipSize = 8 -- Max amount of bullets per clip
|
||||
SWEP.Primary.Recoil = 0.3 -- How much recoil does the player get?
|
||||
SWEP.Primary.Cone = 5 -- How accurate is the bullet? (Players)
|
||||
SWEP.Primary.Delay = 0.01 -- Time until it can shoot again
|
||||
SWEP.Primary.Automatic = true -- Is it automatic?
|
||||
SWEP.Primary.Ammo = "AR2" -- Ammo type
|
||||
SWEP.Primary.Sound = {"weapons/mike/weap_mike_fire_plr.ogg"}
|
||||
SWEP.Primary.DistantSound = {"weapons/mike/weap_mike_fire_plr.ogg"}
|
||||
SWEP.PrimaryEffects_MuzzleAttachment = 1
|
||||
SWEP.PrimaryEffects_ShellAttachment = "ejectbrass"
|
||||
SWEP.PrimaryEffects_ShellType = "VJ_Weapon_PistolShell1"
|
||||
SWEP.MadeForNPCsOnly = true -- Is this weapon meant to be for NPCs only?
|
||||
-- Deployment Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.DelayOnDeploy = 0.4 -- Time until it can shoot again after deploying the weapon
|
||||
SWEP.AnimTbl_Deploy = {ACT_VM_IDLE_TO_LOWERED}
|
||||
-- Reload Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.HasReloadSound = true -- Does it have a reload sound? Remember even if this is set to false, the animation sound will still play!
|
||||
SWEP.ReloadSound = "vj_weapons/glock_17/reload.wav"
|
||||
SWEP.Reload_TimeUntilAmmoIsSet = 1.5 -- Time until ammo is set to the weapon
|
||||
SWEP.Reload_TimeUntilFinished = 2 -- How much time until the player can play idle animation, shoot, etc.
|
||||
|
||||
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(-8, -5, 180)
|
||||
SWEP.WorldModel_CustomPositionOrigin = Vector(0, 4, 1)
|
||||
|
||||
SWEP.WorldModel = "models/tdmg/invasion/w_makarov.mdl"
|
||||
@@ -0,0 +1,58 @@
|
||||
if (!file.Exists("autorun/vj_base_autorun.lua","LUA")) then return end
|
||||
---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.Base = "weapon_vj_base"
|
||||
SWEP.PrintName = "R870"
|
||||
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"
|
||||
-- Client Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
if CLIENT then
|
||||
SWEP.Slot = 1 -- Which weapon slot you want your SWEP to be in? (1 2 3 4 5 6)
|
||||
SWEP.SlotPos = 1 -- Which part of that slot do you want the SWEP to be in? (1 2 3 4 5 6)
|
||||
SWEP.SwayScale = 2 -- Default is 1, The scale of the viewmodel sway
|
||||
end
|
||||
-- NPC Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.NPC_NextPrimaryFire = 1 -- Next time it can use primary fire
|
||||
SWEP.NPC_CustomSpread = 2 -- This is added on top of the custom spread that's set inside the SNPC! | Starting from 1: Closer to 0 = better accuracy, Farther than 1 = worse accuracy
|
||||
-- Main Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.HoldType = "ar2"
|
||||
SWEP.ViewModelFOV = 70 -- Player FOV for the view model
|
||||
SWEP.Spawnable = true
|
||||
SWEP.AdminSpawnable = false
|
||||
-- Primary Fire ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.Primary.AllowFireInWater = true -- If true, you will be able to use primary fire in water
|
||||
SWEP.Primary.Damage = 18 -- Damage
|
||||
SWEP.Primary.PlayerDamage = 18 -- Only applies for players | "Same" = Same as self.Primary.Damage, "Double" = Double the self.Primary.Damage OR put a number to be different from self.Primary.Damage
|
||||
SWEP.Primary.Force = 5 -- Force applied on the object the bullet hits
|
||||
SWEP.Primary.ClipSize = 6 -- Max amount of bullets per clip
|
||||
SWEP.Primary.Recoil = 0.3 -- How much recoil does the player get?
|
||||
SWEP.Primary.Cone = 5 -- How accurate is the bullet? (Players)
|
||||
SWEP.Primary.Delay = 0.01 -- Time until it can shoot again
|
||||
SWEP.Primary.Automatic = true -- Is it automatic?
|
||||
SWEP.Primary.NumberOfShots = 6
|
||||
SWEP.Primary.Ammo = "AR2" -- Ammo type
|
||||
SWEP.Primary.Sound = {"weapons/romeo870/weap_romeo870_fire_plr_01.ogg"}
|
||||
SWEP.Primary.DistantSound = {"weapons/romeo870/weap_romeo870_fire_plr_01.ogg"}
|
||||
SWEP.PrimaryEffects_MuzzleAttachment = 1
|
||||
SWEP.PrimaryEffects_ShellAttachment = "ejectbrass"
|
||||
SWEP.PrimaryEffects_ShellType = "VJ_Weapon_PistolShell1"
|
||||
SWEP.MadeForNPCsOnly = true -- Is this weapon meant to be for NPCs only?
|
||||
-- Deployment Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.DelayOnDeploy = 0.4 -- Time until it can shoot again after deploying the weapon
|
||||
SWEP.AnimTbl_Deploy = {ACT_VM_IDLE_TO_LOWERED}
|
||||
-- Reload Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.HasReloadSound = true -- Does it have a reload sound? Remember even if this is set to false, the animation sound will still play!
|
||||
SWEP.ReloadSound = "vj_weapons/glock_17/reload.wav"
|
||||
SWEP.Reload_TimeUntilAmmoIsSet = 1.5 -- Time until ammo is set to the weapon
|
||||
SWEP.Reload_TimeUntilFinished = 2 -- How much time until the player can play idle animation, shoot, etc.
|
||||
|
||||
SWEP.NPC_ExtraFireSound = {"vj_weapons/perform_shotgunpump.wav"} -- Plays an extra sound after it fires (Example: Bolt action sound)
|
||||
SWEP.NPC_FiringDistanceScale = 0.5 -- Changes how far the NPC can fire | 1 = No change, x < 1 = closer, x > 1 = farther
|
||||
|
||||
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(-8, -5, 180)
|
||||
SWEP.WorldModel_CustomPositionOrigin = Vector(0, 4, 1)
|
||||
|
||||
SWEP.WorldModel = "models/tdmg/invasion/w_m590.mdl"
|
||||
@@ -0,0 +1,54 @@
|
||||
if (!file.Exists("autorun/vj_base_autorun.lua","LUA")) then return end
|
||||
---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.Base = "weapon_vj_base"
|
||||
SWEP.PrintName = "UMP-45"
|
||||
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"
|
||||
-- Client Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
if CLIENT then
|
||||
SWEP.Slot = 1 -- Which weapon slot you want your SWEP to be in? (1 2 3 4 5 6)
|
||||
SWEP.SlotPos = 1 -- Which part of that slot do you want the SWEP to be in? (1 2 3 4 5 6)
|
||||
SWEP.SwayScale = 2 -- Default is 1, The scale of the viewmodel sway
|
||||
end
|
||||
-- NPC Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.NPC_NextPrimaryFire = 0.12 -- Next time it can use primary fire
|
||||
SWEP.NPC_CustomSpread = 0.8 -- This is added on top of the custom spread that's set inside the SNPC! | Starting from 1: Closer to 0 = better accuracy, Farther than 1 = worse accuracy
|
||||
-- Main Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.HoldType = "smg"
|
||||
SWEP.ViewModelFOV = 70 -- Player FOV for the view model
|
||||
SWEP.Spawnable = true
|
||||
SWEP.AdminSpawnable = false
|
||||
-- Primary Fire ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.Primary.AllowFireInWater = true -- If true, you will be able to use primary fire in water
|
||||
SWEP.Primary.Damage = 12 -- Damage
|
||||
SWEP.Primary.PlayerDamage = 12 -- Only applies for players | "Same" = Same as self.Primary.Damage, "Double" = Double the self.Primary.Damage OR put a number to be different from self.Primary.Damage
|
||||
SWEP.Primary.Force = 5 -- Force applied on the object the bullet hits
|
||||
SWEP.Primary.ClipSize = 30 -- Max amount of bullets per clip
|
||||
SWEP.Primary.Recoil = 0.3 -- How much recoil does the player get?
|
||||
SWEP.Primary.Cone = 5 -- How accurate is the bullet? (Players)
|
||||
SWEP.Primary.Delay = 0.01 -- Time until it can shoot again
|
||||
SWEP.Primary.Automatic = true -- Is it automatic?
|
||||
SWEP.Primary.Ammo = "AR2" -- Ammo type
|
||||
SWEP.Primary.Sound = {"weapons/smgolf45/weap_smgolf45_fire_plr_01.ogg"}
|
||||
SWEP.Primary.DistantSound = {"weapons/smgolf45/weap_smgolf45_fire_plr_01.ogg"}
|
||||
SWEP.PrimaryEffects_MuzzleAttachment = 1
|
||||
SWEP.PrimaryEffects_ShellAttachment = "ejectbrass"
|
||||
SWEP.PrimaryEffects_ShellType = "VJ_Weapon_PistolShell1"
|
||||
SWEP.MadeForNPCsOnly = true -- Is this weapon meant to be for NPCs only?
|
||||
-- Deployment Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.DelayOnDeploy = 0.4 -- Time until it can shoot again after deploying the weapon
|
||||
SWEP.AnimTbl_Deploy = {ACT_VM_IDLE_TO_LOWERED}
|
||||
-- Reload Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.HasReloadSound = true -- Does it have a reload sound? Remember even if this is set to false, the animation sound will still play!
|
||||
SWEP.ReloadSound = "vj_weapons/glock_17/reload.wav"
|
||||
SWEP.Reload_TimeUntilAmmoIsSet = 1.5 -- Time until ammo is set to the weapon
|
||||
SWEP.Reload_TimeUntilFinished = 2 -- How much time until the player can play idle animation, shoot, etc.
|
||||
|
||||
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(-8, -5, 180)
|
||||
SWEP.WorldModel_CustomPositionOrigin = Vector(0, 4, 1)
|
||||
|
||||
SWEP.WorldModel = "models/tdmg/invasion/w_ump45.mdl"
|
||||
Reference in New Issue
Block a user