Merge pull request #26 from BClark09/master
Added support for hammer made weapons and enabled them on ZE
This commit is contained in:
commit
07743641a6
5 changed files with 97 additions and 4 deletions
|
@ -0,0 +1,8 @@
|
||||||
|
include('shared.lua')
|
||||||
|
|
||||||
|
SWEP.Slot = -1
|
||||||
|
SWEP.SlotPos = -1
|
||||||
|
SWEP.DrawAmmo = false
|
||||||
|
SWEP.DrawCrosshair = true
|
||||||
|
SWEP.DrawWeaponInfoBox = false
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
AddCSLuaFile("cl_init.lua")
|
||||||
|
AddCSLuaFile("shared.lua")
|
||||||
|
|
||||||
|
include("shared.lua")
|
||||||
|
|
||||||
|
function SWEP:OnDrop()
|
||||||
|
if self:IsValid() then
|
||||||
|
self.Weapon:Remove()
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,55 @@
|
||||||
|
SWEP.Name = "Item"
|
||||||
|
|
||||||
|
SWEP.AnimPrefix = "none"
|
||||||
|
SWEP.HoldType = "normal"
|
||||||
|
|
||||||
|
SWEP.Spawnable = true
|
||||||
|
SWEP.AdminSpawnable = true
|
||||||
|
|
||||||
|
SWEP.Primary.ClipSize = -1
|
||||||
|
SWEP.Primary.DefaultClip = -1
|
||||||
|
SWEP.Primary.Automatic = false
|
||||||
|
SWEP.Primary.Ammo = "None"
|
||||||
|
|
||||||
|
SWEP.Secondary.ClipSize = -1
|
||||||
|
SWEP.Secondary.DefaultClip = -1
|
||||||
|
SWEP.Secondary.Automatic = false
|
||||||
|
SWEP.Secondary.Ammo = "None"
|
||||||
|
|
||||||
|
SWEP.DrawCrosshair = false
|
||||||
|
SWEP.Primary.Sound = Sound("")
|
||||||
|
|
||||||
|
SWEP.WorldModel = ""
|
||||||
|
|
||||||
|
SWEP.WalkSpeed = SPEED_NORMAL
|
||||||
|
|
||||||
|
function SWEP:Initialize()
|
||||||
|
end
|
||||||
|
|
||||||
|
function SWEP:SetWeaponHoldType()
|
||||||
|
end
|
||||||
|
|
||||||
|
function SWEP:PrimaryAttack()
|
||||||
|
end
|
||||||
|
|
||||||
|
function SWEP:SecondaryAttack()
|
||||||
|
end
|
||||||
|
|
||||||
|
function SWEP:Reload()
|
||||||
|
end
|
||||||
|
|
||||||
|
function SWEP:Deploy()
|
||||||
|
if SERVER then
|
||||||
|
self.Owner:SelectWeapon("weapon_zs_fists")
|
||||||
|
end
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
function SWEP:CanPrimaryAttack()
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
function SWEP:CanSecondaryAttack()
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
|
@ -8,6 +8,12 @@ GM.ZE_TimeLimit = 60 * 16
|
||||||
|
|
||||||
GM.DefaultZombieClass = GM.ZombieClasses["Super Zombie"].Index
|
GM.DefaultZombieClass = GM.ZombieClasses["Super Zombie"].Index
|
||||||
|
|
||||||
|
local CSSWEAPONS = {"weapon_knife","weapon_glock","weapon_usp","weapon_p228","weapon_deagle",
|
||||||
|
"weapon_elite","weapon_fiveseven","weapon_m3","weapon_xm1014","weapon_galil",
|
||||||
|
"weapon_ak47","weapon_scout","weapon_sg552","weapon_awp","weapon_g3sg1",
|
||||||
|
"weapon_famas","weapon_m4a1","weapon_aug","weapon_sg550","weapon_mac10",
|
||||||
|
"weapon_tmp","weapon_mp5navy","weapon_ump45","weapon_p90","weapon_m249"}
|
||||||
|
|
||||||
function GM:Move(pl, move)
|
function GM:Move(pl, move)
|
||||||
if pl:Team() == TEAM_HUMAN then
|
if pl:Team() == TEAM_HUMAN then
|
||||||
if pl:GetBarricadeGhosting() then
|
if pl:GetBarricadeGhosting() then
|
||||||
|
@ -76,10 +82,24 @@ end
|
||||||
end
|
end
|
||||||
|
|
||||||
hook.Add("Initialize", "RegisterDummyEntities", function()
|
hook.Add("Initialize", "RegisterDummyEntities", function()
|
||||||
scripted_ents.Register(ENT, "weapon_elite")
|
|
||||||
scripted_ents.Register(ENT, "weapon_knife")
|
|
||||||
scripted_ents.Register(ENT, "weapon_deagle")
|
|
||||||
scripted_ents.Register(ENT, "ammo_50ae")
|
scripted_ents.Register(ENT, "ammo_50ae")
|
||||||
scripted_ents.Register(ENT, "ammo_556mm_box")
|
scripted_ents.Register(ENT, "ammo_556mm_box")
|
||||||
scripted_ents.Register(ENT, "player_weaponstrip")
|
scripted_ents.Register(ENT, "player_weaponstrip")
|
||||||
|
|
||||||
|
--CSS Weapons for ZE map parenting
|
||||||
|
for i, weapon in pairs(CSSWEAPONS) do
|
||||||
|
weapons.Register({Base = "weapon_map_base"},weapon)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
hook.Add( "PlayerCanPickupWeapon", "RestrictMapWeapons", function( ply, wep )
|
||||||
|
|
||||||
|
local weps = ply:GetWeapons()
|
||||||
|
|
||||||
|
--Only allow one special weapon per player
|
||||||
|
for k, v in pairs(weps) do
|
||||||
|
if table.HasValue( CSSWEAPONS, v:GetClass() ) or v:GetClass()=="weapon_map_base" then return false end
|
||||||
|
end
|
||||||
|
|
||||||
|
return true
|
||||||
end)
|
end)
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
// Inputs
|
// Inputs
|
||||||
input enable(void) : "Enable the entity."
|
input enable(void) : "Enable the entity."
|
||||||
input disable(void) : "Disable the entity."
|
input disable(void) : "Disable the entity."
|
||||||
input toggle(void) : "Toggle the entity."
|
input seton(integer) : "Enable or Disable the entity."
|
||||||
]
|
]
|
||||||
|
|
||||||
@SolidClass base(Targetname) = trigger_zombieclass : "ZS: You can directly control the changing of classes with this."
|
@SolidClass base(Targetname) = trigger_zombieclass : "ZS: You can directly control the changing of classes with this."
|
||||||
|
|
Loading…
Reference in a new issue