Skip to content

Commit

Permalink
Merge pull request #585 from bitpredator/dev
Browse files Browse the repository at this point in the history
fix: Fixed the problem that prevented the creation of invoices
  • Loading branch information
bitpredator authored Dec 17, 2023
2 parents abd2a69 + 40e9a65 commit cf4b131
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 17 deletions.
3 changes: 2 additions & 1 deletion .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,5 @@ fix lint error: unused argument last; accessing undefined variable Invoke; unuse
50. [bpt_ballasjob]: refactor: bpt_ballasjob inventory implementation @bitpredator
51. [bpt_ballasjob]: feat: bpt_ballasjob\locales\en.lua @bitpredator
52. [bpt_ammujob]: Fixed the problem that prevented the creation of invoices @bitpredator
53. [bpt_bakerjob]: Fixed the problem that prevented the creation of invoices @bitpredator
53. [bpt_bakerjob]: Fixed the problem that prevented the creation of invoices @bitpredator
54. [bpt_ballasjob]: Fixed the problem that prevented the creation of invoices @bitpredator
25 changes: 13 additions & 12 deletions server-data/resources/[bpt_addons]/bpt_ballasjob/client/main.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local HasAlreadyEnteredMarker
local CurrentAction, CurrentActionMsg, CurrentActionData = nil, '', {}
local CurrentAction, CurrentActionMsg = nil, ''
local LastZone

RegisterNetEvent('esx:playerLoaded')
Expand Down Expand Up @@ -77,20 +77,23 @@ end
function OpenMobileBallasActionsMenu()
local elements = {
{unselectable = true, icon = "fas fa-ballas", title = _U('ballas')},
{icon = "fas fa-scroll", title = _U('billing'), value = "billing"}
{icon = "fas fa-scroll", title = _U('billing'), value = "billing"},
}

ESX.OpenContext("right", elements, function(_,element)
ESX.OpenContext("right", elements, function(_, element)
if element.value == "billing" then
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'billing', {
title = _U('invoice_amount')
}, function(data, menu)

local amount = tonumber(data.value)
local elements2 = {
{unselectable = true, icon = "fas fa-ballas", title = element.title},
{title = _U('amount'), input = true, inputType = "number", inputMin = 1, inputMax = 250000, inputPlaceholder = _U('bill_amount')},
{icon = "fas fa-check-double", title = _U('confirm'), value = "confirm"}
}

ESX.OpenContext("right", elements2, function(menu2)
local amount = tonumber(menu2.eles[2].inputValue)
if amount == nil then
ESX.ShowNotification(_U('amount_invalid'))
else
menu.close()
ESX.CloseContext()
local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
if closestPlayer == -1 or closestDistance > 3.0 then
ESX.ShowNotification(_U('no_players_near'))
Expand All @@ -100,8 +103,6 @@ function OpenMobileBallasActionsMenu()
ESX.ShowNotification(_U('billing_sent'))
end
end
end, function(_, menu)
menu.close()
end)
end
end)
Expand Down Expand Up @@ -152,7 +153,7 @@ CreateThread(function()
if v.Type ~= -1 and distance < Config.DrawDistance then
sleep = 0
if k == "" then
if inVeh then
if k == "" then
DrawMarker(v.Type, v.Pos.x, v.Pos.y, v.Pos.z, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, v.Size.x, v.Size.y,
v.Size.z, v.Color.r, v.Color.g, v.Color.b, 100, false, false, 2, v.Rotate, nil, nil, false)
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Config = {}
Config.DrawDistance = 10.0 -- How close do you need to be for the markers to be drawn (in GTA units).
Config.EnablePlayerManagement = true -- Enable society managing.
Config.Locale = 'it'
Config.Locale = 'en'
Config.OxInventory = ESX.GetConfig().OxInventory

Config.Zones = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,9 @@ Locales['en'] = {
['deposit_stock'] = 'deposit stock',
['take_stock'] = 'take stock',
['have_deposited'] = 'have deposited',
['quantity_invalid'] = 'quantity invalid'
['quantity_invalid'] = 'quantity invalid',
-- billing
['bill_amount'] = "Amount to bill..",
['confirm'] = "Confirm",
['amount'] = 'amount'
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,9 @@ Locales['it'] = {
['deposit_stock'] = 'Depositare',
['take_stock'] = 'Prendi',
['have_deposited'] = 'Hai depositato',
['quantity_invalid'] = 'Qunatità non valida'
}
['quantity_invalid'] = 'Qunatità non valida',
-- billing
['bill_amount'] = "importo della fattura",
['confirm'] = "Conferma",
['amount'] = "Importo"
}

0 comments on commit cf4b131

Please sign in to comment.