Skip to content

API patterns

Document an export (full pattern)

exports['pcore-core']:AddMoney

Adds money to a character wallet.

lua
local success = exports['pcore-core']:AddMoney(src, account, amount, reason)
ParamTypeDescription
srcnumberPlayer server id
account'cash' | 'bank'Wallet type
amountnumberPositive amount
reasonstring?Log reason

Returns: booleantrue if applied

Side effects: triggers pcore:money:changed on server

WARNING

Do not call from client. Server only.


Document an event (full pattern)

pcore:server:characterLoaded

Fired when character is ready on server.

Payload

FieldTypeDescription
srcnumberPlayer id
citizenidstringCharacter id
lua
AddEventHandler('pcore:server:characterLoaded', function(src, citizenid)
    print(('Loaded %s for %s'):format(citizenid, src))
end)