From f510277ba0b2191d10a3e707b5391d19474116a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pedro=20Correia?= Date: Mon, 16 Nov 2020 19:05:34 +0000 Subject: [PATCH 1/9] Nill value when vehicle is missing on vehicle list Fixed error "attempt to index a nil value (local 'firstVehicleData')" when vehicle doesn't exist on vehicle list/database. --- client/main.lua | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/client/main.lua b/client/main.lua index 28b00811..2b0816f6 100644 --- a/client/main.lua +++ b/client/main.lua @@ -705,20 +705,22 @@ AddEventHandler('esx_vehicleshop:hasEnteredMarker', function(zone) end end - resellPrice = ESX.Math.Round(vehicleData.price / 100 * Config.ResellPercentage) - model = GetEntityModel(vehicle) - plate = ESX.Math.Trim(GetVehicleNumberPlateText(vehicle)) + if vehicleData then + resellPrice = ESX.Math.Round(vehicleData.price / 100 * Config.ResellPercentage) + model = GetEntityModel(vehicle) + plate = ESX.Math.Trim(GetVehicleNumberPlateText(vehicle)) - CurrentAction = 'resell_vehicle' - CurrentActionMsg = _U('sell_menu', vehicleData.name, ESX.Math.GroupDigits(resellPrice)) + CurrentAction = 'resell_vehicle' + CurrentActionMsg = _U('sell_menu', vehicleData.name, ESX.Math.GroupDigits(resellPrice)) - CurrentActionData = { - vehicle = vehicle, - label = vehicleData.name, - price = resellPrice, - model = model, - plate = plate - } + CurrentActionData = { + vehicle = vehicle, + label = vehicleData.name, + price = resellPrice, + model = model, + plate = plate + } + end end end From b837ffb8a265367a6632fec47b16e992172dc7e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pedro=20Correia?= Date: Mon, 16 Nov 2020 19:14:08 +0000 Subject: [PATCH 2/9] Update main.lua --- client/main.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/main.lua b/client/main.lua index 2b0816f6..93c548cf 100644 --- a/client/main.lua +++ b/client/main.lua @@ -720,6 +720,8 @@ AddEventHandler('esx_vehicleshop:hasEnteredMarker', function(zone) model = model, plate = plate } + else + ESX.ShowNotification(_U('invalid_vehicle')) end end end From 2ccecac26f2f2bb14ac87d91d38636007c2a8265 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pedro=20Correia?= Date: Mon, 16 Nov 2020 19:25:44 +0000 Subject: [PATCH 3/9] Update br.lua --- locales/br.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/locales/br.lua b/locales/br.lua index ba95cdfb..02f25d2c 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -53,6 +53,7 @@ Locales['br'] = { ['have_withdrawn'] = 'você retirou ~y~x%s~s~ ~b~%s~s~', ['have_deposited'] = 'você depositou ~y~x%s~s~ ~b~%s~s~', ['boss_actions'] = 'ações do chefe', + ['invalid_vehicle'] = 'Veículo inválido', -- sold vehicles ['boss_sold'] = 'lista de veículos vendidos', From 8ea28a1b1c209378740c3be89eac935af8e5d4c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pedro=20Correia?= Date: Mon, 16 Nov 2020 19:26:58 +0000 Subject: [PATCH 4/9] Update cs.lua --- locales/cs.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/locales/cs.lua b/locales/cs.lua index 59e4ff1d..c284826f 100644 --- a/locales/cs.lua +++ b/locales/cs.lua @@ -53,6 +53,7 @@ Locales['cs'] = { ['have_withdrawn'] = 'vybral jsi ~y~x%s~s~ ~b~%s~s~', ['have_deposited'] = 'vlozil jsi ~y~x%s~s~ ~b~%s~s~', ['boss_actions'] = 'akce šéfa', + ['invalid_vehicle'] = 'neplatné vozidlo', -- sold vehicles ['boss_sold'] = 'seznam prodaných vozidel', From 8281d9155cf78ca10716b2a11b438371f403f7c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pedro=20Correia?= Date: Mon, 16 Nov 2020 19:27:20 +0000 Subject: [PATCH 5/9] Update en.lua --- locales/en.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/locales/en.lua b/locales/en.lua index acc59d50..a596a8be 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -53,6 +53,7 @@ Locales['en'] = { ['have_withdrawn'] = 'you have withdrawn ~y~x%s~s~ ~b~%s~s~', ['have_deposited'] = 'you have deposited ~y~x%s~s~ ~b~%s~s~', ['boss_actions'] = 'boss actions', + ['invalid_vehicle'] = 'Invalid vehicle', -- sold vehicles ['boss_sold'] = 'list of sold vehicles', From dfe5089ae8aae70f45b95411a74456f5848f6a73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pedro=20Correia?= Date: Mon, 16 Nov 2020 19:27:59 +0000 Subject: [PATCH 6/9] Update fi.lua --- locales/fi.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/locales/fi.lua b/locales/fi.lua index 69e7bc39..74a17c40 100644 --- a/locales/fi.lua +++ b/locales/fi.lua @@ -53,6 +53,7 @@ Locales['fi'] = { ['have_withdrawn'] = 'sinä otit ~y~x%s~s~ ~b~%s~s~', ['have_deposited'] = 'sinä talletit ~y~x%s~s~ ~b~%s~s~', ['boss_actions'] = 'Pomo toiminnot', + ['invalid_vehicle'] = 'di-wastong sasakyan', -- sold vehicles ['boss_sold'] = 'list of sold vehicles', From 3b9328bfc4df05a51f6518b9740b35b664645bf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pedro=20Correia?= Date: Mon, 16 Nov 2020 19:28:23 +0000 Subject: [PATCH 7/9] Update fr.lua --- locales/fr.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/locales/fr.lua b/locales/fr.lua index b14c8923..db3dde65 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -53,6 +53,7 @@ Locales['fr'] = { ['have_withdrawn'] = 'vous avez retiré ~y~x%s~s~ ~b~%s~s~', ['have_deposited'] = 'vous avez deposé ~y~x%s~s~ ~b~%s~s~', ['boss_actions'] = 'actions du chef', + ['invalid_vehicle'] = 'Véhicule invalide', -- sold vehicles ['boss_sold'] = 'liste des véhicule vendu', From e6b46a25c702f3d106ea2ebc2b77ef7cbbc78861 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pedro=20Correia?= Date: Mon, 16 Nov 2020 19:28:43 +0000 Subject: [PATCH 8/9] Update pl.lua --- locales/pl.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/locales/pl.lua b/locales/pl.lua index 42dfcec2..4ee3b293 100644 --- a/locales/pl.lua +++ b/locales/pl.lua @@ -53,6 +53,7 @@ Locales['pl'] = { ['have_withdrawn'] = 'wyciągasz ~y~x%s~s~ ~b~%s~s~', ['have_deposited'] = 'deponujesz ~y~x%s~s~ ~b~%s~s~', ['boss_actions'] = 'akcje szefa', + ['invalid_vehicle'] = 'nieprawidłowy pojazd', -- sold vehicles ['boss_sold'] = 'list of sold vehicles', From 472e74c0877bcb2b78e7318c49cee9134add2eda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pedro=20Correia?= Date: Mon, 16 Nov 2020 19:29:14 +0000 Subject: [PATCH 9/9] Update sv.lua --- locales/sv.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/locales/sv.lua b/locales/sv.lua index 6290d767..59588ae9 100644 --- a/locales/sv.lua +++ b/locales/sv.lua @@ -53,6 +53,7 @@ Locales['sv'] = { ['have_withdrawn'] = 'du har tagit ut ~y~x%s~s~ ~b~%s~s~', ['have_deposited'] = 'du har lagt in ~y~x%s~s~ ~b~%s~s~', ['boss_actions'] = 'chef handlingar', + ['invalid_vehicle'] = 'ogiltigt fordon', -- sold vehicles ['boss_sold'] = 'lista av sålda fordon',