GetAllWarehouses
π§ Available since Version 1.0.5
This export is only available for serverside!
Export Syntax
exports['dream_cryptomining']:GetAllWarehouses() -- Returns a table with data
Response
Response Table
{
"WAREHOUSEID" : {
"id": int, -- WarehouseId
"name": string, -- Warehouse Name
"warehouse": string, -- [small, medium, large]
"available": boolean, -- Is available to buy?
"price": int, -- πΈ Warehouse Price
"posx": float, -- Warehouse Position X
"posy": float, -- Warehouse Position Y
"posz": float, -- Warehouse Position Z
"created_at": float, -- Unix Timestamp
"updated_at": float, -- Unix Timestamp
-- β οΈ Only when assigned to a player
"assigned": {
"id": int, -- AssignedId
"owner": string, -- Identifier of player
"warehouse": int, -- WarehouseId
"active": boolean, -- Is assignment active?
"income": int, -- πΈ Current Income
"outgoing": int -- πΈ Current Outgoing
"created_at": float, -- Unix Timestamp
"updated_at": float, -- Unix Timestamp
"server": { -- Server Data
"SERVERID": {
"status": string -- [active, inactive, broken, unavailable]
},
...
},
"transactions": { -- All Transactions
"TRANSACTIONID": {
"id": int, -- TransactionId
"warehouse": int, -- WarehouseId
"assigned": int, -- AssignedId
"transactionId": string -- TransactionId (e.g. T994826)
"type": string, -- [income, outgoing]
"status": string, -- [pending, complete]
"kwh": float, -- Kwh amount
"server": int, -- Server amount
"amount": int, -- πΈ Amount
"date": string, -- Formated Date (DD.MM.YYYY HH:MM)
"created_at": float, -- Unix Timestamp
"updated_at": float, -- Unix Timestamp
},
...
}
}
}
...
}
Example Export
local Warehouses = exports['dream_cryptomining']:GetAllWarehouses()
for key, value in pairs(Warehouses) do
print(value.id) -- π WarehouseId
print(value.price) -- πΈ Warehouse Price
print(value.warehouse) -- βοΈ Warehouse Type
-- π¬ Use all other variables...
end
Last updated