summaryrefslogtreecommitdiff
path: root/gamemode/itemsystem/common_dropable.lua
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/itemsystem/common_dropable.lua')
-rw-r--r--gamemode/itemsystem/common_dropable.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/gamemode/itemsystem/common_dropable.lua b/gamemode/itemsystem/common_dropable.lua
index 1f4ec7e..2b8446d 100644
--- a/gamemode/itemsystem/common_dropable.lua
+++ b/gamemode/itemsystem/common_dropable.lua
@@ -1,4 +1,5 @@
function genericMakeDroppable(tbl)
+ if(SERVER) then return end
local drop1 = function(player)
genericDropResource(player,tbl.Name,1)
end
@@ -7,6 +8,9 @@ function genericMakeDroppable(tbl)
print("Ammount:" .. Resources[tbl.Name])
genericDropResource(player,tbl.Name,Resources[tbl.Name])
end
+ local drophalf = function(player)
+ genericDropResource(player,tbl.Name,math.ceil(Resources[tbl.Name]/2.0))
+ end
local dropx = function(player)
if(SERVER) then return end
local frame = vgui.Create( "DFrame" )
@@ -32,6 +36,7 @@ function genericMakeDroppable(tbl)
tbl.Actions["Drop"] = {}
end
tbl.Actions["Drop"]["Drop 1"] = drop1
+ tbl.Actions["Drop"]["Drop Half"] = drophalf
tbl.Actions["Drop"]["Drop all"] = dropall
tbl.Actions["Drop"]["Drop X"] = dropx
end