From e014b7940d59c791c4a6e96ec27aa3232d3a39a1 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Sun, 22 May 2016 14:18:52 -0400 Subject: Cleaned up the comments in the itemsystem --- gamemode/itemsystem/common_plantable.lua | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'gamemode/itemsystem/common_plantable.lua') 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 -- cgit v1.2.3-70-g09d2