#License violation
1 messages · Page 1 of 1 (latest)
/invoice command is there. you can use it to send it to an account and a citizenid (it checks if person is member of that account). then he can pay that at bank or if it's sent to his default account then I will add pay using same menu...for now menu only shows unpaid invoices
Also player can send from accounts in which he has sendInvoice permission
thank you
awesome are you creating the ui and funcionalities on the basis of ox_banking 😲
This is ox_banking. just re-write (in lua as i am not good with ts) to work with qbox
why not take renewed and use ox_bankings ui?
Umm... I didn't thought about that because i was looking for a banking script for new server. Pefcl is no longer maintained, and renewed banking lacks invoice system....
I can create a migrate command which will create a default user account for existing users and then transfer balance from old accounts to new one.
Ox banking is a resource that will continue to be supported for a long time, it's great that you rewrite it and make it open source.

you could technically use Renewed-Banking and add the invoice thing or add a bridge for renewed
also im messing with this rn but how would i do things like addAccountMoney or getAccount Money ETC
for integration with third party resources
Hello everyone, this guy's idea is really impressive... I'm trying to install it but I really don't know how to create my own interactive interface with Ox Banking. Will this resource be available for use on any qbx server?
In future, yes.
https://github.com/Risky-Shot/ox_banking/wiki/Exports#get-character-default-account
Utilise this export to fetch character default account and if account available then use functions from here https://github.com/Risky-Shot/ox_banking/wiki/Account-Object
local account = exports.ox_banking:GetCharacterAccount(citizenid)
if not account then return end
-- available balance
local balance = account:getMeta('balance')
-- add balance
account:addBalance(1000, 'State Welfare')
I just saw i have used dot(.) instead of : in wiki. Will fix that
ij thanks what about society same way just add the job?
Society u mean to say jobs and gangs ?
yeah
You need yo do some additional steps for that mentioned in installation part.
- Add
hasAccount = truefor job/gang which you want a default account - Inside grades, add
bankAuth = 'role name'role can be viewer, contributor, manager
Then user will be added automatically to bank and roles will be updated as per grade and job
ok i got that
what about for something like this ```lua
local function pay(player)
local job = player.PlayerData.job
local payment = GetJob(job.name).grades[job.grade.level].payment or job.payment
if payment <= 0 then return end
if not GetJob(job.name).offDutyPay and not job.onduty then return end
if not config.money.paycheckSociety then
config.sendPaycheck(player, payment)
return
end
local account = exports.ox_banking:GetGroupAccount(job.name)
if not account.getMeta(job.name) then -- Checks if player is employed by a society
config.sendPaycheck(player, payment)
return
end
if account < payment then -- Checks if company has enough money to pay society
Notify(player.PlayerData.source, locale('error.company_too_poor'), 'error')
return
end
config.removeSocietyMoney(job.name, payment)
config.sendPaycheck(player, payment)
end
Will see once available on pc. Probably in an hour
ok now worries
04:19:01 AM [ script:ox_banking] SelectDefaultAccountId | lspd | {"id":2411045972.0}
04:19:01 AM [ script:qbx_core] SCRIPT ERROR: @qbx_core/server/loops.lua:44: attempt to call a nil value (method 'getMeta')
04:19:01 AM [ script:qbx_core] > pay (@qbx_core/server/loops.lua:44)
04:19:01 AM [ script:qbx_core] > fn (@qbx_core/server/loops.lua:62)
04:19:01 AM [ script:qbx_core] > rawQuery (@oxmysql/dist/build.js:26045)
04:19:01 AM [ script:qbx_core] > processTicksAndRejections (node:internal/process/task_queues:96)
local function pay(player)
local job = player.PlayerData.job
local payment = GetJob(job.name).grades[job.grade.level].payment or job.payment
if payment <= 0 then return end
if not GetJob(job.name).offDutyPay and not job.onduty then return end
if not config.money.paycheckSociety then
config.sendPaycheck(player, payment)
return
end
local societyAccount = exports.ox_banking:GetGroupAccount(job.name)
if not societyAccount then -- Not a society job
config.sendPaycheck(player, payment)
return
end
local balance = societyAccount:getMeta('balance')
if balance < payment then
Notify(player.PlayerData.source, locale('error.company_too_poor'), 'error')
return
end
local result = societyAccount:removeBalance(payment, 'Paycheck Payment')
if result.success then
config.sendPaycheck(player, payment)
end
end
``` What am i doing wrong?
got that lets go
i had to make two exports in the banking a GetAccountMoney and RemoveAccountMoney as i couldnt figure out the proper way
yeah!!!... just came to know methods aren't working outside ox_banking....
Am not good with class part in fivem/lua so can't figure out. maybe someone experienced can address this.
meanwhile I am adding exports for all actions which can be performed with account
Just pushed exports to repo. Can be found in : server/core/index.lua
Nice job! Are you planing to keep updating it with you're features and the main one coming from the original repo?
The interface does not open for me, gentlemen. It's not developed yet, right?
Hope you have build the UI and followed installation steps.
I will try my best to keep it updated upto my knowledge.
I have followed the entire installation, even added the ranks to use the player managed society, but I don't have the knowledge to make the interface (UI) sir.
Can't you keep the original UI of Ox Banking, sir?
https://github.com/Risky-Shot/ox_banking/blob/main/README.md#build
here's a guide you can follow to build the UI
Contribute to Risky-Shot/ox_banking development by creating an account on GitHub.
i remember getting this error earlier.....
is there any error in serve console ?
19:54:53 [ script:ox_banking] SCRIPT ERROR: @ox_banking/server/qbox.lua:88:
19:54:53 [ script:ox_banking] An error occurred while calling export `CreateAccount` in resource `ox_banking`:
19:54:53 [ script:ox_banking] citizen:/scripting/lua/scheduler.lua:749: SCRIPT ERROR: @ox_banking/server/core/db.lua:205:
19:54:53 [ script:ox_banking] An error occurred while calling export `GetOfflinePlayer` in resource `qbx_core`:
19:54:53 [ script:ox_banking] citizen:/scripting/lua/scheduler.lua:749: SCRIPT ERROR: @qbx_core/server/storage/players.lua:115: attempt to index a nil value (local 'player')
19:54:53 [ script:ox_banking] > fetchPlayerEntity (@qbx_core/server/storage/players.lua:115)
19:54:53 [ script:ox_banking] > ref (@qbx_core/server/player.lua:57)
19:54:53 [ script:ox_banking] > rawQuery (@oxmysql/dist/build.js:27077)
19:54:53 [ script:ox_banking] > processTicksAndRejections (node:internal/process/task_queues:96)
19:54:53 [ script:ox_banking]
19:54:53 [ script:ox_banking] ---
19:54:53 [ script:ox_banking] > CreateNewAccount (@ox_banking/server/core/db.lua:205)
19:54:53 [ script:ox_banking] > ref (@ox_banking/server/core/index.lua:20)
19:54:53 [ script:ox_banking] > rawQuery (@oxmysql/dist/build.js:27077)
19:54:53 [ script:ox_banking] > processTicksAndRejections (node:internal/process/task_queues:96)
19:54:53 [ script:ox_banking]
19:54:53 [ script:ox_banking] ---
19:54:53 [ script:ox_banking] > fn (@ox_banking/server/qbox.lua:88)
19:54:53 [ script:ox_banking] > rawQuery (@oxmysql/dist/build.js:27077)
19:54:53 [ script:ox_banking] > processTicksAndRejections (node:internal/process/task_queues:96)
did i miss something in the installation?
i did all the steps
can you confirm if you are on latest qbox_core ? I remember this is issue with https://github.com/Qbox-project/qbx_core/blob/efd9c6ab6a3e621de2d6047a5ed2c4ebf0cb31e8/server/storage/players.lua#L150 this part....which recently got fixed
especially this commit https://github.com/Qbox-project/qbx_core/commit/d029fab8d31a0269ea9905a522c4ee3fa1029258
I get this error in my server console[ script:oxmysql] Error: grp-banking was unable to complete a transaction! [ script:oxmysql] INSERT INTO ox_group_grades (`group`, `grade`, `label`, `accountRole`) [ script:oxmysql] VALUES ('cardealer', '4', 'Manager', true) [ script:oxmysql] ON DUPLICATE KEY UPDATE [ script:oxmysql] `group` = VALUES(`group`), [ script:oxmysql] `grade` = VALUES(`grade`), [ script:oxmysql] `label` = VALUES(`label`), [ script:oxmysql] `accountRole` = VALUES(`accountRole`) [ script:oxmysql] [ script:oxmysql] Cannot add or update a child row: a foreign key constraint fails (`s59362_qbox123`.`ox_group_grades`, CONSTRAINT `FK_ox_group_grades_account_roles` FOREIGN KEY (`accountRole`) REFERENCES `account_roles` (`name`) ON DELETE CASCADE ON UPDATE CASCADE)
sorry i renamed the script haha
you missed 1 part related to grades and permission setup...
You have to change bankAuth = 'rolename' inside shared data
valid role names are these : 'viewer' | 'contributor' | 'manager' | 'owner'
oh i didnt put it inside the ' '
yeah that fixed the issue but i have a new issue with the addBalance
SCRIPT ERROR: @multichar/server/main.lua:163: attempt to call a nil value (method 'addBalance')
callbackResponse (@ox_lib/imports/callback/server.lua:79)
handler (@ox_lib/imports/callback/server.lua:96)
rawQuery (@oxmysql/dist/build.js:27077)
processTicksAndRejections (node:internal/process/task_queues:96)
I have this issue now:
[ script:ox-banking] > rawQuery (@oxmysql/dist/build.js:26045)
[ script:ox-banking] > processTicksAndRejections (node:internal/process/task_queues:96)```
lib.callback.register('qbx_core:server:createCharacter', function(source, data)
local newData = {}
newData.charinfo = data
local success = Login(source, nil, newData)
if not success then return end
giveStarterItems(source)
if GetResourceState('qbx_spawn') == 'missing' then
SetPlayerBucket(source, 0)
end
local player = exports.qbx_core:GetPlayer(source)
if not player then return end
local citizenid = player.PlayerData.citizenid
local newAccount = exports.ox_banking:CreateAccount(citizenid, "Personal", true)
if not newAccount then
lib.print.info('Failed to Create Bank Account. Please contact staff to fix this issue.')
return
end
local account = exports.ox_banking:GetCharacterAccount(citizenid).accountId
exports.ox_banking:AddBalance(account, config.money.moneyTypes.bank, "State Welfare")
lib.print.info(('%s has created a character'):format(GetPlayerName(source)))
return newData
end)```
i managed to get the starting money to work
Is this complete error ? Please share if there's more
Try above sent code snippet
This ^
this is the entire issue
exports.ox_banking: remove this from qbox.lua line 88
Should just be function call
only iusse ive found so far is when paychecks are coming in the dashboards income and expenses goes up not just income idk if thats how its suppose to be or not
so far
ok...will see that
sendPaycheck = function (player, payment)
local account = exports.ox_banking:GetCharacterAccount(player.PlayerData.citizenid).accountId
exports.ox_banking:AddBalance(account, payment, 'Paycheck')
Notify(player.PlayerData.source, locale('info.received_paycheck', payment))
end,```
also this is what ive done for paychecks
idk if i shouldve added some checks or sum but as is it works good
i experinced this issue when i didnt make a fresh character when i first installed or if i didnt even have an account with the bank
found the issue. will push an update for same in few mins
also will make a migrate command to create account for all existing players and transfer amount from renewed banking table
quick question, shouldn't this table inside players be connected to the default personal account?
this will make a lot of scripts compatible from the start with ox_banking
or it is already? i didn't check the script fully yet
function self.Functions.GetMoney(moneytype)
if not moneytype then return false end
if moneytype == "bank" then
local account = exports.ox_banking:GetCharacterAccount(self.PlayerData.citizenid)
if account then
return exports.ox_banking:GetMetadata(account.accountId, 'balance')
end
end
return self.PlayerData.money[moneytype]
end
then for removemoney/setmoney/addmoney i added similiar checks
like this
if moneytype == "bank" then
local account = exports.ox_banking:GetCharacterAccount(self.PlayerData.citizenid)
if account then
local accountID = account.accountId
print('Money Removed from Bank' .. amount .. ' for ' .. self.PlayerData.citizenid .. ' with accountID: ' .. accountID)
exports.ox_banking:RemoveBalance(accountID, amount, "US Government")
end
end
for setmoney i just remove currentbalance then add the new value, if you have a better approach for this, tell me ^^
line 88 is exports.ox_banking:CreateAccount(groupName, groupData.label, true)
Yeah, just keep it as
CreateAccount(groupName, groupData.label, true)
alright i will try that
i get this when trying to press E at an atm or inside a bank
Yes...this is a good solution. But I was looking for a way to not modify the core as far as possible
Yeah i understand, i already heavily modified it for my needs so one new change doesnt bother me
please share client/client.lua once... shouldn't be showing an error in latest versions or if you got a fork then share that
a 'rewrite' of ox_banking to qbox should not be done this way, it is horrible and will become outdated quickly.
If someone actually wants to make a half decent qbox compatable ox_banking. A good start would actually be forking it (so users aren't stuck with a out of date ox_banking) and not rewriting it into lua (pointless to do and will require more work in the future as ox_banking gets expanded)
Also this violates the original licensing of ox_banking.