-
-
Notifications
You must be signed in to change notification settings - Fork 0
Module: Inventory
Аниса edited this page Dec 16, 2022
·
55 revisions
This module provides a custom inventory management interface to integrate w/ your resources.
For servers such as DayZ
, Roleplay
, RPG
efficient & reliable inventory management is essentially needed due to gamemodes being centralized on it, thus the module!.
local table: result, table: arguments = dbify.module.inventory.fetchAll(
table: {
--Conditional datas to be used for the query
{string: columnName, ~: columnValue},
...
},
bool: isSoloFetch, --Enabling this returns only first row of the retrieved result
~: ...arguments
)
local bool: result, table: arguments = dbify.module.inventory.ensureItems(
table: {
--Items to be ensured
[string: itemName] = true,
...
},
~: ...arguments
)
local int: inventoryID, table: arguments = dbify.module.inventory.create(
~: ...arguments
)
local bool: result, table: arguments = dbify.module.inventory.delete(
int: inventoryID,
~: ...arguments
)
local bool: result, table: arguments = dbify.module.inventory.setData(
int: inventoryID,
table: {
--Columns to be updated w/ their respective values
{string: columnName, ~: columnValue},
...
},
~: ...arguments
)
local table: result, table: arguments = dbify.module.inventory.getData(
int: inventoryID,
table: {
--Columns whose values are to be retrieved
string: columnName,
...
},
~: ...arguments
)
local bool: result, table: arguments = dbify.module.inventory.item.add(
int: inventoryID,
table: {
--Items to be added to the inventory w/ their respective counts
{string: itemName, int: itemCount},
...
},
~: ...arguments
)
local bool: result, table: arguments = dbify.module.inventory.item.remove(
int: inventoryID,
table: {
--Items to be removed from the inventory w/ their respective counts
{string: itemName, int: itemCount},
...
},
~: ...arguments
)
local bool: result, table: arguments = dbify.module.inventory.item.setProperty(
int: inventoryID,
table: {
--Items whose properties are to be updated
string: itemName,
...
},
table: {
--Item properties to be updated for specified items w/ their respective values
{string: propertyName, ~: propertyValue},
...
},
~: ...arguments
)
local table: result, table: arguments = dbify.module.inventory.item.getProperty(
int: inventoryID,
table: {
--Items whose properties are to be retrieved
string: itemName,
...
},
table: {
--Item properties to be retrieved for specified items
string: propertyName,
...
},
~: ...arguments
)
local bool: result, table: arguments = dbify.module.inventory.item.setData(
int: inventoryID,
table: {
--Items whose datas are to be updated
string: itemName,
...
},
table: {
--Item datas that has to be updated for specified items w/ their respective values
{string: dataName, ~: dataValue},
...
},
~: ...arguments
)
local table: result, table: arguments = dbify.module.inventory.item.getData(
int: inventoryID,
table: {
--Items whose datas are to be retrieved
string: itemName,
...
},
table: {
--Item datas whose values are to be retrieved
string: dataName,
...
},
~: ...arguments
)