aboutsummaryrefslogtreecommitdiff
path: root/gamemode/server/concommands.lua
diff options
context:
space:
mode:
authorApickx <Apickx@cogarr.org>2015-12-28 19:10:44 -0500
committerApickx <Apickx@cogarr.org>2015-12-28 19:10:44 -0500
commit5c4ebc932d8c02522802c842d43d863d89aca162 (patch)
tree6be7ad664bdf060127e6df6baa72beaf508aa149 /gamemode/server/concommands.lua
downloadwintersurvival2-5c4ebc932d8c02522802c842d43d863d89aca162.tar.gz
wintersurvival2-5c4ebc932d8c02522802c842d43d863d89aca162.tar.bz2
wintersurvival2-5c4ebc932d8c02522802c842d43d863d89aca162.zip
Initial commit
Diffstat (limited to 'gamemode/server/concommands.lua')
-rw-r--r--gamemode/server/concommands.lua66
1 files changed, 66 insertions, 0 deletions
diff --git a/gamemode/server/concommands.lua b/gamemode/server/concommands.lua
new file mode 100644
index 0000000..a6c891c
--- /dev/null
+++ b/gamemode/server/concommands.lua
@@ -0,0 +1,66 @@
+concommand.Add("ws_giveitem",function(pl,com,args)
+ if (!IsValid(pl)) then return end
+ if (!pl:IsAdmin()) then return end
+ if (!args[1]) then return end
+
+ pl:AddItem(args[1],tonumber(args[2] or 1))
+end)
+
+concommand.Add("ws_revive",function(pl,com,args)
+ if (IsValid(pl) and !pl:IsAdmin()) then return end
+ if (!args[1]) then return end
+
+ for k,v in pairs(player.GetAll()) do
+ if (v:Nick():lower():find(args[1]) and v:IsPigeon()) then
+ v:ChatPrint("You have been resurrected from the dead by an admin!")
+ v:SetHuman(true)
+ v:KillSilent()
+ v:EmitSound("wintersurvival2/ritual/wololo.mp3")
+ end
+ end
+end)
+
+--Manual generate a proprain, for debugging
+concommand.Add("ws_proprain",function(ply,cmd,args)
+ if (IsValid(pl) and !pl:IsAdmin()) then return end
+ GAMEMODE:GeneratePropRain()
+end)
+
+--Manual reload of items + recepies, usefull for testing
+concommand.Add("ws_reloaditems",function(ply,cmd,args)
+ if (IsValid(pl) and !pl:IsAdmin()) then return end
+ GAMEMODE:LoadItems()
+end)
+
+--Manual reload of npc's, usefull for testing
+concommand.Add("ws_reloadnpcs",function(ply,cmd,args)
+ if (IsValid(pl) and !pl:IsAdmin()) then return end
+ GAMEMODE:LoadNPCS()
+end)
+
+--Generate a nice HTML representation of all the recepies.
+concommand.Add("ws_generaterecipes",function(pl,com,args)
+ if (IsValid(pl) and !pl:IsAdmin()) then return end
+ local filename = "ws_recipedata.txt"
+ for k,v in pairs(GAMEMODE.Recipes) do
+ if not v.Recipe then continue end
+ if not v.Name then continue end
+ file.Append(filename,"<li>\n\t<label>\n\t\t<input type='checkbox'>\n\t\t" .. v.Name)
+ for i,j in pairs(v.Recipe) do
+ if(i == "Resources") then
+ file.Append(filename,"\n\t<ul type='circle'>")
+ for p,q in pairs(j) do
+ file.Append(filename,"\n\t\t<li>" .. p .. " x " .. q .. "</li>")
+ end
+ file.Append(filename,"\n\t</ul>")
+ elseif(i == "Tools") then
+ file.Append(filename,"\n\t<ul type='square'>")
+ for p,q in pairs(j) do
+ file.Append(filename,"\n\t\t<li>" .. p .. " x " .. q .. "</li>")
+ end
+ file.Append(filename,"\n\t</ul>")
+ end
+ end
+ file.Append(filename,"\n\t</label>\n</li>\n")
+ end
+end)