From 0b1d97a5ae72fabc611adb922a247f43b514815e Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Sat, 19 Aug 2017 13:46:06 -0400 Subject: fixed a bug with serverchanger zones --- lua/autorun/sv_npc.lua | 3 ++- lua/autorun/town.lua | 5 ++++- lua/autorun/zone_serverchanger.lua | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lua/autorun/sv_npc.lua b/lua/autorun/sv_npc.lua index a622d7b..8f346bb 100644 --- a/lua/autorun/sv_npc.lua +++ b/lua/autorun/sv_npc.lua @@ -99,7 +99,8 @@ hook.Add("InitPostEntity", "artery_spawnmapnpcs", function() loadMap() end) -concommand.Add("artery_reloadmap", function() +concommand.Add("artery_reloadmap", function(ply,cmd,args) + if not ply:IsAdmin() then return end for k, v in pairs(removeents) do local eot = ents.FindByClass(v) diff --git a/lua/autorun/town.lua b/lua/autorun/town.lua index 2805f7c..40131df 100644 --- a/lua/autorun/town.lua +++ b/lua/autorun/town.lua @@ -137,5 +137,8 @@ function loadtownies() end) end -concommand.Add("artery_loadtownies",loadtownies) +concommand.Add("artery_loadtownies",function(ply,cmd,args) + if not ply:IsAdmin() then return end + loadtownies() +end) hook.Add("InitPostEntity","load_lua",loadtownies) diff --git a/lua/autorun/zone_serverchanger.lua b/lua/autorun/zone_serverchanger.lua index afb92a6..9599479 100644 --- a/lua/autorun/zone_serverchanger.lua +++ b/lua/autorun/zone_serverchanger.lua @@ -33,7 +33,7 @@ hook.Add("ShowZoneOptions","artery_serverchange",function(zone,class,DPanel,zone print("server's onvaluechanged has been called") net.Start("artery_serverchange") net.WriteFloat(zoneID) - net.WriteString(new) + net.WriteString(to:GetValue()) net.SendToServer() end -- cgit v1.2.3-70-g09d2