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.
---@param iban string
---@param newpin number
---@return boolean
local success = exports['nfs-banking']:setCardNewPin(iban, newpin)
local cards = exports['nfs-banking']:getPlayerCards(source)
exports['nfs-banking']:freezeCard(iban, true)
-- Example :
local iban = exports['nfs-banking']:getPlayerMainCardIban(source)
if iban then
if exports['nfs-banking']:freezeCard(iban, true) then
print("β Card frozen!")
end
if exports['nfs-banking']:freezeCard(iban, false) then
print("β Card unfrozen!")
end
end
exports['nfs-banking']:openBank("bank")
RegisterNetEvent('nfs-banking:client:cardAction', function(data)
-- Your code here
end)
AddEventHandler('n4s_banking:hideBank', function()
-- Your code here
end)
AddEventHandler('nfs-banking:client:bankOpened', function()
-- Your code here
end)
RegisterNetEvent('nfs-banking:server:bankOpened', function()
-- Your code here
end)
local isBankOpen = LocalPlayer.state.bankOpen
exports['nfs-banking']:registerBankingHook('deposit', function(source, data)
local playerCid = Framework.core.GetPlayer(source).id
if playerCid ~= data.owner then
return 'You are not allowed to deposit into this account.'
end
return true
end)
-- return: string | boolean | nil
-- only true will valid the transaction, while string will be the error text