Shared

Export(s) available for use on the client & server.

GetPlayerData

Retrieves player data. Optionally, you can pass a string to get a specific piece of data.

Syntax

Client

exports.lation_meth:GetPlayerData(key)
  • key (optional, string): The specific player data field you want to retrieve (e.g., "level", "exp", "inside"). If omitted, returns a table with all player data.

Server

exports.lation_meth:GetPlayerData(source, key)
  • source (required, number): The player’s source
  • key (optional, string): The specific player data field you want to retrieve (e.g., "level", "exp", "inside"). If omitted, returns a table with all player data.

Returns

  • If key is provided; returns the value of the specified data field.
  • If key is not provided; returns a table containing all player data fields.

Examples

client.lua
local data = exports.lation_meth:GetPlayerData()
print('All player data: ', json.encode(data, {indent=true}))
 
local level = exports.lation_meth:GetPlayerData('level')
print('Player\'s level: ', level)
server.lua
local source = 1 -- Replace with player's source
 
local data = exports.lation_meth:GetPlayerData(source)
print('All player data: ', json.encode(data, {indent=true}))
 
local level = exports.lation_meth:GetPlayerData(source, 'level')
print('Player\'s level: ', level)

GetTableData

Retrieves table data.

Syntax

Shared

exports.lation_meth:GetTableData(tableId)
  • tableId (required, number): The table ID you want to retrieve data for.

Returns

  • A table containing all table data.

Examples

client.lua
local data = exports.lation_meth:GetTableData(tableId)
print('All table data: ', json.encode(data, {indent=true}))
server.lua
local data = exports.lation_meth:GetTableData(tableId)
print('All table data: ', json.encode(data, {indent=true}))

GetWarehouseData

Retrieves warehouse data.

Syntax

Shared

exports.lation_meth:GetWarehouseData(warehouseId)
  • warehouseId (required, number): The warehouse ID you want to retrieve data for.

Returns

  • A table containing all warehouse data.

Examples

client.lua
local data = exports.lation_meth:GetWarehouseData(warehouseId)
print('All warehouse data: ', json.encode(data, {indent=true}))
server.lua
local data = exports.lation_meth:GetWarehouseData(warehouseId)
print('All warehouse data: ', json.encode(data, {indent=true}))

IsWarehouseOwner

Returns true or false if the player is the owner of the warehouse.

Syntax

Client

exports.lation_meth:IsWarehouseOwner(warehouseId)
  • warehouseId (required, number): The warehouse ID you want to check.

Server

exports.lation_meth:IsWarehouseOwner(source, warehouseId)
  • source (required, number): The player’s source
  • warehouseId (required, number): The warehouse ID you want to check.

Returns

  • A boolean if player is owner (true or false).

Examples

client.lua
local isOwner = exports.lation_meth:IsWarehouseOwner(warehouseId)
if isOwner then
    print('Player is the owner of this warehouse')
else
    print('Player is NOT the owner of this warehouse')
end
server.lua
local isOwner = exports.lation_meth:IsWarehouseOwner(source, warehouseId)
if isOwner then
    print('Player is the owner of this warehouse')
else
    print('Player is NOT the owner of this warehouse')
end

IsAuthorizedUser

Returns true or false if the player is an authorized user of the warehouse.

Syntax

Client

exports.lation_meth:IsAuthorizedUser(warehouseId)
  • warehouseId (required, number): The warehouse ID you want to check.

Server

exports.lation_meth:IsAuthorizedUser(source, warehouseId)
  • source (required, number): The player’s source
  • warehouseId (required, number): The warehouse ID you want to check.

Returns

  • A boolean if player is an authorized user (true or false).

Examples

client.lua
local isAuthorizedUser = exports.lation_meth:IsAuthorizedUser(warehouseId)
if isAuthorizedUser then
    print('Player is an authorized user of this warehouse')
else
    print('Player is NOT an authorized user of this warehouse')
end
server.lua
local isAuthorizedUser = exports.lation_meth:IsAuthorizedUser(source, warehouseId)
if isAuthorizedUser then
    print('Player is an authorized user of this warehouse')
else
    print('Player is NOT an authorized user of this warehouse')
end

Client

Export(s) available for use on the client only.

IsInsideWarehouse

Returns true or false if the player is inside a warehouse and warehouse ID.

Syntax

Client

exports.lation_meth:IsInsideWarehouse()

Returns

  • A boolean if player is inside a warehouse (true or false).
  • A number (the warehouse ID they are in, if applicable) or nil.

Examples

client.lua
local isInside, warehouseId = exports.lation_meth:IsInsideWarehouse()
print('Is player inside a warehouse? ', tostring(isInside))
print('Which warehouse (ID) are they in? ', tostring(warehouseId))

IsViewingCamera

Returns true or false if the player is currently viewing a security camera.

Syntax

Client

exports.lation_meth:IsViewingCamera()

Returns

  • A boolean if player if the player is viewing a security camera (true or false).

Examples

client.lua
local IsViewingCamera = exports.lation_meth:IsViewingCamera()
if IsViewingCamera then
    print('Player is currently viewing a security camera')
else
    print('Player is NOT currently viewing a security camera')
end

WarehouseShop

Opens the warehouse shop menu showing available properties.

Syntax

Client

exports.lation_meth:WarehouseShop()

Examples

client.lua
exports.lation_meth:WarehouseShop()
print('You opened the warehouse shop!')

Server

Export(s) available for use on the server only.

GetPlayerWarehouses

Returns a table containing all warehouses owned by a player.

Syntax

Server

exports.lation_meth:GetPlayerWarehouses(source)
  • source (required, number): The player’s source

Returns

  • A table containing all warehouses.

Examples

server.lua
local warehouses = exports.lation_meth:GetPlayerWarehouses(source)
print('Warehouses currently owned by player: ', json.encode(warehouses, {indent=true}))

GetPlayersInWarehouse

Returns a table containing all players currently inside specified warehouse.

Syntax

Server

exports.lation_meth:GetPlayersInWarehouse(warehouseId)
  • warehouseId (required, number): The warehouse ID you want to check.

Returns

  • A table containing all players inside warehouse.

Examples

server.lua
local players = exports.lation_meth:GetPlayersInWarehouse(warehouseId)
print('All players currently inside: ', json.encode(players, {indent=true}))

IsWarehouseAvailable

Returns true or false if the warehouse is available for sale.

Syntax

Server

exports.lation_meth:IsWarehouseAvailable(warehouseId)
  • warehouseId (required, number): The warehouse ID you want to check.

Returns

  • A boolean if the warehouse is available for sale (true or false).

Examples

server.lua
local IsWarehouseAvailable = exports.lation_meth:IsWarehouseAvailable(warehouseId)
if IsWarehouseAvailable then
    print('Yes, this warehouse is available for sale')
else
    print('No, this warehouse is NOT available for sale')
end

AddPlayerData

Adds an amount to a player’s specified data field.

Syntax

Server

exports.lation_meth:AddPlayerData(source, dataType, amount)
  • source (required, number): The player’s source
  • dataType (required, string): The data field to modify (e.g., "level", "exp", etc)
  • amount (required, number): The amount to add to the specified data field

Examples

server.lua
local source = 1 -- Replace with player's source
exports.lation_meth:AddPlayerData(source, 'exp', 100)
print('Added +100 XP to player!')
 
exports.lation_meth:AddPlayerData(source, 'total_produced', 5)
print('Added +5 to player\'s total meth produced!')