Skip to content
This repository was archived by the owner on Jul 14, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions nzombies3/entities/entities/zed_spawns/shared.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ ENT.Instructions = ""
function ENT:SetupDataTables()

self:NetworkVar( "String", 0, "Link" )
self:NetworkVar( "String", 0, "MaxLink" )

end

Expand Down
2 changes: 1 addition & 1 deletion nzombies3/entities/weapons/nz_tool_zed_spawns.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if SERVER then

function SWEP:OnReload( trace )
if trace.Entity:GetClass() == "zed_spawns" then
nz.Interfaces.Functions.SendInterface(self.Owner, "ZombLink", {ent = trace.Entity, link = trace.Entity.link})
nz.Interfaces.Functions.SendInterface(self.Owner, "ZombLink", {ent = trace.Entity, link = trace.Entity.link, max_link = trace.Entity.max_link})
end
end
end
6 changes: 6 additions & 0 deletions nzombies3/gamemode/enemies/sv_spawner.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ function nz.Enemies.Functions.ValidSpawns()
spawns[k] = nil
end
end

if v.max_link != nil then
if nz.Doors.Data.OpenedLinks[tonumber(v.max_link)] != nil then //Zombie Links
spawns[k] = nil
end
end
end

//Get positions
Expand Down
18 changes: 18 additions & 0 deletions nzombies3/gamemode/interfaces/sh_int_zombielinks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@
if SERVER then
function nz.Interfaces.Functions.ZombLinkHandler( ply, data )
if ply:IsSuperAdmin() then
PrintTable(data)
data.ent.link = data.link
data.ent.max_link = data.max_link
data.ent.maxlink = data.max_link
//For the link displayer
data.ent:SetLink(data.link)
data.ent:SetMaxLink(data.max_link)
end
end
end
Expand All @@ -17,10 +21,12 @@ if CLIENT then
local valz = {}
valz["Row1"] = 0
valz["Row2"] = 1
valz["Row3"] = -1
//Check if the ent has flags already
if data.link != nil then
valz["Row1"] = 1
valz["Row2"] = data.link
valz["Row3"] = data.max_link
name = "Modifying Zombie Link"
end

Expand All @@ -47,6 +53,11 @@ if CLIENT then
Row2:SetValue( valz["Row2"] )
Row2.DataChanged = function( _, val ) valz["Row2"] = val end

local Row3 = DProperties:CreateRow( "Zombie Spawn", "Max Flag" )
Row3:Setup( "Integer" )
Row3:SetValue( valz["Row3"] )
Row3.DataChanged = function( _, val ) valz["Row3"] = val end

local DermaButton = vgui.Create( "DButton" )
DermaButton:SetParent( DermaPanel )
DermaButton:SetText( "Submit" )
Expand All @@ -60,6 +71,13 @@ if CLIENT then
str=valz["Row2"]
end
data.link = str

if valz["Row1"] == 0 then
str=nil
else
str=valz["Row3"]
end
data.max_link = str
nz.Interfaces.Functions.SendRequests( "ZombLink", data )

DermaPanel:Close()
Expand Down