Server Exports
REMEMBER ABOUT CLIENT SIDE AND SERVER SIDE IN CHOOSING EXPORT!
Generate Unique IBAN
Use following export to generate unique IBAN number
local newIBAN = exports['p_banking']:generateUniqueIBAN()
print(newIBAN)
Return:
newIBAN:
string
Generate Unique Card Number
Use following export to generate unique Card Number
local cardNumber = exports['p_banking']:generateUniqueCardNumber()
print(cardNumber)
Return:
cardNumber:
string
Update Credit Score
Use following export to update credit score for player
local identifier = 'char1:123456' -- replace with existing player identifier
local score = 100 -- amount to add/remove, you can use negative value
exports['p_banking']:updateCreditScore(identifier, score)
identifier:
string
Existing player identifier
score:
number
Score to add or remove
Create History
Use following export to create transaction history for account
local data = {
iban = '1234567890', -- replace with existing account iban
type = 'income', -- income / outcome
amount = 100,
title = 'Withdraw',
from = 'SYSTEM',
to = 'John Doe'
}
exports['p_banking']:createHistory(data)
iban:
string
Iban account to add transaction
type:
string
Type of transaction, can be income / outcome
amount:
number
Amount to display in history
title:
string
Title of transaction
from:
string
Name of transaction sender
to:
string
Name of transaction receiver
Return:
transactions:
table
All account transactions
Get Player Accounts
Use following export to get player accounts
local playerId = 1 -- replace with existing player id
local accounts = exports['p_banking']:getPlayerAccounts(playerId)
print(json.encode(accounts, {indent=true}))
Return:
accounts:
table
id:
number
name:
string
owner:
string
iban:
string
balance:
number
role:
owner / user
type:
personal / society / shared
credit_score:
number
logs:
table
transactions:
table
invoices:
table
users:
table
cards:
table
addAccountMoney
Use following export to add money to account
local iban = '1234567890'
local amount = 1000
local result = exports['p_banking']:addAccountMoney(iban, amount)
iban:
string
IBAN of existing account
amount:
number
Amount to add into account balance
Return:
result:
boolean
return
true
orfalse
if action finished succesfully or not
removeAccountMoney
Use following export to remove money from account
local iban = '1234567890'
local amount = 1000
local result = exports['p_banking']:removeAccountMoney(iban, amount)
iban:
string
IBAN of existing account
amount:
number
Amount to remove from account balance
Return:
result:
boolean
return
true
orfalse
if action finished succesfully or not
getAccountMoney
Use following export to get account money
local iban = '1234567890'
local money = exports['p_banking']:getAccountMoney(iban)
iban:
string
IBAN of existing account
Return:
money:
number
Account Balance
createInvoice
Use following export to create invoice
local toIban = '123456789'
local fromIban = '987654321'
local fromName = 'pScripts'
local amount = 1000
local title = 'Invoice'
local result = exports['p_banking']:createInvoice(toIban, fromIban, fromName, amount, title)
toIban:
string
IBAN which will receive invoice
fromIban:
string
IBAN which will receive money from invoice
fromName:
string
Displayed name in invoices section
amount:
number
Invoice amount
title:
string
Title of invoice
Return:
result:
boolean
Last updated