summaryrefslogtreecommitdiff
path: root/gamemode/itemsystem/common_plantable.lua
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/itemsystem/common_plantable.lua')
-rw-r--r--gamemode/itemsystem/common_plantable.lua12
1 files changed, 8 insertions, 4 deletions
diff --git a/gamemode/itemsystem/common_plantable.lua b/gamemode/itemsystem/common_plantable.lua
index d99a8d5..4570dc8 100644
--- a/gamemode/itemsystem/common_plantable.lua
+++ b/gamemode/itemsystem/common_plantable.lua
@@ -1,7 +1,11 @@
--[[
-You can call genericMakePlantable(ITEM) on items to make them have a plant option.
-Before genericMakePlantable get called, be sure the item has an .GrowTime =number
-and a .OnGrow = function(player)
+Provides:
+ genericMakePlantable(table_item)
+ You can call genericMakePlantable(table_item) on items to make them have a plant option. Before genericMakePlantable get called, be sure the item has an .GrowTime =number and a .OnGrow = function(player_player)
+ GAMEMODE.MakeGenericPlantChild(player_ply, vector_pos, string_model, entity_parent)
+ Creates a child on the plant(like oranges or melons on their bush), with player as the owner, at the given position(relative to the plant), with the given model, the parrent is the entity that will be removed once all the children are removed. If ply is nil, then the plant will be owned by world.
+ GAMEMODE.MakeGenericPlant(player_ply, vector_pos, string_model, boolean_isWorld )
+ Creates a plant with the specified string, at the position, with ply as the ower. If isWorld is true, the owner is the world instead (like trees)
]]
if (SERVER) then
@@ -18,7 +22,7 @@ local function plant(player, resourcename)
assert(tbl.GrowTime != nil,tbl.Name .. " .GrowTime is nil!")
assert(isfunction(tbl.OnGrow),tbl.Name .. " .OnGrow is not a table")
- if(player:GetNWInt("plants") > GetConVar("gms_PlantLimit"):GetInt()-1) then
+ if (player:GetNWInt("plants") > GetConVar("gms_PlantLimit"):GetInt() - 1) then
player:SendMessage( "You man only have " .. GetConVar("gms_PlantLimit"):GetInt() .. " plants at a time.", 3, Color( 10, 200, 10, 255 ) )
return
end