summaryrefslogtreecommitdiff
path: root/lua/autorun/zone_town.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/autorun/zone_town.lua')
-rw-r--r--lua/autorun/zone_town.lua13
1 files changed, 7 insertions, 6 deletions
diff --git a/lua/autorun/zone_town.lua b/lua/autorun/zone_town.lua
index abfc65b..c2cf653 100644
--- a/lua/autorun/zone_town.lua
+++ b/lua/autorun/zone_town.lua
@@ -6,7 +6,7 @@ zones.RegisterClass("artery_town",Color(0,255,0))
--Use this to set default properties. Only called on server.
hook.Add("OnZoneCreated","artery_town",function(zone,class,zoneID)
if class == "artery_town" then
- zone.npctbl = {}
+ zone.datatbl = {}
end
end)
@@ -23,12 +23,12 @@ hook.Add("ShowZoneOptions","artery_town",function(zone,class,DPanel,zoneID,DFram
function synctbl()
net.Start("artery_town_settbl")
net.WriteFloat(zoneID)
- net.WriteTable(zone.npctbl)
+ net.WriteTable(zone.datatbl)
net.SendToServer()
end
print("Displaying table, my table is")
- PrintTable(zone.npctbl)
+ PrintTable(zone.datatbl)
local monsterlb = vgui.Create("DLabel",DPanel)
monsterlb:Dock(TOP)
@@ -36,10 +36,10 @@ hook.Add("ShowZoneOptions","artery_town",function(zone,class,DPanel,zoneID,DFram
monsterlb:SetDark(true)
monsterlb:SizeToContents()
local groundsname = vgui.Create("DTextEntry",DPanel)
- groundsname:SetText(zone.npctbl.Name or "")
+ groundsname:SetText(zone.datatbl.Name or "")
groundsname:Dock(TOP)
groundsname.OnEnter = function()
- zone.npctbl.Name = groundsname:GetValue()
+ zone.datatbl.Name = groundsname:GetValue()
synctbl()
end
@@ -56,7 +56,8 @@ if SERVER then
print("New table is:")
PrintTable(new)
if not ply:IsAdmin() then return end
- zones.List[id].npctbl = new
+ local zone = zones.List[id]
+ zone.datatbl = new
if new.Name then
zone.Name = new.Name
end