diff --git a/server-data/resources/[esx_addons]/esx_billing/client/main.lua b/server-data/resources/[esx_addons]/esx_billing/client/main.lua index fb35f6625..fbe03be5f 100644 --- a/server-data/resources/[esx_addons]/esx_billing/client/main.lua +++ b/server-data/resources/[esx_addons]/esx_billing/client/main.lua @@ -1,38 +1,42 @@ local isDead = false function ShowBillsMenu() - ESX.TriggerServerCallback('esx_billing:getBills', function(bills) - if #bills > 0 then - local elements = { - {unselectable = true, icon = "fas fa-scroll", title = _U('invoices')} - } + ESX.TriggerServerCallback("esx_billing:getBills", function(bills) + if #bills > 0 then + local elements = { + { unselectable = true, icon = "fas fa-scroll", title = _U("invoices") }, + } - for _,v in ipairs(bills) do - elements[#elements+1] = { - icon = "fas fa-scroll", - title = ('%s - %s'):format(v.label, _U('invoices_item', ESX.Math.GroupDigits(v.amount))), - billId = v.id - } - end + for _, v in ipairs(bills) do + elements[#elements + 1] = { + icon = "fas fa-scroll", + title = ('%s - %s'):format(v.label, _U("invoices_item", ESX.Math.GroupDigits(v.amount))), + billId = v.id, + } + end - ESX.OpenContext("right", elements, function(_,element) - ESX.TriggerServerCallback('esx_billing:payBill', function() - ShowBillsMenu() - end, element.billId) - end) - else - ESX.ShowNotification(_U('no_invoices')) - end - end) + ESX.OpenContext("right", elements, function(_, element) + ESX.TriggerServerCallback("esx_billing:payBill", function() + ShowBillsMenu() + end, element.billId) + end) + else + ESX.ShowNotification(_U("no_invoices")) + end + end) end -RegisterCommand('showbills', function() - if not isDead then - ShowBillsMenu() - end +RegisterCommand("showbills", function() + if not isDead then + ShowBillsMenu() + end end, false) -RegisterKeyMapping('showbills', _U('keymap_showbills'), 'keyboard', 'F7') +RegisterKeyMapping("showbills", _U("keymap_showbills"), "keyboard", "F7") -AddEventHandler('esx:onPlayerDeath', function() isDead = true end) -AddEventHandler('esx:onPlayerSpawn', function() isDead = false end) +AddEventHandler("esx:onPlayerDeath", function() + isDead = true +end) +AddEventHandler("esx:onPlayerSpawn", function() + isDead = false +end) diff --git a/server-data/resources/[esx_addons]/esx_billing/config.lua b/server-data/resources/[esx_addons]/esx_billing/config.lua index f6c6c4d99..87e230574 100644 --- a/server-data/resources/[esx_addons]/esx_billing/config.lua +++ b/server-data/resources/[esx_addons]/esx_billing/config.lua @@ -1,2 +1,2 @@ Config = {} -Config.Locale = GetConvar('esx:locale', 'en') +Config.Locale = GetConvar("esx:locale", "en") diff --git a/server-data/resources/[esx_addons]/esx_billing/fxmanifest.lua b/server-data/resources/[esx_addons]/esx_billing/fxmanifest.lua index 7cb2a9afd..392d876d4 100644 --- a/server-data/resources/[esx_addons]/esx_billing/fxmanifest.lua +++ b/server-data/resources/[esx_addons]/esx_billing/fxmanifest.lua @@ -1,26 +1,26 @@ -fx_version 'adamant' +fx_version("adamant") -game 'gta5' +game("gta5") -description 'ESX Billing' -lua54 'yes' -version '0.0.4' +description("ESX Billing") +lua54("yes") +version("1.0.0") -shared_script '@es_extended/imports.lua' +shared_script("@es_extended/imports.lua") -server_scripts { - '@oxmysql/lib/MySQL.lua', - '@es_extended/locale.lua', - 'locales/*.lua', - 'config.lua', - 'server/main.lua' -} +server_scripts({ + "@oxmysql/lib/MySQL.lua", + "@es_extended/locale.lua", + "locales/*.lua", + "config.lua", + "server/main.lua", +}) -client_scripts { - '@es_extended/locale.lua', - 'locales/*.lua', - 'config.lua', - 'client/main.lua' -} +client_scripts({ + "@es_extended/locale.lua", + "locales/*.lua", + "config.lua", + "client/main.lua", +}) -dependency 'es_extended' +dependency("es_extended") diff --git a/server-data/resources/[esx_addons]/esx_billing/locales/br.lua b/server-data/resources/[esx_addons]/esx_billing/locales/br.lua index bf5aef627..09c61d70a 100644 --- a/server-data/resources/[esx_addons]/esx_billing/locales/br.lua +++ b/server-data/resources/[esx_addons]/esx_billing/locales/br.lua @@ -1,10 +1,10 @@ -Locales['br'] = { - ['invoices'] = 'faturas', - ['invoices_item'] = '$%s', - ['received_invoice'] = 'você ~r~recebeu~s~ uma fatura', - ['paid_invoice'] = 'você ~g~pagou~s~ uma fatura de ~r~$%s~s~', - ['received_payment'] = 'você ~g~recebeu~s~ um pagamento de ~r~$%s~s~', - ['player_not_online'] = 'o jogador não está logado', - ['no_money'] = 'you do not have enough money to pay this bill', - ['target_no_money'] = 'the player ~r~does not~s~ have enough money to pay the bill!', -} \ No newline at end of file +Locales["br"] = { + ["invoices"] = "faturas", + ["invoices_item"] = "$%s", + ["received_invoice"] = "você ~r~recebeu~s~ uma fatura", + ["paid_invoice"] = "você ~g~pagou~s~ uma fatura de ~r~$%s~s~", + ["received_payment"] = "você ~g~recebeu~s~ um pagamento de ~r~$%s~s~", + ["player_not_online"] = "o jogador não está logado", + ["no_money"] = "you do not have enough money to pay this bill", + ["target_no_money"] = "the player ~r~does not~s~ have enough money to pay the bill!", +} diff --git a/server-data/resources/[esx_addons]/esx_billing/locales/cs.lua b/server-data/resources/[esx_addons]/esx_billing/locales/cs.lua index 6e109ea33..58b9062eb 100644 --- a/server-data/resources/[esx_addons]/esx_billing/locales/cs.lua +++ b/server-data/resources/[esx_addons]/esx_billing/locales/cs.lua @@ -1,12 +1,12 @@ -Locales['cs'] = { - ['invoices'] = 'faktury', - ['invoices_item'] = '$%s', - ['received_invoice'] = 'právě jsi ~r~obdrzel fakturu', - ['paid_invoice'] = 'zaplatil jsi fakturu za ~r~$%s', - ['no_invoices'] = 'momentalne nemas zadnou fatkuru k zaplaceni', - ['received_payment'] = 'obdržel jsi platbu za ~r~$%s', - ['player_not_online'] = 'hráč není přihlášen', - ['no_money'] = 'nemáš dostatek peněz na zaplacení této faktury', - ['target_no_money'] = 'hráč ~r~nemá dostatek peněz na zaplacení faktury!', - ['keymap_showbills'] = 'otevrit menu faktur', +Locales["cs"] = { + ["invoices"] = "faktury", + ["invoices_item"] = "$%s", + ["received_invoice"] = "právě jsi ~r~obdrzel fakturu", + ["paid_invoice"] = "zaplatil jsi fakturu za ~r~$%s", + ["no_invoices"] = "momentalne nemas zadnou fatkuru k zaplaceni", + ["received_payment"] = "obdržel jsi platbu za ~r~$%s", + ["player_not_online"] = "hráč není přihlášen", + ["no_money"] = "nemáš dostatek peněz na zaplacení této faktury", + ["target_no_money"] = "hráč ~r~nemá dostatek peněz na zaplacení faktury!", + ["keymap_showbills"] = "otevrit menu faktur", } diff --git a/server-data/resources/[esx_addons]/esx_billing/locales/da.lua b/server-data/resources/[esx_addons]/esx_billing/locales/da.lua index e3bf58741..c20317ae0 100644 --- a/server-data/resources/[esx_addons]/esx_billing/locales/da.lua +++ b/server-data/resources/[esx_addons]/esx_billing/locales/da.lua @@ -1,12 +1,12 @@ -Locales['da'] = { - ['invoices'] = 'regninger', - ['invoices_item'] = 'DKK%s', - ['received_invoice'] = 'du har lige ~r~modtaget en faktura', - ['paid_invoice'] = 'du har betalt en faktura på ~r~DKK%s', - ['no_invoices'] = 'du har ingen regninger at betale i øjeblikket', - ['received_payment'] = 'du har modtaget en betaling på ~r~DKK%s', - ['player_not_online'] = 'spilleren er ikke online', - ['no_money'] = 'du har ikke penge nok til at betale denne regning', - ['target_no_money'] = 'spilleren ~r~har ikke penge nok til at betale regningen!', - ['keymap_showbills'] = 'åbne regninger menu', - } \ No newline at end of file +Locales["da"] = { + ["invoices"] = "regninger", + ["invoices_item"] = "DKK%s", + ["received_invoice"] = "du har lige ~r~modtaget en faktura", + ["paid_invoice"] = "du har betalt en faktura på ~r~DKK%s", + ["no_invoices"] = "du har ingen regninger at betale i øjeblikket", + ["received_payment"] = "du har modtaget en betaling på ~r~DKK%s", + ["player_not_online"] = "spilleren er ikke online", + ["no_money"] = "du har ikke penge nok til at betale denne regning", + ["target_no_money"] = "spilleren ~r~har ikke penge nok til at betale regningen!", + ["keymap_showbills"] = "åbne regninger menu", +} diff --git a/server-data/resources/[esx_addons]/esx_billing/locales/de.lua b/server-data/resources/[esx_addons]/esx_billing/locales/de.lua index d8e5c8bf6..b1af181ed 100644 --- a/server-data/resources/[esx_addons]/esx_billing/locales/de.lua +++ b/server-data/resources/[esx_addons]/esx_billing/locales/de.lua @@ -1,12 +1,12 @@ -Locales['de'] = { - ['invoices'] = 'Rechnungen', - ['invoices_item'] = '%s€', - ['received_invoice'] = 'Du hast eine ~r~Rechnung~r~ erhalten!', - ['paid_invoice'] = 'Du bezahlst eine Rechung in der Höhe von ~r~%s€', - ['no_invoices'] = 'Du hast derzeit keine Rechnung!', - ['received_payment'] = 'Du bekommst eine bezahlung von ~r~%s€', - ['player_not_online'] = 'Dieser Spieler ist nicht Online!', - ['no_money'] = 'Du hast nicht genügend Geld um diese Rechung zu zahlen', - ['target_no_money'] = 'Diese Person ~r~hat nicht genug Geld um die Rechnung zu zahlen!', - ['keymap_showbills'] = 'Rechnungen Menü Öffnen', +Locales["de"] = { + ["invoices"] = "Rechnungen", + ["invoices_item"] = "%s€", + ["received_invoice"] = "Du hast eine ~r~Rechnung~r~ erhalten!", + ["paid_invoice"] = "Du bezahlst eine Rechung in der Höhe von ~r~%s€", + ["no_invoices"] = "Du hast derzeit keine Rechnung!", + ["received_payment"] = "Du bekommst eine bezahlung von ~r~%s€", + ["player_not_online"] = "Dieser Spieler ist nicht Online!", + ["no_money"] = "Du hast nicht genügend Geld um diese Rechung zu zahlen", + ["target_no_money"] = "Diese Person ~r~hat nicht genug Geld um die Rechnung zu zahlen!", + ["keymap_showbills"] = "Rechnungen Menü Öffnen", } diff --git a/server-data/resources/[esx_addons]/esx_billing/locales/el.lua b/server-data/resources/[esx_addons]/esx_billing/locales/el.lua index ebbe0fab5..847330efd 100644 --- a/server-data/resources/[esx_addons]/esx_billing/locales/el.lua +++ b/server-data/resources/[esx_addons]/esx_billing/locales/el.lua @@ -1,12 +1,12 @@ -Locales['el'] = { - ['invoices'] = 'Αποδείξεις', - ['invoices_item'] = '$%s', - ['received_invoice'] = 'Μόλις λάβατε μια απόδειξη', - ['paid_invoice'] = 'Πληρώσατε μια απόδειξη αξίας ~r~$%s', - ['no_invoices'] = 'Δεν έχετε καμία απόδειξη να πληρώσετε αυτήν τη στιγμή', - ['received_payment'] = 'Λάβατε μια πληρωμή αξίας ~r~$%s', - ['player_not_online'] = 'Ο παίκτης δεν είναι συνδεδεμένος', - ['no_money'] = 'Δεν έχετε αρκετά χρήματα για να πληρώσετε αυτή την απόδειξη', - ['target_no_money'] = 'Ο παίκτης ~r~δεν έχει αρκετά χρήματα για να πληρώσει την απόδειξη!', - ['keymap_showbills'] = 'Ανοίξτε το μενού αποδείξεων', +Locales["el"] = { + ["invoices"] = "Αποδείξεις", + ["invoices_item"] = "$%s", + ["received_invoice"] = "Μόλις λάβατε μια απόδειξη", + ["paid_invoice"] = "Πληρώσατε μια απόδειξη αξίας ~r~$%s", + ["no_invoices"] = "Δεν έχετε καμία απόδειξη να πληρώσετε αυτήν τη στιγμή", + ["received_payment"] = "Λάβατε μια πληρωμή αξίας ~r~$%s", + ["player_not_online"] = "Ο παίκτης δεν είναι συνδεδεμένος", + ["no_money"] = "Δεν έχετε αρκετά χρήματα για να πληρώσετε αυτή την απόδειξη", + ["target_no_money"] = "Ο παίκτης ~r~δεν έχει αρκετά χρήματα για να πληρώσει την απόδειξη!", + ["keymap_showbills"] = "Ανοίξτε το μενού αποδείξεων", } diff --git a/server-data/resources/[esx_addons]/esx_billing/locales/en.lua b/server-data/resources/[esx_addons]/esx_billing/locales/en.lua index a916dd9c9..da42891e1 100644 --- a/server-data/resources/[esx_addons]/esx_billing/locales/en.lua +++ b/server-data/resources/[esx_addons]/esx_billing/locales/en.lua @@ -1,12 +1,12 @@ -Locales['en'] = { - ['invoices'] = 'invoices', - ['invoices_item'] = '$%s', - ['received_invoice'] = 'you have just ~r~received an invoice', - ['paid_invoice'] = 'you paid an invoice of ~r~$%s', - ['no_invoices'] = 'you do not have any bills to pay at this moment', - ['received_payment'] = 'you received a payment of ~r~$%s', - ['player_not_online'] = 'the player is not logged in', - ['no_money'] = 'you do not have enough money to pay this bill', - ['target_no_money'] = 'the player ~r~does not have enough money to pay the bill!', - ['keymap_showbills'] = 'open bills menu', +Locales["en"] = { + ["invoices"] = "invoices", + ["invoices_item"] = "$%s", + ["received_invoice"] = "you have just ~r~received an invoice", + ["paid_invoice"] = "you paid an invoice of ~r~$%s", + ["no_invoices"] = "you do not have any bills to pay at this moment", + ["received_payment"] = "you received a payment of ~r~$%s", + ["player_not_online"] = "the player is not logged in", + ["no_money"] = "you do not have enough money to pay this bill", + ["target_no_money"] = "the player ~r~does not have enough money to pay the bill!", + ["keymap_showbills"] = "open bills menu", } diff --git a/server-data/resources/[esx_addons]/esx_billing/locales/es.lua b/server-data/resources/[esx_addons]/esx_billing/locales/es.lua index f18607c4c..624e98d34 100644 --- a/server-data/resources/[esx_addons]/esx_billing/locales/es.lua +++ b/server-data/resources/[esx_addons]/esx_billing/locales/es.lua @@ -1,12 +1,12 @@ -Locales['es'] = { - ['invoices'] = 'Facturas', - ['invoices_item'] = '%s$', - ['received_invoice'] = 'Has ~r~recibido una multa', - ['paid_invoice'] = 'Has pagado una multa de ~r~%s$', - ['no_invoices'] = 'No dispones de factuas para pagar ahora mismo', - ['received_payment'] = 'Has recibido un pago de %s$', - ['player_not_online'] = 'El jugador no está en linea', - ['no_money'] = 'No tienes suficiente dinero para pagar la factura', - ['target_no_money'] = '¡El jugador ~r~no tiene suficiente dinero para pagar la factura!', - ['keymap_showbills'] = 'Abrir menú de facturas', +Locales["es"] = { + ["invoices"] = "Facturas", + ["invoices_item"] = "%s$", + ["received_invoice"] = "Has ~r~recibido una multa", + ["paid_invoice"] = "Has pagado una multa de ~r~%s$", + ["no_invoices"] = "No dispones de factuas para pagar ahora mismo", + ["received_payment"] = "Has recibido un pago de %s$", + ["player_not_online"] = "El jugador no está en linea", + ["no_money"] = "No tienes suficiente dinero para pagar la factura", + ["target_no_money"] = "¡El jugador ~r~no tiene suficiente dinero para pagar la factura!", + ["keymap_showbills"] = "Abrir menú de facturas", } diff --git a/server-data/resources/[esx_addons]/esx_billing/locales/fi.lua b/server-data/resources/[esx_addons]/esx_billing/locales/fi.lua index d621940ab..981186acd 100644 --- a/server-data/resources/[esx_addons]/esx_billing/locales/fi.lua +++ b/server-data/resources/[esx_addons]/esx_billing/locales/fi.lua @@ -1,12 +1,12 @@ -Locales['fi'] = { - ['invoices'] = 'laskut', - ['invoices_item'] = '$%s', - ['received_invoice'] = 'sinä ~r~sait laskun', - ['paid_invoice'] = 'sinä maksoit laskun suuruudelta ~r~$%s', - ['no_invoices'] = 'you do not have any bills to pay at this moment', - ['received_payment'] = 'sinä sait maksun suuruudelta ~r~$%s', - ['player_not_online'] = 'pelaaja ei ole sisäänkirjautuneena', - ['no_money'] = 'sinulla ei ole tarpeeksi rahaa maksaaksesi tätä laskua.', - ['target_no_money'] = 'pelaajalla ~r~ei ole tarpeeksi rahaa maksaakseentätä laskua', - ['keymap_showbills'] = 'open bills menu', +Locales["fi"] = { + ["invoices"] = "laskut", + ["invoices_item"] = "$%s", + ["received_invoice"] = "sinä ~r~sait laskun", + ["paid_invoice"] = "sinä maksoit laskun suuruudelta ~r~$%s", + ["no_invoices"] = "you do not have any bills to pay at this moment", + ["received_payment"] = "sinä sait maksun suuruudelta ~r~$%s", + ["player_not_online"] = "pelaaja ei ole sisäänkirjautuneena", + ["no_money"] = "sinulla ei ole tarpeeksi rahaa maksaaksesi tätä laskua.", + ["target_no_money"] = "pelaajalla ~r~ei ole tarpeeksi rahaa maksaakseentätä laskua", + ["keymap_showbills"] = "open bills menu", } diff --git a/server-data/resources/[esx_addons]/esx_billing/locales/fr.lua b/server-data/resources/[esx_addons]/esx_billing/locales/fr.lua index 3c7b6b7ce..07f9d4730 100644 --- a/server-data/resources/[esx_addons]/esx_billing/locales/fr.lua +++ b/server-data/resources/[esx_addons]/esx_billing/locales/fr.lua @@ -1,12 +1,12 @@ -Locales['fr'] = { - ['invoices'] = 'factures', - ['invoices_item'] = '$%s', - ['received_invoice'] = 'vous avez ~r~reçu une facture', - ['paid_invoice'] = 'vous avez payé une facture de ~r~$%s', - ['no_invoices'] = 'vous n\'avez aucune facture à payer en ce moment', - ['received_payment'] = 'vous avez reçu un paiement de $%s', - ['player_not_online'] = 'le joueur n\'est pas connecté', - ['no_money'] = 'vous n\'avez pas assez d\'argent pour payer cette facture', - ['target_no_money'] = 'le joueur ~r~n\'a pas assez d\'argent pour payer la facture!', - ['keymap_showbills'] = 'ouvrir le menu des factures', +Locales["fr"] = { + ["invoices"] = "factures", + ["invoices_item"] = "$%s", + ["received_invoice"] = "vous avez ~r~reçu une facture", + ["paid_invoice"] = "vous avez payé une facture de ~r~$%s", + ["no_invoices"] = "vous n'avez aucune facture à payer en ce moment", + ["received_payment"] = "vous avez reçu un paiement de $%s", + ["player_not_online"] = "le joueur n'est pas connecté", + ["no_money"] = "vous n'avez pas assez d'argent pour payer cette facture", + ["target_no_money"] = "le joueur ~r~n'a pas assez d'argent pour payer la facture!", + ["keymap_showbills"] = "ouvrir le menu des factures", } diff --git a/server-data/resources/[esx_addons]/esx_billing/locales/hu.lua b/server-data/resources/[esx_addons]/esx_billing/locales/hu.lua index d13b564a4..3774e1f81 100644 --- a/server-data/resources/[esx_addons]/esx_billing/locales/hu.lua +++ b/server-data/resources/[esx_addons]/esx_billing/locales/hu.lua @@ -1,12 +1,12 @@ -Locales['hu'] = { - ['invoices'] = 'Számlák', - ['invoices_item'] = '$%s', - ['received_invoice'] = 'Kaptál egy számlát', - ['paid_invoice'] = 'Befizettél egy számlát ( ~r~$%s )', - ['no_invoices'] = 'Nincsen számlád amit kifizethetnél', - ['received_payment'] = 'Fizetést kaptál: ~r~$%s', - ['player_not_online'] = 'A játékos nem elérhető', - ['no_money'] = 'Nincsen elég pénzed, hogy kifizesd ezt a számlát', - ['target_no_money'] = 'A játékosnak nincsen annyi pénze, hogy befizesse a számlát', - ['keymap_showbills'] = 'Számlák megnézése', +Locales["hu"] = { + ["invoices"] = "Számlák", + ["invoices_item"] = "$%s", + ["received_invoice"] = "Kaptál egy számlát", + ["paid_invoice"] = "Befizettél egy számlát ( ~r~$%s )", + ["no_invoices"] = "Nincsen számlád amit kifizethetnél", + ["received_payment"] = "Fizetést kaptál: ~r~$%s", + ["player_not_online"] = "A játékos nem elérhető", + ["no_money"] = "Nincsen elég pénzed, hogy kifizesd ezt a számlát", + ["target_no_money"] = "A játékosnak nincsen annyi pénze, hogy befizesse a számlát", + ["keymap_showbills"] = "Számlák megnézése", } diff --git a/server-data/resources/[esx_addons]/esx_billing/locales/it.lua b/server-data/resources/[esx_addons]/esx_billing/locales/it.lua index c49d2756c..3f5019159 100644 --- a/server-data/resources/[esx_addons]/esx_billing/locales/it.lua +++ b/server-data/resources/[esx_addons]/esx_billing/locales/it.lua @@ -1,12 +1,12 @@ -Locales['it'] = { - ['invoices'] = 'fatture', - ['invoices_item'] = '$%s', - ['received_invoice'] = 'hai appena ~r~ricevuto~s~ una fattura', - ['paid_invoice'] = 'hai ~g~pagato~s~ una fattura di ~r~$%s~s~', - ['no_invoices'] = 'non hai nessuna fattura da pagare', - ['received_payment'] = 'hai ~g~ricevuto~s~ il pagamento di ~r~$%s~s~', - ['player_not_online'] = 'il giocatore non ha effettuato l\'accesso', - ['no_money'] = 'non hai abbastanza soldi per pagare questa fattura', - ['target_no_money'] = 'il giocatore ~r~non ha~s~ abbastanza soldi per pagare la fattura!', - ['keymap_showbills'] = 'apri il menu delle fatture', +Locales["it"] = { + ["invoices"] = "fatture", + ["invoices_item"] = "$%s", + ["received_invoice"] = "hai appena ~r~ricevuto~s~ una fattura", + ["paid_invoice"] = "hai ~g~pagato~s~ una fattura di ~r~$%s~s~", + ["no_invoices"] = "non hai nessuna fattura da pagare", + ["received_payment"] = "hai ~g~ricevuto~s~ il pagamento di ~r~$%s~s~", + ["player_not_online"] = "il giocatore non ha effettuato l'accesso", + ["no_money"] = "non hai abbastanza soldi per pagare questa fattura", + ["target_no_money"] = "il giocatore ~r~non ha~s~ abbastanza soldi per pagare la fattura!", + ["keymap_showbills"] = "apri il menu delle fatture", } diff --git a/server-data/resources/[esx_addons]/esx_billing/locales/nl.lua b/server-data/resources/[esx_addons]/esx_billing/locales/nl.lua index 394cf892d..ca887496d 100644 --- a/server-data/resources/[esx_addons]/esx_billing/locales/nl.lua +++ b/server-data/resources/[esx_addons]/esx_billing/locales/nl.lua @@ -1,12 +1,12 @@ -Locales['nl'] = { - ['invoices'] = 'Facturen', - ['invoices_item'] = '€%s', - ['received_invoice'] = 'Je hebt zojuist een ~r~factuur ontvangen', - ['paid_invoice'] = 'Je hebt een factuur betaald van ~r~€%s', - ['no_invoices'] = 'Je hoeft momenteel geen facturen te betalen', - ['received_payment'] = 'je hebt een bedrag ontvangen van ~r~€%s', - ['player_not_online'] = 'de speler is niet online', - ['no_money'] = 'je hebt niet genoeg geld om deze factuur te betalen', - ['target_no_money'] = 'de speler ~r~heeft niet genoeg geld om te betalen!', - ['keymap_showbills'] = 'open factuur menu', +Locales["nl"] = { + ["invoices"] = "Facturen", + ["invoices_item"] = "€%s", + ["received_invoice"] = "Je hebt zojuist een ~r~factuur ontvangen", + ["paid_invoice"] = "Je hebt een factuur betaald van ~r~€%s", + ["no_invoices"] = "Je hoeft momenteel geen facturen te betalen", + ["received_payment"] = "je hebt een bedrag ontvangen van ~r~€%s", + ["player_not_online"] = "de speler is niet online", + ["no_money"] = "je hebt niet genoeg geld om deze factuur te betalen", + ["target_no_money"] = "de speler ~r~heeft niet genoeg geld om te betalen!", + ["keymap_showbills"] = "open factuur menu", } diff --git a/server-data/resources/[esx_addons]/esx_billing/locales/pl.lua b/server-data/resources/[esx_addons]/esx_billing/locales/pl.lua index 0851f73b3..d84bc045b 100644 --- a/server-data/resources/[esx_addons]/esx_billing/locales/pl.lua +++ b/server-data/resources/[esx_addons]/esx_billing/locales/pl.lua @@ -1,12 +1,12 @@ -Locales['pl'] = { - ['invoices'] = 'faktury', - ['invoices_item'] = '$%s', - ['received_invoice'] = 'właśnie ~r~dostałeś/aś fakture', - ['paid_invoice'] = 'Zapłaciłeś/aś fakture: ~r~$%s', - ['no_invoices'] = 'you do not have any bills to pay at this moment', - ['received_payment'] = 'Otrzymałeś/aś zapłate: ~r~$%s', - ['player_not_online'] = 'gracz nie jest zalogowany', - ['no_money'] = 'nie masz wystarczająco pieniędzy aby zapłacić tą fakture', - ['target_no_money'] = 'gracz ~r~nie posiada wystarczająco pieniędzy aby zapłacić tą fakture!', - ['keymap_showbills'] = 'open bills menu', +Locales["pl"] = { + ["invoices"] = "faktury", + ["invoices_item"] = "$%s", + ["received_invoice"] = "właśnie ~r~dostałeś/aś fakture", + ["paid_invoice"] = "Zapłaciłeś/aś fakture: ~r~$%s", + ["no_invoices"] = "you do not have any bills to pay at this moment", + ["received_payment"] = "Otrzymałeś/aś zapłate: ~r~$%s", + ["player_not_online"] = "gracz nie jest zalogowany", + ["no_money"] = "nie masz wystarczająco pieniędzy aby zapłacić tą fakture", + ["target_no_money"] = "gracz ~r~nie posiada wystarczająco pieniędzy aby zapłacić tą fakture!", + ["keymap_showbills"] = "open bills menu", } diff --git a/server-data/resources/[esx_addons]/esx_billing/locales/sl.lua b/server-data/resources/[esx_addons]/esx_billing/locales/sl.lua index f3d135b2a..5197553c2 100644 --- a/server-data/resources/[esx_addons]/esx_billing/locales/sl.lua +++ b/server-data/resources/[esx_addons]/esx_billing/locales/sl.lua @@ -1,12 +1,12 @@ -Locales['sl'] = { - ['invoices'] = 'Položnice', - ['invoices_item'] = '$%s', - ['received_invoice'] = 'pravkar ste ~r~prejeli račun', - ['paid_invoice'] = 'plačali ste račun v višini ~r~$%s', - ['no_invoices'] = 'v tem trenutku nimate nobenih računov za plačilo', - ['received_payment'] = 'prejeli ste plačilo ~r~$%s', - ['player_not_online'] = 'igralec ni prijavljen', - ['no_money'] = 'nimate dovolj denarja za plačilo tega računa', - ['target_no_money'] = 'igralec ~r~nima dovolj denarja za plačilo računa!', - ['keymap_showbills'] = 'Odpri Položnice', +Locales["sl"] = { + ["invoices"] = "Položnice", + ["invoices_item"] = "$%s", + ["received_invoice"] = "pravkar ste ~r~prejeli račun", + ["paid_invoice"] = "plačali ste račun v višini ~r~$%s", + ["no_invoices"] = "v tem trenutku nimate nobenih računov za plačilo", + ["received_payment"] = "prejeli ste plačilo ~r~$%s", + ["player_not_online"] = "igralec ni prijavljen", + ["no_money"] = "nimate dovolj denarja za plačilo tega računa", + ["target_no_money"] = "igralec ~r~nima dovolj denarja za plačilo računa!", + ["keymap_showbills"] = "Odpri Položnice", } diff --git a/server-data/resources/[esx_addons]/esx_billing/locales/sr.lua b/server-data/resources/[esx_addons]/esx_billing/locales/sr.lua index ca1c70588..cda4a14e4 100644 --- a/server-data/resources/[esx_addons]/esx_billing/locales/sr.lua +++ b/server-data/resources/[esx_addons]/esx_billing/locales/sr.lua @@ -1,12 +1,12 @@ -Locales['sr'] = { - ['invoices'] = 'Računi', - ['invoices_item'] = '$%s', - ['received_invoice'] = 'Vi ste ~r~dobili novi račun', - ['paid_invoice'] = 'Platili ste račun od ~r~$%s', - ['no_invoices'] = 'Nemate računa za plaćanje trenutno', - ['received_payment'] = 'Primili ste uplatu u iznosu od ~r~$%s', - ['player_not_online'] = 'Osoba nije tu', - ['no_money'] = 'Nemate dovoljno novca da platite račun', - ['target_no_money'] = 'Osoba ~r~nema dovoljno novca da plati račun!', - ['keymap_showbills'] = 'Otvori Račune', +Locales["sr"] = { + ["invoices"] = "Računi", + ["invoices_item"] = "$%s", + ["received_invoice"] = "Vi ste ~r~dobili novi račun", + ["paid_invoice"] = "Platili ste račun od ~r~$%s", + ["no_invoices"] = "Nemate računa za plaćanje trenutno", + ["received_payment"] = "Primili ste uplatu u iznosu od ~r~$%s", + ["player_not_online"] = "Osoba nije tu", + ["no_money"] = "Nemate dovoljno novca da platite račun", + ["target_no_money"] = "Osoba ~r~nema dovoljno novca da plati račun!", + ["keymap_showbills"] = "Otvori Račune", } diff --git a/server-data/resources/[esx_addons]/esx_billing/locales/sv.lua b/server-data/resources/[esx_addons]/esx_billing/locales/sv.lua index 1ca2c67ac..0adeca80e 100644 --- a/server-data/resources/[esx_addons]/esx_billing/locales/sv.lua +++ b/server-data/resources/[esx_addons]/esx_billing/locales/sv.lua @@ -1,10 +1,10 @@ -Locales['sv'] = { - ['invoices'] = 'räkningar', - ['invoices_item'] = '%s SEK', - ['received_invoice'] = 'du har ~y~mottagit~s~ en räkning', - ['paid_invoice'] = 'du ~y~betalade~s~ precis en räkning på ~g~%s SEK~s~', - ['received_payment'] = 'du har ~y~mottagit~s~ en räkning på ~g~%s SEK~s~', - ['player_not_online'] = 'personen är inte online', - ['no_money'] = 'du har ~r~inte råd~s~ för att kunna betala räkningen', - ['target_no_money'] = 'personen har ~r~inte råd~s~ för att betala räkningen', -} \ No newline at end of file +Locales["sv"] = { + ["invoices"] = "räkningar", + ["invoices_item"] = "%s SEK", + ["received_invoice"] = "du har ~y~mottagit~s~ en räkning", + ["paid_invoice"] = "du ~y~betalade~s~ precis en räkning på ~g~%s SEK~s~", + ["received_payment"] = "du har ~y~mottagit~s~ en räkning på ~g~%s SEK~s~", + ["player_not_online"] = "personen är inte online", + ["no_money"] = "du har ~r~inte råd~s~ för att kunna betala räkningen", + ["target_no_money"] = "personen har ~r~inte råd~s~ för att betala räkningen", +} diff --git a/server-data/resources/[esx_addons]/esx_billing/locales/zh-cn.lua b/server-data/resources/[esx_addons]/esx_billing/locales/zh-cn.lua index 466b4fb05..0be1096ad 100644 --- a/server-data/resources/[esx_addons]/esx_billing/locales/zh-cn.lua +++ b/server-data/resources/[esx_addons]/esx_billing/locales/zh-cn.lua @@ -1,12 +1,12 @@ -Locales['zh-cn'] = { - ['invoices'] = '账单', - ['invoices_item'] = '$%s', - ['received_invoice'] = '新增一笔~r~新的账单! 请及时支付!', - ['paid_invoice'] = '已支付一笔~r~$%s元的账单', - ['no_invoices'] = '当前账户尚无可供支付的账单', - ['received_payment'] = '已收到~r~$%s元的账单支付', - ['player_not_online'] = '指定的玩家尚未登录!', - ['no_money'] = '您没有足够的钱支付此账单', - ['target_no_money'] = '此人暂无~r~足够资金可支付账单!', - ['keymap_showbills'] = '打开我的账单', +Locales["zh-cn"] = { + ["invoices"] = "账单", + ["invoices_item"] = "$%s", + ["received_invoice"] = "新增一笔~r~新的账单! 请及时支付!", + ["paid_invoice"] = "已支付一笔~r~$%s元的账单", + ["no_invoices"] = "当前账户尚无可供支付的账单", + ["received_payment"] = "已收到~r~$%s元的账单支付", + ["player_not_online"] = "指定的玩家尚未登录!", + ["no_money"] = "您没有足够的钱支付此账单", + ["target_no_money"] = "此人暂无~r~足够资金可支付账单!", + ["keymap_showbills"] = "打开我的账单", } diff --git a/server-data/resources/[esx_addons]/esx_billing/server/main.lua b/server-data/resources/[esx_addons]/esx_billing/server/main.lua index 00d27f483..1fe8b392a 100644 --- a/server-data/resources/[esx_addons]/esx_billing/server/main.lua +++ b/server-data/resources/[esx_addons]/esx_billing/server/main.lua @@ -1,145 +1,135 @@ - -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() - xTarget.showNotification(_U('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() - xTarget.showNotification(_U('received_invoice')) - end) - end - end +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() + xTarget.showNotification(_U("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() + xTarget.showNotification(_U("received_invoice")) + end) + end + end end) -ESX.RegisterServerCallback('esx_billing:getBills', function(source, cb) - local xPlayer = ESX.GetPlayerFromId(source) +ESX.RegisterServerCallback("esx_billing:getBills", function(source, cb) + local xPlayer = ESX.GetPlayerFromId(source) - MySQL.query('SELECT amount, id, label FROM billing WHERE identifier = ?', {xPlayer.identifier}, - function(result) - cb(result) - end) + MySQL.query("SELECT amount, id, label FROM billing WHERE identifier = ?", { xPlayer.identifier }, function(result) + cb(result) + end) end) -ESX.RegisterServerCallback('esx_billing:getTargetBills', function(_, cb, target) - local xPlayer = ESX.GetPlayerFromId(target) - - if xPlayer then - MySQL.query('SELECT amount, id, label FROM billing WHERE identifier = ?', {xPlayer.identifier}, - function(result) - cb(result) - end) - else - cb({}) - end +ESX.RegisterServerCallback("esx_billing:getTargetBills", function(_, cb, target) + local xPlayer = ESX.GetPlayerFromId(target) + + if xPlayer then + MySQL.query("SELECT amount, id, label FROM billing WHERE identifier = ?", { xPlayer.identifier }, function(result) + cb(result) + end) + else + cb({}) + end end) -ESX.RegisterServerCallback('esx_billing:payBill', function(source, cb, billId) - local xPlayer = ESX.GetPlayerFromId(source) - - MySQL.single('SELECT sender, target_type, target, amount FROM billing WHERE id = ?', {billId}, - function(result) - if result then - local amount = result.amount - local xTarget = ESX.GetPlayerFromIdentifier(result.sender) - - if result.target_type == 'player' then - if xTarget then - if xPlayer.getMoney() >= amount then - MySQL.update('DELETE FROM billing WHERE id = ?', {billId}, - function(rowsChanged) - if rowsChanged == 1 then - xPlayer.removeMoney(amount, "Bill Paid") - xTarget.addMoney(amount, "Paid bill") - - xPlayer.showNotification(_U('paid_invoice', ESX.Math.GroupDigits(amount))) - xTarget.showNotification(_U('received_payment', ESX.Math.GroupDigits(amount))) - end - - cb() - end) - elseif xPlayer.getAccount('bank').money >= amount then - MySQL.update('DELETE FROM billing WHERE id = ?', {billId}, - function(rowsChanged) - if rowsChanged == 1 then - xPlayer.removeAccountMoney('bank', amount, "Bill Paid") - xTarget.addAccountMoney('bank', amount, "Paid bill") - - xPlayer.showNotification(_U('paid_invoice', ESX.Math.GroupDigits(amount))) - xTarget.showNotification(_U('received_payment', ESX.Math.GroupDigits(amount))) - end - - cb() - end) - else - xTarget.showNotification(_U('target_no_money')) - xPlayer.showNotification(_U('no_money')) - cb() - end - else - xPlayer.showNotification(_U('player_not_online')) - cb() - end - else - TriggerEvent('esx_addonaccount:getSharedAccount', result.target, function(account) - if xPlayer.getMoney() >= amount then - MySQL.update('DELETE FROM billing WHERE id = ?', {billId}, - function(rowsChanged) - if rowsChanged == 1 then - xPlayer.removeMoney(amount, "Bill Paid") - account.addMoney(amount) - - xPlayer.showNotification(_U('paid_invoice', ESX.Math.GroupDigits(amount))) - if xTarget then - xTarget.showNotification(_U('received_payment', ESX.Math.GroupDigits(amount))) - end - end - - cb() - end) - elseif xPlayer.getAccount('bank').money >= amount then - MySQL.update('DELETE FROM billing WHERE id = ?', {billId}, - function(rowsChanged) - if rowsChanged == 1 then - xPlayer.removeAccountMoney('bank', amount, "Bill Paid") - account.addMoney(amount) - xPlayer.showNotification(_U('paid_invoice', ESX.Math.GroupDigits(amount))) - - if xTarget then - xTarget.showNotification(_U('received_payment', ESX.Math.GroupDigits(amount))) - end - end - - cb() - end) - else - if xTarget then - xTarget.showNotification(_U('target_no_money')) - end - - xPlayer.showNotification(_U('no_money')) - cb() - end - end) - end - end - end) +ESX.RegisterServerCallback("esx_billing:payBill", function(source, cb, billId) + local xPlayer = ESX.GetPlayerFromId(source) + + MySQL.single("SELECT sender, target_type, target, amount FROM billing WHERE id = ?", { billId }, function(result) + if result then + local amount = result.amount + local xTarget = ESX.GetPlayerFromIdentifier(result.sender) + + if result.target_type == "player" then + if xTarget then + if xPlayer.getMoney() >= amount then + MySQL.update("DELETE FROM billing WHERE id = ?", { billId }, function(rowsChanged) + if rowsChanged == 1 then + xPlayer.removeMoney(amount, "Bill Paid") + xTarget.addMoney(amount, "Paid bill") + + xPlayer.showNotification(_U("paid_invoice", ESX.Math.GroupDigits(amount))) + xTarget.showNotification(_U("received_payment", ESX.Math.GroupDigits(amount))) + end + + cb() + end) + elseif xPlayer.getAccount("bank").money >= amount then + MySQL.update("DELETE FROM billing WHERE id = ?", { billId }, function(rowsChanged) + if rowsChanged == 1 then + xPlayer.removeAccountMoney("bank", amount, "Bill Paid") + xTarget.addAccountMoney("bank", amount, "Paid bill") + + xPlayer.showNotification(_U("paid_invoice", ESX.Math.GroupDigits(amount))) + xTarget.showNotification(_U("received_payment", ESX.Math.GroupDigits(amount))) + end + + cb() + end) + else + xTarget.showNotification(_U("target_no_money")) + xPlayer.showNotification(_U("no_money")) + cb() + end + else + xPlayer.showNotification(_U("player_not_online")) + cb() + end + else + TriggerEvent("esx_addonaccount:getSharedAccount", result.target, function(account) + if xPlayer.getMoney() >= amount then + MySQL.update("DELETE FROM billing WHERE id = ?", { billId }, function(rowsChanged) + if rowsChanged == 1 then + xPlayer.removeMoney(amount, "Bill Paid") + account.addMoney(amount) + + xPlayer.showNotification(_U("paid_invoice", ESX.Math.GroupDigits(amount))) + if xTarget then + xTarget.showNotification(_U("received_payment", ESX.Math.GroupDigits(amount))) + end + end + + cb() + end) + elseif xPlayer.getAccount("bank").money >= amount then + MySQL.update("DELETE FROM billing WHERE id = ?", { billId }, function(rowsChanged) + if rowsChanged == 1 then + xPlayer.removeAccountMoney("bank", amount, "Bill Paid") + account.addMoney(amount) + xPlayer.showNotification(_U("paid_invoice", ESX.Math.GroupDigits(amount))) + + if xTarget then + xTarget.showNotification(_U("received_payment", ESX.Math.GroupDigits(amount))) + end + end + + cb() + end) + else + if xTarget then + xTarget.showNotification(_U("target_no_money")) + end + + xPlayer.showNotification(_U("no_money")) + cb() + end + end) + end + end + end) end)