diff --git a/client/main.lua b/client/main.lua index 28b00811..93c548cf 100644 --- a/client/main.lua +++ b/client/main.lua @@ -705,20 +705,24 @@ 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 + } + else + ESX.ShowNotification(_U('invalid_vehicle')) + end end end 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', 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', 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', 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', 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', 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', 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',