Skip to main content

GetAllWindTurbines

warning

This export is only available for serverside!

Export Syntax
exports['dream_windturbines']:GetAllWindTurbines() -- Returns a table with data

Response

Response Table
{
["TURBINEID"] : {
"id": int, -- TurbineId
"type": string, -- [compact, industrial, mega]
"available": boolean, -- Is available to buy?
"price": int, -- 💸 Wind Turbine Price
"posx": float, -- Wind Turbine Position X
"posy": float, -- Wind Turbine Position Y
"posz": float, -- Wind Turbine 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
"wind_turbine": int, -- TurbineId
"active": boolean, -- Is assignment active?
"income": int, -- 💸 Current Income
"outgoing": int -- 💸 Current Outgoing
"created_at": float, -- Unix Timestamp
"updated_at": float, -- Unix Timestamp
"upgrades": { -- Upgrades Data
{
"id": int,
"assigned": int, -- AssignedId
"upgrade": string,
"created_at": float, -- Unix Timestamp
"updated_at": float, -- Unix Timestamp
},
...
},
"transactions": { -- All Transactions
"TRANSACTIONID": {
"id": int, -- TransactionId
"wind_turbine": int, -- TurbineId
"assigned": int, -- AssignedId
"transactionId": string -- TransactionId (e.g. T994826)
"type": string, -- [income, outgoing]
"status": string, -- [pending, complete]
"kwh": float, -- Kwh 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 WindTurbines = exports['dream_windturbines']:GetAllWindTurbines()

for key, value in pairs(WindTurbines) do
print(value.id) -- 📌 TurbineId
print(value.price) -- 💸 Wind Turbine Price
print(value.type) -- ✉️ Wind Turbine Type

-- 💬 Use all other variables...
end