summaryrefslogtreecommitdiff
path: root/gamemode/cl_inventory.lua
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2016-05-30 14:42:09 -0400
committerAlexander Pickering <alexandermpickering@gmail.com>2016-05-30 14:42:09 -0400
commit2736f498f30220b858fc6fac23e7ddc4a597df6d (patch)
tree374ceadedb654b00e09dac321620a8320830f734 /gamemode/cl_inventory.lua
downloadredead-2736f498f30220b858fc6fac23e7ddc4a597df6d.tar.gz
redead-2736f498f30220b858fc6fac23e7ddc4a597df6d.tar.bz2
redead-2736f498f30220b858fc6fac23e7ddc4a597df6d.zip
Inital commit
Diffstat (limited to 'gamemode/cl_inventory.lua')
-rw-r--r--gamemode/cl_inventory.lua82
1 files changed, 82 insertions, 0 deletions
diff --git a/gamemode/cl_inventory.lua b/gamemode/cl_inventory.lua
new file mode 100644
index 0000000..f8df461
--- /dev/null
+++ b/gamemode/cl_inventory.lua
@@ -0,0 +1,82 @@
+
+LocalInventory = {}
+LocalStash = {}
+LocalStashCash = 0
+PreviewStyle = "Stash"
+PreviewPriceScale = 1
+
+function Inv_HasItem( id )
+
+ for k,v in pairs( LocalInventory ) do
+
+ local tbl = item.GetByID( v )
+
+ if ( type( id ) == "number" and tbl.ID == id ) or ( type( id ) == "string" and tbl.Model == id ) then
+
+ return tbl
+
+ end
+
+ end
+
+end
+
+function Inv_ItemCount( id )
+
+ local count = 0
+
+ for k,v in pairs( LocalInventory ) do
+
+ if v == id then
+
+ count = count + 1
+
+ end
+
+ end
+
+ return count
+
+end
+
+function Inv_Get( pos )
+
+ return LocalInventory[ pos ]
+
+end
+
+function Inv_UniqueItems()
+
+ local ids = {}
+
+ for k,v in pairs( LocalInventory ) do
+
+ if not table.HasValue( ids, v ) then
+
+ table.insert( ids, v )
+
+ end
+
+ end
+
+ return ids
+
+end
+
+function Inv_Size()
+
+ return #LocalInventory
+
+end
+
+function Inv_GetStashCash()
+
+ return LocalStashCash
+
+end
+
+function Inv_SetStashCash( amt )
+
+ LocalStashCash = amt
+
+end \ No newline at end of file