Page cover

βš™οΈConfiguration

Banking Script Configuration Guide

This guide covers the configuration options for the NeedForScripts Banking Script, including ATM models, bank locations, and general settings. It also provides information on available functions and events for integration with other scripts.

Configuration Files

1. atms.lua

This file contains the ATM models to check when using the card item.

return {
    2930269768,
    3168729781,
    506770882,
    3424098598
}

Add or remove model hashes as needed for your server.

2. banks.lua

This file defines bank locations and blip settings.

return {
    blip = {sprite = 207, color = 1}, -- remove this if you want to hide blips
    positions = {
        vec3(150.266, -1040.203, 29.374),
        vec3(-1212.980, -330.841, 37.787),
        vec3(-2962.582, 482.627, 15.703),
        vec3(-112.202, 6469.295, 31.626),
        vec3(314.187, -278.621, 54.170),
        vec3(-351.534, -49.529, 49.042),
        vec3(241.727, 220.706, 106.286),
        vec3(1175.0643310547, 2706.6435546875, 38.094036102295)
    }
}

Modify the positions table to add or remove bank locations. Adjust the blip settings or remove the line to hide bank blips on the map.

3. config.lua

This file contains general settings for the Banking Script.

Adjust these settings to customize the script's behavior:

  • reissueFee: Cost to reissue a bank card

  • atmDistance: Interaction distance for ATMs

  • savingInterest: Interest rate for savings accounts

  • itemName: Name of the bank card item in your inventory system

  • managementJob: Job required to access management features

  • progressBar: Function to display a progress bar (customize as needed)

Server Exports

registerTransaction

πŸ”ΉParameters:

  • iban: string - Account IBAN

  • amount: number

  • note: string

  • type: string - 'deposit' | 'withdraw' | 'receive' | 'send'

  • name: string

addBalance

πŸ”ΉParameters:

  • iban: string - Account IBAN

  • amount: number

  • data: table

    • transaction: boolean - Whether to register transaction

    • note: string - Transaction note (requires transaction to be true)

    • removeCash: boolean - If true, removes cash from player

    • type: string - 'deposit' | 'withdraw' | 'receive' | 'send

removeBalance

πŸ”ΉParameters:

  • iban: string - Account IBAN

  • amount: number

  • data: table

    • transaction: boolean - Whether to register transaction

    • note: string - Transaction note (requires transaction to be true)

    • addCash: boolean - If true, adds cash to player

Get Card Iban

Get Card Balance By IBAN

Get Card by IBAN

πŸ”ΉParameters:

  • main (boolean)

  • balance (number)

  • freeze (boolean)

  • iban (string)

  • day_stats ({income: number, expense: number})

  • quick_transfer_users ({iban: string, user_name: string}[])

  • overview ({day: string, amount: number}[])

  • pin (number)

  • owner (string)

Set Card New PIN

Get Player Cards

Freeze or Unfreeze Card

Client Exports

openBank

Opens the banking interface.

Events

Client Events

  1. Card Action Event

Parameters:

data: {

  • amount: number,

  • iban: string,

  • type: string,

  • note: string,

  • to_iban: string

}

Triggered when a player makes a deposit/withdraw/transfer. data includes transaction details.

  1. Hide Bank Event

Triggered when the player hides the bank interface.

  1. Bank Opened Event

Triggered when the player opens the banking interface.

Server Events

Bank Opened Event

Triggered on the server when a player opens the banking interface.

Bank Card Metadata

  • iban string : unique IBAN for the card

  • firstName string : player first name

  • lastName string : player last name

State Bag

You can check if the bank interface is open using the following state:

This state can be used to prevent other actions while the banking interface is open.

Hooks

registerBankingHook

This function allows developers to add custom logic to banking events.

Parameters:

  • hookType (string): The type of hook (deposit, withdraw, transfer).

  • func (function): Custom function to validate or modify the transaction.

Payload:

  • iban (string): IBAN of the account.

  • amount (number): Transaction amount.

  • note (string): Transaction note.

  • to_iban (string): Recipient's IBAN (for transfers).

  • owner (string): Owner's identifier.

Please do read the commented message regarding the 'return' .

Integration Tips

  1. Use the provided functions and events to integrate banking features into other scripts.

  2. Customize the progress bar function in config.lua to match your server's UI style.

  3. Adjust the managementJob in config.lua to fit your server's job system.

  4. Modify ATM models and bank locations to match your server's map and assets.

Remember to restart your server after making changes to these configuration files.

Last updated