local bank_number = exports["sfbanking"]:getNumberBankFromSource(source)print(bank_number) -- return false if player is offline or number if player is online
local identifier ='char1:4cf32ff23f23f23f32f23f32f32' -- example idlocal bank_number = exports["sfbanking"]:getNumberBankFromId(identifier)print(bank_number) -- return false if account not found or number
Get the amount as available in your bank account:
local bank_number = exports["sfbanking"]:getNumberBankFromSource(source)local bank_amount = exports["sfbanking"]:getAmountBankFromNumber(bank_number)print(bank_amount) -- return false if account not found or amount
Top up your bank account with the specified amount(type: transfer from account SYSTEM):
local bank_number =12345-- examplelocal amount =100-- only number > 0, must be INT! NOT FLOAT!local reason ="salary" -- can be nillocal type_log =1-- 1 - transfer, 2 - deposit/withdrawal, 3 - invoice payment, can be nillocal src = source -- not required, needed for logslocal result = exports["sfbanking"]:addMoneyForPlayer(bank_number, amount, reason, type_log, src)print(result) -- return false if account not found/amount is bad or true if the transfer was successful
Take cash from your bank account with the specified amount(type: transfer to account SYSTEM):
local bank_number =12345-- examplelocal amount =100-- only number > 0, must be INT! NOT FLOAT!local reason ="fine" -- can be nillocal type_log =1-- 1 - transfer, 2 - deposit/withdrawal, 3 - invoice payment, can be nillocal src = source -- not required, needed for logslocal result = exports["sfbanking"]:removeMoneyForPlayer(bank_number, amount, reason, type_log, src)print(result) -- return false if account not found/amount is bad or true if the transfer was successful
Make a transfer from bank account to account:
local from_bank_number =12345-- examplelocal to_bank_number =12345-- examplelocal amount =100-- only number > 0, must be INT! NOT FLOAT!local reason ="credit" -- can be nillocal src = source -- not required, needed for logslocal result = exports["sfbanking"]:transferMoneyFromAccountToAccount(from_bank_number, to_bank_number, amount, reason, src)print(result) -- return false if account not found/amount is bad or true if the transfer was successful
Creating a bank account for a player or anything:
local src = sourcelocal type_data ="player" -- options: "player" - for creating a player account , "SomeString" - for creating accounts for jobs or organizations, whatever you come up with. This is a prefix. local data =1-- example: id job or id organization :) cannot be nil when typedata is different than "player"local result = exports["sfbanking"]:registerAccount(src, type_data, data)print(result) -- return false if account not created or true if the account was created
Bank logs:
local bank_number =23241-- examplelocal result = exports["sfbanking"]:getBankLogs(bank_number)print(result) -- return table with data
Lua code examples for Server Side for CRYPTO
Get your crypto account number:
local crypto_number = exports["sfbanking"]:getNumberCryptoFromSource(source)print(crypto_number) -- return false if player is offline or number if player is online
local identifier ='char1:4cf32ff23f23f23f32f23f32f32' -- example idlocal crypto_number = exports["sfbanking"]:getNumberCryptoFromId(identifier)print(crypto_number) -- return false if account not found or number
Get the amount as available in your crypto account:
local crypto_number = exports["sfbanking"]:getNumberCryptoFromSource(source)local currency ="OCASH" -- can be nil(return table with all currency) local currency_amount = exports["sfbanking"]:getAmountCryptoFromNumber(crypto_number, currency)print(currency_amount) -- return false if account not found or amount/table
Top up your crypto account with the specified amount and currency(type: transfer from account SYSTEM):
local crypto_number =12345-- examplelocal currency ="OCASH" -- examplelocal amount =5.5-- only number > 0, must be INT or FLOATlocal src = source -- not required, needed for logslocal result = exports["sfbanking"]:addCryptoForPlayer(crypto_number, currency, amount, src)print(result) -- return false if account not found/amount is bad or true if the transfer was successful
Take crypto from your crypto account with the specified amount and currency(type: transfer to account SYSTEM):
local crypto_number =12345-- examplelocal currency ="OCASH" -- examplelocal amount =5.5-- only number > 0, must be INT or FLOATlocal src = source -- not required, needed for logslocal result = exports["sfbanking"]:removeCryptoForPlayer(crypto_number, currency, amount, src)print(result) -- return false if account not found/amount is bad/lack of account funds or true if the transfer was successful
Make a transfer from crypto account to account:
local from_crypto_number =12345-- examplelocal to_crypto_number =23456-- examplelocal currency ="OCASH" -- examplelocal amount =100-- only number > 0, must be INT or FLOATlocal src = source -- not required, needed for logslocal result = exports["sfbanking"]:transferCryptoFromAccountToAccount(from_crypto_number, to_crypto_number, currency, amount, src)print(result) -- return false if account not found/amount is bad or true if the transfer was successful
Crypto logs:
local crypto_number =23241-- examplelocal result = exports["sfbanking"]:getCryptoLogs(crypto_number)print(result) -- return table with data
Lua code examples for Server Side - PERMISSIONS
Granting permissions to use other bank accounts/crypto wallet:
local bank_number =12345-- Bank account number, just enter your account number or crypto wallet numberlocal crypto_number =0-- wallet number, just enter crypto wallet number or your account numberlocal playerId ="char1:3213213" -- player idlocal permission_bank =1-- if 1 will receive permission, if 0 then he will not have itlocal permission_crypto =0-- if 1 will receive permission, if 0 then he will not have itlocal result = exports["sfbanking"]:addPermission(bank_number, crypto_number, playerId, permission_bank, permission_crypto)print(result) -- return true or false
Removing privileges to use other bank accounts/crypto wallet:
local bank_number =12345-- Bank account numberlocal crypto_number =0-- wallet numberlocal playerId ="char1:3213213" -- player idlocal result = exports["sfbanking"]:removePermission(bank_number, crypto_number, playerId)print(result) -- return true or false
Downloading a table with data about which accounts the player has access to:
local playerId ="char1:3213213" -- player idlocal type ="bank" -- "bank" or "crypto"local result = exports["sfbanking"]:getPermissionData(playerId, type)print(result) -- return table