Kartik Scripts

CreditAccount

local ok, err = exports['kartik-banking']:CreditAccount(accountType, accountId, amount, reason)

🔹 Description

Puts money into any account: a player's personal or Swiss account, a company account or a shared account. Use it for payouts, refunds or job income.

Works for offline players too. Fires the onDeposit event when it succeeds.


🔧 Parameters

NameTypeRequiredDescription
accountTypestring✅'personal', 'swiss', 'company' (or 'job'), 'shared'
accountIdstring✅personal / swiss: the player's citizenid. company: the job name. shared: the account number
amountnumber✅Whole dollars, above 0
reasonstring✅Shown in the player's transaction history

📤 Returns

TypeDescription
trueThe money was added
false, errorNothing was added. error is one of the codes below
ErrorMeaning
invalid_amountAmount missing or not above 0
reason_requiredNo reason given
account_not_foundNo account for that type and id
account_frozenThe account is frozen
account_not_activatedThe account has no debit card yet
transaction_failedThe money could not be moved

🧠 Example Usage

-- Paying the mechanic business for a repair
exports['kartik-banking']:CreditAccount('company', 'mechanic', 1200, 'Repair order #4411')

-- Refunding a player
exports['kartik-banking']:CreditAccount('personal', citizenid, 50, 'Refund - cancelled order')

On this page