Exports

Default resource name: eadmin_panel. If renamed, update references accordingly.

local EAdmin = 'eadmin_panel'

Server Exports

logMoneyChange

Records a player money change. Writes are batch-buffered for high throughput.

exports[EAdmin]:logMoneyChange(src, moneyType, amount, balanceBefore, reason)
Param
Type
Required
Description

src

number

Yes

Player server ID

moneyType

string

Yes

'cash' / 'bank' / 'crypto'

amount

number

Yes

Positive = gain, negative = loss

balanceBefore

number

Yes

Balance before this change

reason

string

No

Human-readable reason

Returns boolean. balanceAfter is computed automatically.

Safe Wrapper

Wrap calls with pcall so EAdmin errors never break money operations:

local function logMoneyChangeSafely(source, moneyType, amount, balanceBefore, reason)
    pcall(function()
        exports['eadmin_panel']:logMoneyChange(source, moneyType, amount, balanceBefore, reason)
    end)
end

Integration Example (Qbox)

Capture balanceBefore before mutation, call wrapper after:

Notes:

  • Read balanceBefore before mutating the balance

  • Amount sign: positive = gain, negative = loss

  • Only online players are logged (offline mutations are skipped)

  • Always use the pcall wrapper in framework core code

Last updated