aboutsummaryrefslogtreecommitdiff
path: root/gamemode/itemsystem/foodstuffs
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/itemsystem/foodstuffs')
-rw-r--r--gamemode/itemsystem/foodstuffs/ratmeat.lua94
-rw-r--r--gamemode/itemsystem/foodstuffs/watermelon.lua124
2 files changed, 109 insertions, 109 deletions
diff --git a/gamemode/itemsystem/foodstuffs/ratmeat.lua b/gamemode/itemsystem/foodstuffs/ratmeat.lua
index e8d9575..12fc890 100644
--- a/gamemode/itemsystem/foodstuffs/ratmeat.lua
+++ b/gamemode/itemsystem/foodstuffs/ratmeat.lua
@@ -1,47 +1,47 @@
---[[
- An example item
-]]
-do return end
-local item = {}
-
---Required, a name, all item names must be unique
-item.Name = "Rat Meat"
-
---Optional, a tooltip to display when hovered over
-item.Tooltip = "Disgusting, disease-ridden meat."
-
---Required Returns the data needed to rebuild this item, should only contain the minimum data nessessary since this gets sent over the network
-item.Serialize = function(self)
- print("Trying to serailize!")
- return ""
-end
-
---Required, Rebuilds the item from data created in Serialize, if the item is different from the "main" copy of the item, it should retun a tabl.Copy(self), with the appropriate fields set.
-item.DeSerialize = function(self,string)
- print("Trying to deserialize!")
- return self
-end
-
---Optional, when the player clicks this item, a menu will show up, if the menu item is clicked, the function is ran. This is all run client side, so if you want it to do something server side, you'll need to use the net library. Remember that items are in the shared domain, so you can define what it does in the same file!
-function item.GetOptions(self)
- local options = {}
- options["test"] = function() print("You pressed test!") end
- options["toste"] = function() print("You pressed toste!") end
- return options
-end
-
---Optional. Something run once when this item is drawn in a backpack
-function item.DoOnPanel(dimagebutton)
- --dimagebutton:SetImage( "weapons/rustyaxe/rustyaxe.png")
-end
-
---Required, the shape of this item in a backpack.
-item.Shape = {
- {true}
-}
-
-item.onDropped = function(self, ent)
- ART.ApplyPAC(ent,"ratmeat")
-end
---Don't forget to register the item!
-nrequire("item.lua").RegisterItem(item)
+-- --[[
+-- An example item
+-- ]]
+-- do return end
+-- local item = {}
+--
+-- --Required, a name, all item names must be unique
+-- item.Name = "Rat Meat"
+--
+-- --Optional, a tooltip to display when hovered over
+-- item.Tooltip = "Disgusting, disease-ridden meat."
+--
+-- --Required Returns the data needed to rebuild this item, should only contain the minimum data nessessary since this gets sent over the network
+-- item.Serialize = function(self)
+-- print("Trying to serailize!")
+-- return ""
+-- end
+--
+-- --Required, Rebuilds the item from data created in Serialize, if the item is different from the "main" copy of the item, it should retun a tabl.Copy(self), with the appropriate fields set.
+-- item.DeSerialize = function(self,string)
+-- print("Trying to deserialize!")
+-- return self
+-- end
+--
+-- --Optional, when the player clicks this item, a menu will show up, if the menu item is clicked, the function is ran. This is all run client side, so if you want it to do something server side, you'll need to use the net library. Remember that items are in the shared domain, so you can define what it does in the same file!
+-- function item.GetOptions(self)
+-- local options = {}
+-- options["test"] = function() print("You pressed test!") end
+-- options["toste"] = function() print("You pressed toste!") end
+-- return options
+-- end
+--
+-- --Optional. Something run once when this item is drawn in a backpack
+-- function item.DoOnPanel(dimagebutton)
+-- --dimagebutton:SetImage( "weapons/rustyaxe/rustyaxe.png")
+-- end
+--
+-- --Required, the shape of this item in a backpack.
+-- item.Shape = {
+-- {true}
+-- }
+--
+-- item.onDropped = function(self, ent)
+-- ART.ApplyPAC(ent,"ratmeat")
+-- end
+-- --Don't forget to register the item!
+-- nrequire("item.lua").RegisterItem(item)
diff --git a/gamemode/itemsystem/foodstuffs/watermelon.lua b/gamemode/itemsystem/foodstuffs/watermelon.lua
index d3dfd56..00828dc 100644
--- a/gamemode/itemsystem/foodstuffs/watermelon.lua
+++ b/gamemode/itemsystem/foodstuffs/watermelon.lua
@@ -1,62 +1,62 @@
---[[
- An example item
-]]
-do return end
-local item = {}
-local pac
-if SERVER then
- pac = nrequire("core/pac/sv_pac.lua")
-end
-
---Required, a name, all item names must be unique
-item.Name = "Watermelon"
-
---Optional, a tooltip to display when hovered over
-item.Tooltip = "Where do they grow these in an apocolyptic wasteland???"
-
---Required Returns the data needed to rebuild this item, should only contain the minimum data nessessary since this gets sent over the network
-item.Serialize = function(self)
- print("Trying to serailize!")
- return ""
-end
-
---Required, Rebuilds the item from data created in Serialize, if the item is different from the "main" copy of the item, it should retun a tabl.Copy(self), with the appropriate fields set.
-item.DeSerialize = function(self,string)
- print("Trying to deserialize!")
- return self
-end
-if SERVER then
- util.AddNetworkString("eat_watermelon")
- net.Receive("eat_watermelon", function(len,ply)
- local row,col,bp = ply:HasItem("Watermelon")
- if row and col and bp then
- ply:RemoveItemAt(bp,row,col)
- end
- end)
-end
---Optional, when the player clicks this item, a menu will show up, if the menu item is clicked, the function is ran. This is all run client side, so if you want it to do something server side, you'll need to use the net library. Remember that items are in the shared domain, so you can define what it does in the same file!
-function item.GetOptions(self)
- local options = {}
- options["eat"] = function()
- net.Start("eat_watermelon")
- net.SendToServer()
- end
- return options
-end
-
---Required, the shape of this item in a backpack.
-item.Shape = {
- {true,true,true},
- {true,true,true},
- {true,true,true},
-}
-
-item.onDropped = function(self, ent)
- if SERVER then
- pac.ApplyPac(ent,"Watermelon")
- end
-end
-
-print("Hello from exampleitem.lua")
---Don't forget to register the item!
-nrequire("item.lua").RegisterItem(item)
+-- --[[
+-- An example item
+-- ]]
+-- do return end
+-- local item = {}
+-- local pac
+-- if SERVER then
+-- pac = nrequire("core/pac/sv_pac.lua")
+-- end
+--
+-- --Required, a name, all item names must be unique
+-- item.Name = "Watermelon"
+--
+-- --Optional, a tooltip to display when hovered over
+-- item.Tooltip = "Where do they grow these in an apocolyptic wasteland???"
+--
+-- --Required Returns the data needed to rebuild this item, should only contain the minimum data nessessary since this gets sent over the network
+-- item.Serialize = function(self)
+-- print("Trying to serailize!")
+-- return ""
+-- end
+--
+-- --Required, Rebuilds the item from data created in Serialize, if the item is different from the "main" copy of the item, it should retun a tabl.Copy(self), with the appropriate fields set.
+-- item.DeSerialize = function(self,string)
+-- print("Trying to deserialize!")
+-- return self
+-- end
+-- if SERVER then
+-- util.AddNetworkString("eat_watermelon")
+-- net.Receive("eat_watermelon", function(len,ply)
+-- local row,col,bp = ply:HasItem("Watermelon")
+-- if row and col and bp then
+-- ply:RemoveItemAt(bp,row,col)
+-- end
+-- end)
+-- end
+-- --Optional, when the player clicks this item, a menu will show up, if the menu item is clicked, the function is ran. This is all run client side, so if you want it to do something server side, you'll need to use the net library. Remember that items are in the shared domain, so you can define what it does in the same file!
+-- function item.GetOptions(self)
+-- local options = {}
+-- options["eat"] = function()
+-- net.Start("eat_watermelon")
+-- net.SendToServer()
+-- end
+-- return options
+-- end
+--
+-- --Required, the shape of this item in a backpack.
+-- item.Shape = {
+-- {true,true,true},
+-- {true,true,true},
+-- {true,true,true},
+-- }
+--
+-- item.onDropped = function(self, ent)
+-- if SERVER then
+-- pac.ApplyPac(ent,"Watermelon")
+-- end
+-- end
+--
+-- print("Hello from exampleitem.lua")
+-- --Don't forget to register the item!
+-- nrequire("item.lua").RegisterItem(item)