GetPlayerData() - Get all or some of player's data
local data = exports.lation_meth:GetPlayerData()print(data.level) -- Levelprint(data.exp) -- Experienceprint(data.total_produced) -- Total meth producedprint(data.total_supply_runs) -- Total supply runs completedprint(data.inside) -- The warehouse ID player was in when last disconnectedprint(data.ammonia) -- Players specific "perfect" ammonia input (if unique = true)print(data.iodine) -- Players specific "perfect" iodine input (if unique = true)print(data.acetone) -- Players specific "perfect" acetone input (if unique = true)-- If only looking for a specific data type, can also be used like so:local playerLevel = exports.lation_meth:GetData('level')print('Player is currently level: ' ..playerLevel)
GetTableData(tableId) - Get a specific table's data
local data = exports.lation_meth:GetTableData(tableId)print(data.id) -- number: Table IDprint(data.x) -- number: Table X coordinateprint(data.y) -- number: Table Y coordinateprint(data.z) -- number: Table Z coordinateprint(data.heading) -- number: Table headingprint(data.stage) -- number: Table's current cooking stageprint(data.heating) -- boolean: If table is in the heating stageprint(data.cooling) -- boolean: If table is in the cooling stageprint(data.remaining) -- number: Time in ms remaining for current stageprint(data.purity) -- number: The current purity level of meth being producedprint(data.bucket) -- number: The routing bucket the table exists inprint(data.owner) -- string: The owner of this table's identifier
GetWarehouseData(warehouseId) - Get a specific warehouse's data
local data = exports.lation_meth:GetTableData(tableId)print(data.owner) -- string: The owner of this warehouse identifierprint(data.id) -- number: The warehouse IDprint(data.style) -- string: The interior "style" of the warehouseprint(data.security) -- string: The interior "security" of the warehouseprint(data.pin) -- number|nil: The stash PIN if one existsprint(data.locked) -- string: The doorlock status ('locked' or 'unlocked')print(data.remaining) -- number: Time in ms remaining until upgrade completesprint(data.upgrade) -- string: The upgrade type to be applied when remaining endsprint(data.ammonia) -- number: The current ammonia level availableprint(data.iodine) -- number: The current iodine level availableprint(data.acetone) -- number: The current acetone level availableprint(data.stage) -- number: The current cooking stageprint(data.purity) -- number: The purity of meth being produced if in progressprint(data.duration) -- number: Time in ms remaining until current stage endsprint(data.efficiency) -- number: Player who started the production's efficiency percentageprint(data.inputs) -- table: Table containing players panel inputs (data.inputs.ammonia, etc)print(data.users) -- table: Table containing authorized users to this warehouse (contains name & identifier of each authorized user)
IsWarehouseOwner(warehouseId) - Returns boolean if player is the warehouse owner
local isOwner = exports.lation_meth:IsWarehouseOwner(warehouseId)if isOwner thenprint('This player IS the owner of the warehouse!')elseprint('This player is NOT the owner of the warehouse.')end
IsAuthorizedUser(warehouseId) - Returns boolean if player is an authorized user of specified warehouse
local isAuthorized = exports.lation_meth:IsAuthorizedUser(warehouseId)if isAuthorized thenprint('This player IS an authorized user!')elseprint('This player is NOT an authorized user.')end
IsInsideWarehouse() - Returns two parameters: first a boolean (true if player is inside a warehouse, false if not) and second a number (returns the warehouse ID they are currently in)
local isInside, warehouseId = exports.lation_meth:IsInsideWarehouse()if isInside thenprint('This player IS inside a warehouse, the warehouseId is: ' ..warehouseId)elseprint('This player is NOT inside any warehouse right now.')end
WarehouseShop() - Opens the warehouse shop menu showing available warehouses for sale
exports.lation_meth:WarehouseShop()
IsViewingCamera() - Returns boolean if player is currently viewing security camera
local viewingCamera = exports.lation_meth:IsViewingCamera()if viewingCamera thenprint('The player is currently looking at their security camera')elseprint('The player is NOT currently looking at their security camera')end
Server
GetPlayerData(source) - Get all or some of player's data
-- source: Player ID-- type: optional: Data typelocal data = exports.lation_meth:GetPlayerData(source)print(data.level) -- Levelprint(data.exp) -- Experienceprint(data.total_produced) -- Total meth producedprint(data.total_supply_runs) -- Total supply runs completedprint(data.inside) -- The warehouse ID player was in when last disconnectedprint(data.ammonia) -- Players specific "perfect" ammonia input (if unique = true)print(data.iodine) -- Players specific "perfect" iodine input (if unique = true)print(data.acetone) -- Players specific "perfect" acetone input (if unique = true)-- If only looking for a specific data type, can also be used like so:local playerLevel = exports.lation_meth:GetData(source, 'level')print('Player is currently level: ' ..playerLevel)
GetTableData(tableId) - Get a specific table's data
local data = exports.lation_meth:GetTableData(tableId)print(data.id) -- number: Table IDprint(data.x) -- number: Table X coordinateprint(data.y) -- number: Table Y coordinateprint(data.z) -- number: Table Z coordinateprint(data.heading) -- number: Table headingprint(data.stage) -- number: Table's current cooking stageprint(data.heating) -- boolean: If table is in the heating stageprint(data.cooling) -- boolean: If table is in the cooling stageprint(data.remaining) -- number: Time in ms remaining for current stageprint(data.purity) -- number: The current purity level of meth being producedprint(data.bucket) -- number: The routing bucket the table exists inprint(data.owner) -- string: The owner of this table's identifier
GetWarehouseData(warehouseId) - Get a specific warehouse's data
local data = exports.lation_meth:GetTableData(tableId)print(data.owner) -- string: The owner of this warehouse identifierprint(data.id) -- number: The warehouse IDprint(data.style) -- string: The interior "style" of the warehouseprint(data.security) -- string: The interior "security" of the warehouseprint(data.pin) -- number|nil: The stash PIN if one existsprint(data.locked) -- string: The doorlock status ('locked' or 'unlocked')print(data.remaining) -- number: Time in ms remaining until upgrade completesprint(data.upgrade) -- string: The upgrade type to be applied when remaining endsprint(data.ammonia) -- number: The current ammonia level availableprint(data.iodine) -- number: The current iodine level availableprint(data.acetone) -- number: The current acetone level availableprint(data.stage) -- number: The current cooking stageprint(data.purity) -- number: The purity of meth being produced if in progressprint(data.duration) -- number: Time in ms remaining until current stage endsprint(data.efficiency) -- number: Player who started the production's efficiency percentageprint(data.inputs) -- table: Table containing players panel inputs (data.inputs.ammonia, etc)print(data.users) -- table: Table containing authorized users to this warehouse (contains name & identifier of each authorized user)
GetPlayerWarehouses(source) - Returns table containing all warehouses owned by player & each warehouses data
local warehouses = exports.lation_meth:GetPlayerWarehouses(source)print('All warehouses owned by player: ' ..json.encode(warehouses, {indent =true})
GetPlayersInWarehouse(warehouseId) - Returns table containing all players currently inside a specific warehouse
local players = exports.lation_meth:GetPlayersInWarehouse(warehouseId)print('All players currently in warehouse: ' ..json.encode(players, {indent =true})
IsWarehouseOwner(source, warehouseId) - Returns boolean if player is the warehouse owner
local isOwner = exports.lation_meth:IsWarehouseOwner(source, warehouseId)if isOwner thenprint('This player IS the owner of the warehouse!')elseprint('This player is NOT the owner of the warehouse.')end
IsAuthorizedUser(source, warehouseId) - Returns boolean if player is an authorized user of specified warehouse
local isAuthorized = exports.lation_meth:IsAuthorizedUser(source, warehouseId)if isAuthorized thenprint('This player IS an authorized user!')elseprint('This player is NOT an authorized user.')end
IsWarehouseAvailable(warehouseId) - Returns boolean if warehouse is currently for sale or not
local isForSale = exports.lation_meth:IsWarehouseAvailable(warehouseId)if isForSale thenprint('This warehouse is currently available for sale and not owned by anyone')elseprint('This warehouse has an owner and is NOT available for sale')end
IsUpgradeActive(warehouseId) - Returns boolean if warehouse is currently being upgraded
local isUpgradeActive = exports.lation_meth:IsUpgradeActive(warehouseId)if isUpgradeActive thenprint('This warehouse is currently being upgraded!')elseprint('This warehouse is NOT being upgraded right now')end
AddPlayerData(source, type, amount) - Add new data to player
-- source: Player ID-- type: Data type to add ('level', 'exp', 'total_produced', 'total_supply_runs')-- amount: Amount (number) to addexports.lation_meth:AddPlayerData(source, 'exp', 100)-- Adds 100XP to players experience