Skip to Content

ESX Structure

Understanding how ESX is organized helps when developing resources.

Core Resources

Player Data

Player data structure:

xPlayer = { identifier = "steam:...", accounts = { money = 5000, bank = 10000 }, job = { name = "unemployed", label = "Unemployed", grade = 0 } }

Exports

Common ESX exports:

-- Get player local xPlayer = ESX.GetPlayerFromId(source) -- Get player data local accounts = xPlayer.getAccounts() -- Add money xPlayer.addMoney(100) -- Remove money xPlayer.removeMoney(50)

Events

Common ESX events: