We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 👋
The text was updated successfully, but these errors were encountered:
@TwitchBluelow Hi! #19 Merged this solution, i hope solved your problem. Thanks @Z3rio
Sorry, something went wrong.
No branches or pull requests
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
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 👋
The text was updated successfully, but these errors were encountered: