esx-framework / esx_billing Goto Github PK
View Code? Open in Web Editor NEWbilling system for esx-framework
License: GNU General Public License v3.0
billing system for esx-framework
License: GNU General Public License v3.0
Hey there! ๐
I'm trying to bill a player through esx_billing as a server, but the current implementation of the script seems to deny this:
https://github.com/esx-framework/esx_billing/blob/main/server/main.lua
RegisterNetEvent('esx_billing:sendBill', function(playerId, sharedAccountName, label, amount)
local xPlayer = ESX.GetPlayerFromId(source)
local xTarget = ESX.GetPlayerFromId(playerId)
amount = ESX.Math.Round(amount)
if amount > 0 and xTarget then
if string.match(sharedAccountName, "society_") then
local jobName = string.gsub(sharedAccountName, 'society_', '')
if xPlayer.job.name ~= jobName then
print(("[^2ERROR^7] Player ^5%s^7 Attempted to Send bill from a society (^5%s^7), but does not have the correct Job - Possibly Cheats"):format(xPlayer.source, sharedAccountName))
return
end
TriggerEvent('esx_addonaccount:getSharedAccount', sharedAccountName, function(account)
if account then
MySQL.insert('INSERT INTO billing (identifier, sender, target_type, target, label, amount) VALUES (?, ?, ?, ?, ?, ?)', {xTarget.identifier, xPlayer.identifier, 'society', sharedAccountName, label, amount},
function(rowsChanged)
xTarget.showNotification(TranslateCap('received_invoice'))
end)
else
print(("[^2ERROR^7] Player ^5%s^7 Attempted to Send bill from invalid society - ^5%s^7"):format(xPlayer.source, sharedAccountName))
end
end)
else
MySQL.insert('INSERT INTO billing (identifier, sender, target_type, target, label, amount) VALUES (?, ?, ?, ?, ?, ?)', {xTarget.identifier, xPlayer.identifier, 'player', xPlayer.identifier, label, amount},
function(rowsChanged)
xTarget.showNotification(TranslateCap('received_invoice'))
end)
end
end
end)
As we can see here, esx_billing reads the player source of the issuer to bill the player, which is obviously not possible on server-side.
Would be nice if there would be a possibility for that ๐
Would be nice if you haven't paid an invoice in let's says 3 days it would be automatically paid. Players can just receive invoices but never pay them
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.