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:
stringExisting player identifier
score:
numberScore 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:
stringIban account to add transaction
type:
stringType of transaction, can be income / outcome
amount:
numberAmount to display in history
title:
stringTitle of transaction
from:
stringName of transaction sender
to:
stringName of transaction receiver
Return:
transactions:
tableAll 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:
tableid:
numbername:
stringowner:
stringiban:
stringbalance:
numberrole:
owner / usertype:
personal / society / sharedcredit_score:
numberlogs:
tabletransactions:
tableinvoices:
tableusers:
tablecards:
table
addAccountMoney
Use following export to add money to account
local identifier = '1234567890'
local amount = 1000
local result = exports['p_banking']:addAccountMoney(identifier, amount)identifier:
stringIBAN of existing account / Job Name / Player Identifier
amount:
numberAmount to add into account balance
Return:
result:
booleanreturn
trueorfalseif action finished succesfully or not
removeAccountMoney
Use following export to remove money from account
local identifier = '1234567890'
local amount = 1000
local result = exports['p_banking']:removeAccountMoney(identifier, amount)identifier:
stringIBAN of existing account / Job Name / Player Identifier
amount:
numberAmount to remove from account balance
Return:
result:
booleanreturn
trueorfalseif action finished succesfully or not
getAccountMoney
Use following export to get account money
local identifier = '1234567890'
local money = exports['p_banking']:getAccountMoney(identifier)identifier:
stringIBAN of existing account / Job Name / Player Identifier
Return:
money:
numberAccount 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:
stringIBAN which will receive invoice
fromIban:
stringIBAN which will receive money from invoice
fromName:
stringDisplayed name in invoices section
amount:
numberInvoice amount
title:
stringTitle of invoice
Return:
result:
boolean
Last updated