STG ScriptsDocumentation

Client API

stg_lib client-side reference. Money, job, permission, and player data accessible from any client script.

Client-side stg_lib exports resolve through ox_lib callbacks under the hood. Cached where possible.

Money

local cash = exports.stg_lib:getMoney('cash')
local bank = exports.stg_lib:getMoney('bank')

Modify money (routed to server, validated there):

exports.stg_lib:addMoney(500)
exports.stg_lib:removeMoney(200)

-- target another player (requires permission)
exports.stg_lib:addMoney(500, targetId)
exports.stg_lib:removeMoney(200, targetId)

Job

local job = exports.stg_lib:getJob()
-- { name, grade, label, grade_label }

local jobs = exports.stg_lib:getJobs()

Permission

local permission = exports.stg_lib:getPermission()

Player data

local data = exports.stg_lib:getPlayerData()
-- { identifier, firstname, lastname, job, dob, gender, nation, identifiers }

-- another player
local data = exports.stg_lib:getPlayerData(targetId)

Client reads are cached. First call triggers a round-trip to the server, subsequent calls return the cached value until the player's state changes.

Still having trouble?

Open a ticket on our Discord. Our team answers around 15 hours a day.

Get help on Discord

On this page