Added support for hammer made weapons in ZE
- Restricted each player to using only one of these special weapons per round.
This commit is contained in:
parent
1d538e1c90
commit
b83b5c56d5
2 changed files with 23 additions and 3 deletions
|
@ -92,6 +92,12 @@ ZE_KNOCKBACKSCALE = 0.1
|
||||||
|
|
||||||
MASK_HOVER = bit.bor(CONTENTS_OPAQUE, CONTENTS_GRATE, CONTENTS_HITBOX, CONTENTS_DEBRIS, CONTENTS_SOLID, CONTENTS_WATER, CONTENTS_SLIME, CONTENTS_WINDOW, CONTENTS_LADDER, CONTENTS_PLAYERCLIP, CONTENTS_MOVEABLE, CONTENTS_DETAIL, CONTENTS_TRANSLUCENT)
|
MASK_HOVER = bit.bor(CONTENTS_OPAQUE, CONTENTS_GRATE, CONTENTS_HITBOX, CONTENTS_DEBRIS, CONTENTS_SOLID, CONTENTS_WATER, CONTENTS_SLIME, CONTENTS_WINDOW, CONTENTS_LADDER, CONTENTS_PLAYERCLIP, CONTENTS_MOVEABLE, CONTENTS_DETAIL, CONTENTS_TRANSLUCENT)
|
||||||
|
|
||||||
|
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"}
|
||||||
|
|
||||||
GM.BarricadeHealthMin = 50
|
GM.BarricadeHealthMin = 50
|
||||||
GM.BarricadeHealthMax = 1100
|
GM.BarricadeHealthMax = 1100
|
||||||
GM.BarricadeHealthMassFactor = 3
|
GM.BarricadeHealthMassFactor = 3
|
||||||
|
|
|
@ -76,10 +76,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)
|
||||||
|
|
Loading…
Reference in a new issue