🏦SLEEK BANKING

Here check the installation guide

Work Guide

This is a quick, player‑facing flow you can copy into your community docs.

Bank & ATM access

  • Open a bank at any bank NPC/location (blips are provided). If target is disabled, press the configured key (default E, control code 38) near the banker.

  • Open an ATM at any ATM prop or listed ATM position (auto‑detection can be enabled).

Credit card & PIN

  • Buy a credit card from the bank UI (if enabled in config).

  • If the server requires a card item, the player must use that item to open ATM banking.

  • Set a PIN (length defined in config). PIN is requested when opening via ATM (if enabled).

Accounts & IBAN

  • Each account has an IBAN (auto‑generated). Optionally allow players to change their IBAN for a fee.

  • View balance, last transactions, totals deposited/withdrawn.

Cash deposit / withdrawal / transfer

  • Deposit cash to bank balance

  • Withdraw cash from bank

  • Transfer to any other valid IBAN; transfers work to online or offline targets.

Loans

  • Request a loan with server‑side validated amount & installments.

  • Interest is calculated dynamically based on installments; late penalties can apply.

  • Repayments are scheduled automatically;

Savings

  • Open a savings account (one‑time activation cost).

  • Deposit / withdraw (withdrawals can have a fee).

  • Interest is accrued automatically at the configured interval; shows next interest time.

History & limits

  • UI shows recent transactions and a paginated transactions tab (limits are configurable).


Installation

  1. Download & place the resource

    • Put the entire folder sleek-bank into your server’s resources directory.

    • Do not rename the folder.

  2. Start order in server.cfg

  3. Database

    • Import sleek-bank/sleek-bank.sql into your DB. It creates:

      • sleekbank_accounts

      • sleekbank_loans

      • sleekbank_savings

      • sleekbank_transactions (with useful indexes)

  4. Inventory item (optional but recommended)

    • If Config.CreditCardRequiresItem = true, add the credit_card item to your inventory system (see Inventory Items).

  5. Clear cache & restart

    • Clear server and client cache (FiveM).

    • Restart the server.


Configuration

All options are in config.lua. Below is a guided overview (names exactly match the file).

Core & Framework

Banks, ATMs & Targeting

  • Bank positions (3D text or target zone):

  • ATMs

    • Automatic detection of props can be enabled:

    • Static ATM positions (always checked):

    • ATM prop models (used for auto‑detection), e.g.:

  • Blips & Bank NPCs Blips and banker peds are configured under Config.Blips and Config.BankNPCs with sprite, color, and idle animations.

Server‑side safety: open requests validate proximity to bank/ATM; ATM range is ~3.0 units.

Fees & IBAN

  • Transaction fees (percentages; 0.02 = 2%):

  • IBAN

Credit Card & PIN

How it works

  • If CreditCardRequiresItem = true, the usable item is registered server‑side:

    • ESX: ESX.RegisterUsableItem

    • QB/QBOX: QBCore.Functions.CreateUseableItem

    • ox_inventory: an item callback is exported by name

  • The server guards ATM access with a one‑time secret token only created inside the item callback, so only legit card uses can open ATM banking.

  • If CreditCardUsesMetadata = true, the card item stores the IBAN of its owner.

ATM Animations

Loans

Server behavior

  • Total owed: principal * (1 + interestRate), where interestRate = baseInterestRate + (installments - minInstallments) * interestIncrementPerInstallment.

  • Payments are scheduled and applied even if the recipient is offline.

  • The penalty is added to the next installment when late.

Savings

Server behavior

  • Savings interest is queued and applied on schedule.

  • Interest is skipped when the balance exceeds maximumBalance.

  • UI shows next interest timestamp.

Localization

  • Config.Locale = 'en' (built‑in: en, es, fr, it, de, pt, tr, ar, zh).

  • UI strings are available both in Lua and UI JS (html/js/translation.js).

  • You can translate the front‑end HTML/JS freely; the UI is responsive.


Inventory Items (credit card)

If Config.CreditCardRequiresItem = true, add credit_card:

  • ox_inventory – items.json (example)

    If Config.CreditCardUsesMetadata = true, the server will attach { iban = "<PLAYER_IBAN>" } as item metadata on purchase.

  • qb-inventory – shared/items.lua (example)

The resource registers the usable item automatically (ESX / QB / QBOX / ox_inventory / qs-inventory). No extra code needed.


Troubleshooting & Tips

  • Nothing happens at ATM

    • If CreditCardRequiresItem = true, players must use the card item (not just press E).

    • Ensure Config.EnablePinScreenForATM and a valid PIN if you enforce PIN.

    • Check you’re near a configured ATM position or that auto‑detection is enabled with correct Config.ATMModels.

  • IBAN change fails

    • IBAN must start with Config.IBAN.Prefix and have exactly Config.IBAN.MaxLength characters.

    • Only alphanumeric characters allowed (depends on GenerationMethod).

  • Transfers to offline players

    • Supported. The transaction is posted and balances update in DB. Post‑amount snapshots are recorded for both sides.

  • Loan “test mode”

    • Set Config.Loan.paymentIntervalHours = "test" to make intervals 1 minute for QA.

  • Performance

    • Auto‑detection scans ATM props near players at updateInterval. Adjust maxDetectionRange and interval if needed.

  • Localization

    • Config.Locale selects server messages; UI translations are in html/js/translation.js and can be edited freely.


Last updated