From 406a4148506be540bcdac0f10f2256320c5c2771 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Mon, 4 Jan 2016 13:12:45 -0500 Subject: Item props are now removed on new rounds --- gamemode/shared/game_rounds.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'gamemode') diff --git a/gamemode/shared/game_rounds.lua b/gamemode/shared/game_rounds.lua index 9ca4adf..0333679 100644 --- a/gamemode/shared/game_rounds.lua +++ b/gamemode/shared/game_rounds.lua @@ -12,6 +12,7 @@ if (SERVER) then "ws_arrow", "ws_campfire", "ws_grave", + "ws_item", "ws_rune", } for k,v in pairs(cleanup) do -- cgit v1.2.3-70-g09d2 From 7180aa15356188d11996f2f91f53c7cba4ad1470 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Sun, 10 Jan 2016 19:55:02 -0500 Subject: Added console command hints to ws_spawnnpc command --- gamemode/npcsystem/aidirector.lua | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) (limited to 'gamemode') diff --git a/gamemode/npcsystem/aidirector.lua b/gamemode/npcsystem/aidirector.lua index 04e645d..fb85b2d 100644 --- a/gamemode/npcsystem/aidirector.lua +++ b/gamemode/npcsystem/aidirector.lua @@ -15,8 +15,28 @@ concommand.Add("ws_spawnnpc",function(ply,cmd,args) local npc = GetNpcByName(args[1]) if(npc == nil) then print("Not a valid name!") return end + print("attempting to spawn npc...") SpawnNpcByName(args[1],ply:GetPos()) -end) + print("NPC spawned!") +end, function(cmd,stringargs) + print(cmd, stringargs) + local tbl = {} + stringargs = string.sub(stringargs,2) + if(stringargs == " ") then + for k,v in pairs(GAMEMODE.Npcs) do + table.insert(tbl,cmd .. " \"" .. v.Name .. "\"") + end + return tbl + end + for k,v in pairs(GAMEMODE.Npcs) do + if(string.find(string.lower(v.Name),stringargs)) then + table.insert(tbl,cmd .. " \"" .. v.Name .. "\"") + else + print("Could not find " .. stringargs .. " in " .. string.lower(v.Name)) + end + end + return tbl +end, "Spawns an NPC from winter survival, useage: ws_spawnnpc ") function SpawnNpcByName(name, position) if(CLIENT) then return end @@ -25,9 +45,21 @@ function SpawnNpcByName(name, position) print("Could not find npc data for name " .. name) return end + if not position then + print("Invalid position:") + print(position) + return + end ent = ents.Create("ws_npc_ambient") + if(not ent) then + print("Could not spawn npc ws_npc_ambient") + return + end ent:SetPos(position) - + print("From server!") + if(entdata.Name) then + ent.Name = entdata.Name + end if(entdata.Model) then ent.Model = entdata.Model end @@ -61,7 +93,9 @@ function SpawnNpcByName(name, position) if(entdata.OnSpawn) then ent.OnSpawn = entdata.OnSpawn end + print("NPC created") ent:Spawn() + print("NPC spawned") end local random = math.random -- cgit v1.2.3-70-g09d2