From 127bfb6b9ecbd60519ac9ee5f5f34059f10c890c Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Mon, 4 Jun 2018 22:30:54 +0200 Subject: [PATCH] Minor string formatting improvements --- README.md | 46 +++++++++++++++++++++++++++++++++++----------- config.lua | 2 +- esx_billing.sql | 19 +++++++++---------- locales/br.lua | 6 ++---- locales/de.lua | 6 ++---- locales/en.lua | 7 +++---- locales/es.lua | 5 ++--- locales/fr.lua | 6 ++---- locales/sv.lua | 5 ++--- server/main.lua | 9 ++++----- 10 files changed, 62 insertions(+), 49 deletions(-) diff --git a/README.md b/README.md index 5add4081..efc4fb4d 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,54 @@ # esx_billing -[INSTALLATION] +## Download & Installation -1) CD in your resources/[esx] folder -2) Clone the repository +### Using [fvm](https://github.com/qlaffont/fvm-installer) ``` -git clone https://github.com/FXServer-ESX/fxserver-esx_billing esx_billing +fvm install --save --folder=esx esx-org/esx_billing ``` -3) Import `esx_billing.sql` in your database -4) Add this in your `server.cfg`: + +### Using Git +``` +cd resources +git clone https://github.com/ESX-Org/esx_billing [esx]/esx_billing +``` + +### Manually +- Download https://github.com/ESX-Org/esx_billing/archive/master.zip +- Put it in the `[esx]` directory + + +## Installation +- Import `esx_billing.sql` in your database +- Add this in your server.cfg : ``` start esx_billing ``` -[USAGE] +## Usage -Press `[F7]` To show billing menu +Press `[F7]` To show the billing menu -``` +```lua local amount = 100 local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer() if closestPlayer == -1 or closestDistance > 3.0 then - ESX.ShowNotification('There\'s no players nearby!') + ESX.ShowNotification('There\'s no players nearby!') else - TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(closestPlayer), 'society_taxi', 'Taxi', amount) + TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(closestPlayer), 'society_taxi', 'Taxi', amount) end ``` + +# Legal +### License +esx_billing - billing for ESX + +Copyright (C) 2015-2018 Jérémie N'gadi + +This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version. + +This program Is distributed In the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty Of MERCHANTABILITY Or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License For more details. + +You should have received a copy Of the GNU General Public License along with this program. If Not, see http://www.gnu.org/licenses/. \ No newline at end of file diff --git a/config.lua b/config.lua index 926107bc..56a8b5e9 100644 --- a/config.lua +++ b/config.lua @@ -1,2 +1,2 @@ Config = {} -Config.Locale = 'sv' +Config.Locale = 'fr' diff --git a/esx_billing.sql b/esx_billing.sql index f7571215..a418175c 100644 --- a/esx_billing.sql +++ b/esx_billing.sql @@ -1,14 +1,13 @@ USE `essentialmode`; CREATE TABLE `billing` ( - - `id` int(11) NOT NULL AUTO_INCREMENT, - `identifier` varchar(255) NOT NULL, - `sender` varchar(255) NOT NULL, - `target_type` varchar(50) NOT NULL, - `target` varchar(255) NOT NULL, - `label` varchar(255) NOT NULL, - `amount` int(11) NOT NULL, - - PRIMARY KEY (`id`) + `id` int(11) NOT NULL AUTO_INCREMENT, + `identifier` varchar(255) NOT NULL, + `sender` varchar(255) NOT NULL, + `target_type` varchar(50) NOT NULL, + `target` varchar(255) NOT NULL, + `label` varchar(255) NOT NULL, + `amount` int(11) NOT NULL, + + PRIMARY KEY (`id`) ); diff --git a/locales/br.lua b/locales/br.lua index 5bcb5db2..6cac8e82 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -1,9 +1,7 @@ Locales['br'] = { - ['invoices'] = 'Faturas', ['received_invoice'] = 'Você ~r~recebeu~s~ uma fatura', - ['paid_invoice'] = 'Você ~g~pagou~s~ uma fatura de ~r~$', - ['received_payment'] = 'Você ~g~recebeu~s~ um pagamento de ~r~$', + ['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_logged'] = 'O jogador não está logado', - } diff --git a/locales/de.lua b/locales/de.lua index f1c54612..1c55d48b 100644 --- a/locales/de.lua +++ b/locales/de.lua @@ -1,9 +1,7 @@ Locales['de'] = { - ['invoices'] = 'Rechnungen', ['received_invoice'] = 'you hast eine Rechnung ~r~erhlaten~s~', - ['paid_invoice'] = 'du ~g~bezahlst~s~ eine Rechnung von ~r~$', - ['received_payment'] = 'du ~g~erhältst~s~ eine Zahlung von ~r~$', + ['paid_invoice'] = 'du ~g~bezahlst~s~ eine Rechnung von ~r~$%s~s~', + ['received_payment'] = 'du ~g~erhältst~s~ eine Zahlung von ~r~$%s~s~', ['player_not_logged'] = 'der Spieler ist nicht online', - } diff --git a/locales/en.lua b/locales/en.lua index d13b1d8b..220fd265 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -1,10 +1,9 @@ Locales['en'] = { ['invoices'] = 'invoices', ['received_invoice'] = 'you have just ~r~received~s~ an invoice', - ['paid_invoice'] = 'you ~g~paid~s~ an invoice of ~r~$', - ['received_payment'] = 'you ~g~received~s~ a payment of ~r~$', + ['paid_invoice'] = 'you ~g~paid~s~ an invoice of ~r~$%s~s~', + ['received_payment'] = 'you ~g~received~s~ a payment of ~r~$%s~s~', ['player_not_logged'] = '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~w~ have enough money to pay the bill!', - ['negative_bill'] = 'You cannot send negative bills!' + ['target_no_money'] = 'the player ~r~does not~w~ have enough money to pay the bill!', } diff --git a/locales/es.lua b/locales/es.lua index 07579913..9a21351e 100644 --- a/locales/es.lua +++ b/locales/es.lua @@ -1,8 +1,7 @@ Locales['es'] = { - ['invoices'] = 'Facturas', ['received_invoice'] = 'Has ~r~recibido~s~ una multa', - ['paid_invoice'] = 'Has ~g~pagado~s~ una multa de ~r~€', - ['received_payment'] = 'Has ~g~recibido~s~ un pago de ~g~€', + ['paid_invoice'] = 'Has ~g~pagado~s~ una multa de ~r~€%s~s~', + ['received_payment'] = 'Has ~g~recibido~s~ un pago de ~g~€%s~s~', ['player_not_logged'] = 'El jugador no está conectado', } diff --git a/locales/fr.lua b/locales/fr.lua index 46f14598..a9113d73 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -1,9 +1,7 @@ Locales['fr'] = { - ['invoices'] = 'factures', ['received_invoice'] = 'vous avez ~r~reçu~s~ une facture', - ['paid_invoice'] = 'vous avez ~g~payé~s~ une facture de ~r~$', - ['received_payment'] = 'vous avez ~g~reçu~s~ un paiement de ~g~$', + ['paid_invoice'] = 'vous avez ~g~payé~s~ une facture de ~r~$%s~s~', + ['received_payment'] = 'vous avez ~g~reçu~s~ un paiement de ~g~$%s~s~', ['player_not_logged'] = 'le joueur n\'est pas connecté', - } diff --git a/locales/sv.lua b/locales/sv.lua index 654fffdf..d661d797 100644 --- a/locales/sv.lua +++ b/locales/sv.lua @@ -1,10 +1,9 @@ Locales['sv'] = { ['invoices'] = 'räkningar', ['received_invoice'] = 'du har ~y~mottagit~s~ en räkning', - ['paid_invoice'] = 'du ~y~betalade~w~ precis en räkning på ~g~$', - ['received_payment'] = 'du har ~y~mottagit~w~ en räkning på ~g~$', + ['paid_invoice'] = 'du ~y~betalade~w~ precis en räkning på ~g~$%s~s~', + ['received_payment'] = 'du har ~y~mottagit~w~ en räkning på ~g~$%s~s~', ['player_not_logged'] = 'spelaren är inte online', ['no_money'] = 'du har ~r~inte råd~w~ för att kunna betala räkningen', ['target_no_money'] = 'Spelaren har ~r~inte råd~w~ för att betala räkningen', - ['negative_bill'] = 'Du kan inte skicka negativa räkningar!' } diff --git a/server/main.lua b/server/main.lua index bfb9739a..ae66ab5f 100644 --- a/server/main.lua +++ b/server/main.lua @@ -13,7 +13,6 @@ AddEventHandler('esx_billing:sendBill', function(playerId, sharedAccountName, la if amount < 0 then print('esx_billing: ' .. GetPlayerName(_source) .. ' tried sending a negative bill!') - TriggerClientEvent('esx:showNotification', _source, _U('negative_bill')) elseif account == nil then for i=1, #xPlayers, 1 do @@ -149,8 +148,8 @@ ESX.RegisterServerCallback('esx_billing:payBill', function(source, cb, id) xPlayer.removeMoney(amount) foundPlayer.addMoney(amount) - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('paid_invoice') .. amount) - TriggerClientEvent('esx:showNotification', foundPlayer.source, _U('received_payment') .. amount) + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('paid_invoice', amount)) + TriggerClientEvent('esx:showNotification', foundPlayer.source, _U('received_payment', amount)) cb() @@ -175,9 +174,9 @@ ESX.RegisterServerCallback('esx_billing:payBill', function(source, cb, id) function(rowsChanged) xPlayer.removeMoney(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 - TriggerClientEvent('esx:showNotification', foundPlayer.source, _U('received_payment') .. amount) + TriggerClientEvent('esx:showNotification', foundPlayer.source, _U('received_payment', amount)) end cb() end)