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
| Name | Type | Required | Description |
|---|---|---|---|
accountType | string | ✅ | 'personal', 'swiss', 'company' (or 'job'), 'shared' |
accountId | string | ✅ | personal / swiss: the player's citizenid. company: the job name. shared: the account number |
amount | number | ✅ | Whole dollars, above 0 |
reason | string | ✅ | Shown in the player's transaction history |
📤 Returns
| Type | Description |
|---|---|
true | The money was added |
false, error | Nothing was added. error is one of the codes below |
| Error | Meaning |
|---|---|
invalid_amount | Amount missing or not above 0 |
reason_required | No reason given |
account_not_found | No account for that type and id |
account_frozen | The account is frozen |
account_not_activated | The account has no debit card yet |
transaction_failed | The 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')