mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-04 16:23:21 +00:00
Fixed negative bills
This commit is contained in:
@@ -12,6 +12,7 @@ server_scripts {
|
|||||||
'locales/en.lua',
|
'locales/en.lua',
|
||||||
'locales/fr.lua',
|
'locales/fr.lua',
|
||||||
'locales/es.lua',
|
'locales/es.lua',
|
||||||
|
'locales/sv.lua',
|
||||||
'config.lua',
|
'config.lua',
|
||||||
'server/main.lua'
|
'server/main.lua'
|
||||||
}
|
}
|
||||||
@@ -23,6 +24,7 @@ client_scripts {
|
|||||||
'locales/en.lua',
|
'locales/en.lua',
|
||||||
'locales/fr.lua',
|
'locales/fr.lua',
|
||||||
'locales/es.lua',
|
'locales/es.lua',
|
||||||
|
'locales/sv.lua',
|
||||||
'config.lua',
|
'config.lua',
|
||||||
'client/main.lua'
|
'client/main.lua'
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-4
@@ -63,13 +63,10 @@ end
|
|||||||
-- Key controls
|
-- Key controls
|
||||||
Citizen.CreateThread(function()
|
Citizen.CreateThread(function()
|
||||||
while true do
|
while true do
|
||||||
|
Citizen.Wait(25)
|
||||||
Wait(0)
|
|
||||||
|
|
||||||
if IsControlPressed(0, Keys["F7"]) and not ESX.UI.Menu.IsOpen('default', GetCurrentResourceName(), 'billing') and (GetGameTimer() - GUI.Time) > 150 then
|
if IsControlPressed(0, Keys["F7"]) and not ESX.UI.Menu.IsOpen('default', GetCurrentResourceName(), 'billing') and (GetGameTimer() - GUI.Time) > 150 then
|
||||||
ShowBillsMenu()
|
ShowBillsMenu()
|
||||||
GUI.Time = GetGameTimer()
|
GUI.Time = GetGameTimer()
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|||||||
+1
-1
@@ -1,2 +1,2 @@
|
|||||||
Config = {}
|
Config = {}
|
||||||
Config.Locale = 'en'
|
Config.Locale = 'sv'
|
||||||
|
|||||||
+2
-2
@@ -1,9 +1,9 @@
|
|||||||
Locales['en'] = {
|
Locales['en'] = {
|
||||||
|
|
||||||
['invoices'] = 'invoices',
|
['invoices'] = 'invoices',
|
||||||
['received_invoice'] = 'you ~r~received~s~ an invoice',
|
['received_invoice'] = 'you have just ~r~received~s~ an invoice',
|
||||||
['paid_invoice'] = 'you ~g~paid~s~ an invoice of ~r~$',
|
['paid_invoice'] = 'you ~g~paid~s~ an invoice of ~r~$',
|
||||||
['received_payment'] = 'you ~g~received~s~ a payment of ~r~$',
|
['received_payment'] = 'you ~g~received~s~ a payment of ~r~$',
|
||||||
['player_not_logged'] = 'the player is not logged in',
|
['player_not_logged'] = 'the player is not logged in',
|
||||||
|
['no_money'] = 'you do not have enough money to pay this bill',
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
Locales['sv'] = {
|
||||||
|
['invoices'] = 'räkningar',
|
||||||
|
['received_invoice'] = 'du har ~r~mottagit~s~ en räkning',
|
||||||
|
['paid_invoice'] = 'du ~g~betalade~s~ precis en räkning på ~g~$',
|
||||||
|
['received_payment'] = 'u har ~g~mottagit~s~ en räkning på ~g~$',
|
||||||
|
['player_not_logged'] = 'spelaren är inte online',
|
||||||
|
['no_money'] = 'du har inte råd för att betala räkningen',
|
||||||
|
}
|
||||||
+4
-9
@@ -163,30 +163,25 @@ ESX.RegisterServerCallback('esx_billing:payBill', function(source, cb, id)
|
|||||||
end
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
TriggerEvent('esx_addonaccount:getSharedAccount', target, function(account)
|
TriggerEvent('esx_addonaccount:getSharedAccount', target, function(account)
|
||||||
|
if xPlayer.get('money') >= amount then
|
||||||
MySQL.Async.execute(
|
MySQL.Async.execute(
|
||||||
'DELETE from billing WHERE id = @id',
|
'DELETE from billing WHERE id = @id',
|
||||||
{
|
{
|
||||||
['@id'] = id
|
['@id'] = id
|
||||||
},
|
},
|
||||||
function(rowsChanged)
|
function(rowsChanged)
|
||||||
|
|
||||||
xPlayer.removeMoney(amount)
|
xPlayer.removeMoney(amount)
|
||||||
account.addMoney(amount)
|
account.addMoney(amount)
|
||||||
|
|
||||||
TriggerClientEvent('esx:showNotification', xPlayer.source, _U('paid_invoice') .. amount)
|
TriggerClientEvent('esx:showNotification', xPlayer.source, _U('paid_invoice') .. amount)
|
||||||
|
|
||||||
if foundPlayer ~= nil then
|
if foundPlayer ~= nil then
|
||||||
TriggerClientEvent('esx:showNotification', foundPlayer.source, _U('received_payment') .. amount)
|
TriggerClientEvent('esx:showNotification', foundPlayer.source, _U('received_payment') .. amount)
|
||||||
end
|
end
|
||||||
|
|
||||||
cb()
|
cb()
|
||||||
|
end)
|
||||||
|
else
|
||||||
|
TriggerClientEvent('esx:showNotification', xPlayer.source, _U('no_money'))
|
||||||
end
|
end
|
||||||
)
|
|
||||||
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user