if engine.ActiveGamemode() ~= "sandbox" then return end --[[ This entity gives townies things to do ]] AddCSLuaFile( "cl_init.lua" ) AddCSLuaFile( "shared.lua" ) include("shared.lua") function ENT:Initialize() self:SetModel("models/props_junk/watermelon01.mdl") self:PhysicsInit( SOLID_VPHYSICS ) -- Make us work with physics, self:SetMoveType( MOVETYPE_VPHYSICS ) -- after all, gmod is a physics self:SetSolid( SOLID_VPHYSICS ) -- Toolbox --self:SetNoDraw(true) --self:SetPos(self.Position) end local function save_huntable_spawns() local all = ents.FindByClass("info_edit_huntablespawn") local buf = [[local h = nrequire("sv_huntingspawner.lua") ]] local codetemplate = "h.CreateSpawnNode({Position = Vector(%d,%d,%d)})" for k,v in pairs(all) do local p = v:GetPos() all[k] = string.format(codetemplate,p.x,p.y,p.z) end buf = buf .. table.concat(all,"\n") local filepath = string.format("artery/maps/%s/huntable_nodes.txt",game.GetMap()) print("Writeing file",filepath) file.Write(filepath,buf) end hook.Add("ShutDown","art_save_huntablespawns",function() save_huntable_spawns() end) concommand.Add("artery_save_huntable_spawns",function(ply,cmd,args) save_huntable_spawns() end)