diff --git a/client/main.lua b/client/main.lua index b7d633e7..dcb0e7cb 100644 --- a/client/main.lua +++ b/client/main.lua @@ -716,78 +716,77 @@ end function OpenBodySearchMenu(player) - ESX.TriggerServerCallback('esx_policejob:getOtherPlayerData', function(data) + ESX.TriggerServerCallback('esx_policejob:getOtherPlayerData', function(data) - local elements = {} + local elements = {} - local blackMoney = 0 + local blackMoney = 0 - for i=1, #data.accounts, 1 do - if data.accounts[i].name == 'black_money' then - blackMoney = data.accounts[i].money - end - end + for i=1, #data.accounts, 1 do + if data.accounts[i].money > 0 then + if data.accounts[i].name == 'black_money' then + blackMoney = data.accounts[i].money - table.insert(elements, { - label = _U('confiscate_dirty', blackMoney), - value = 'black_money', - itemType = 'item_account', - amount = blackMoney - }) + table.insert(elements, { + label = _U('confiscate_dirty', ESX.Round(blackMoney)), + value = 'black_money', + itemType = 'item_account', + amount = blackMoney + }) - table.insert(elements, {label = _U('guns_label'), value = nil}) + break + end + end - for i=1, #data.weapons, 1 do - table.insert(elements, { - label = _U('confiscate', ESX.GetWeaponLabel(data.weapons[i].name)), - value = data.weapons[i].name, - itemType = 'item_weapon', - amount = data.ammo - }) - end + end - table.insert(elements, {label = _U('inventory_label'), value = nil}) + table.insert(elements, {label = _U('guns_label'), value = nil}) - for i=1, #data.inventory, 1 do - if data.inventory[i].count > 0 then - table.insert(elements, { - label = _U('confiscate_inv', data.inventory[i].count, data.inventory[i].label), - value = data.inventory[i].name, - itemType = 'item_standard', - amount = data.inventory[i].count - }) - end - end + for i=1, #data.weapons, 1 do + table.insert(elements, { + label = _U('confiscate_weapon', ESX.GetWeaponLabel(data.weapons[i].name), data.weapons[i].ammo), + value = data.weapons[i].name, + itemType = 'item_weapon', + amount = data.weapons[i].ammo + }) + end + + table.insert(elements, {label = _U('inventory_label'), value = nil}) + + for i=1, #data.inventory, 1 do + if data.inventory[i].count > 0 then + table.insert(elements, { + label = _U('confiscate_inv', data.inventory[i].count, data.inventory[i].label), + value = data.inventory[i].name, + itemType = 'item_standard', + amount = data.inventory[i].count + }) + end + end - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'body_search', - { - title = _U('search'), - align = 'top-left', - elements = elements, - }, - function(data, menu) + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'body_search', + { + title = _U('search'), + align = 'top-left', + elements = elements, + }, + function(data, menu) - local itemType = data.current.itemType - local itemName = data.current.value - local amount = data.current.amount + local itemType = data.current.itemType + local itemName = data.current.value + local amount = data.current.amount - if data.current.value ~= nil then + if data.current.value ~= nil then + TriggerServerEvent('esx_policejob:confiscatePlayerItem', GetPlayerServerId(player), itemType, itemName, amount) + OpenBodySearchMenu(player) + end - TriggerServerEvent('esx_policejob:confiscatePlayerItem', GetPlayerServerId(player), itemType, itemName, amount) + end, function(data, menu) + menu.close() + end) - OpenBodySearchMenu(player) - - end - - end, - function(data, menu) - menu.close() - end - ) - - end, GetPlayerServerId(player)) + end, GetPlayerServerId(player)) end diff --git a/locales/br.lua b/locales/br.lua index d3be0ecc..638339e6 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -79,6 +79,7 @@ Locales['br'] = { ['inventory_label'] = '--- Inventário ---', ['license_label'] = ' --- Licenses ---', ['confiscate'] = 'confiscar %s', + ['confiscate_weapon'] = 'confiscate %s with %s bullets', ['confiscate_inv'] = 'Confiscar %sx %s', ['confiscate_dirty'] = 'Confiscar dinheiro sujo: $%s', ['you_confiscated'] = 'you confiscated ~y~%sx~s~ ~b~%s~s~ from ~b~%s~s~', diff --git a/locales/de.lua b/locales/de.lua index 85f8650f..0448926e 100644 --- a/locales/de.lua +++ b/locales/de.lua @@ -79,6 +79,7 @@ Locales['de'] = { ['inventory_label'] = '--- Inventar ---', ['license_label'] = ' --- Licenses ---', ['confiscate'] = 'konfeszieren %s', + ['confiscate_weapon'] = 'confiscate %s with %s bullets', ['confiscate_inv'] = 'konfeziere %sx %s', ['confiscate_dirty'] = 'schwarzgeld konfesziert: $%s', ['you_confiscated'] = 'you confiscated ~y~%sx~s~ ~b~%s~s~ from ~b~%s~s~', diff --git a/locales/en.lua b/locales/en.lua index 0c28b1cc..f0cf16ac 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -79,6 +79,7 @@ Locales['en'] = { ['inventory_label'] = '--- Inventory ---', ['license_label'] = ' --- Licenses ---', ['confiscate'] = 'confiscate %s', + ['confiscate_weapon'] = 'confiscate %s with %s bullets', ['confiscate_inv'] = 'confiscate %sx %s', ['confiscate_dirty'] = 'confiscate dirty money: $%s', ['you_confiscated'] = 'you confiscated ~y~%sx~s~ ~b~%s~s~ from ~b~%s~s~', diff --git a/locales/es.lua b/locales/es.lua index 6fa71cfc..b6d4cf3d 100644 --- a/locales/es.lua +++ b/locales/es.lua @@ -79,6 +79,7 @@ Locales['es'] = { ['inventory_label'] = '--- Inventario ---', ['license_label'] = ' --- Licenses ---', ['confiscate'] = 'confiscar %s', + ['confiscate_weapon'] = 'confiscate %s with %s bullets', ['confiscate_inv'] = 'confiscar %sx %s', ['confiscate_dirty'] = 'confiscar dinero negro: €%s', ['you_confiscated'] = 'you confiscated ~y~%sx~s~ ~b~%s~s~ from ~b~%s~s~', diff --git a/locales/fi.lua b/locales/fi.lua index 73d6135f..7bc7d28a 100644 --- a/locales/fi.lua +++ b/locales/fi.lua @@ -79,6 +79,7 @@ Locales['fi'] = { ['inventory_label'] = '--- Reppu ---', ['license_label'] = ' --- Lisenssit ---', ['confiscate'] = 'takavarikoi %s', + ['confiscate_weapon'] = 'confiscate %s with %s bullets', ['confiscate_inv'] = 'takavarikoi %sx %s', ['confiscate_dirty'] = 'takavarikoi likainen raha: €%s', ['you_confiscated'] = 'you confiscated ~y~%sx~s~ ~b~%s~s~ from ~b~%s~s~', diff --git a/locales/fr.lua b/locales/fr.lua index 9ca05320..663b286c 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -79,6 +79,7 @@ Locales['fr'] = { ['inventory_label'] = '--- Inventaire ---', ['license_label'] = ' --- Licenses ---', ['confiscate'] = 'confisquer %s', + ['confiscate_weapon'] = 'confiscate %s with %s bullets', ['confiscate_inv'] = 'confisquer %sx %s', ['confiscate_dirty'] = 'confisquer argent sale: €%s', ['you_confiscated'] = 'you confiscated ~y~%sx~s~ ~b~%s~s~ from ~b~%s~s~', diff --git a/locales/pl.lua b/locales/pl.lua index 7b79c473..a0149ebc 100644 --- a/locales/pl.lua +++ b/locales/pl.lua @@ -79,6 +79,7 @@ Locales['pl'] = { ['inventory_label'] = '--- Ekwipunek ---', ['license_label'] = ' --- Licenses ---', ['confiscate'] = 'skonfiskuj %s', + ['confiscate_weapon'] = 'confiscate %s with %s bullets', ['confiscate_inv'] = 'skonfiskuj %sx %s', ['confiscate_dirty'] = 'skonfiskuj brudne pieniądze: $%s', ['you_confiscated'] = 'you confiscated ~y~%sx~s~ ~b~%s~s~ from ~b~%s~s~', diff --git a/locales/sv.lua b/locales/sv.lua index 7309bd36..02ef8dfb 100644 --- a/locales/sv.lua +++ b/locales/sv.lua @@ -10,12 +10,12 @@ Locales['sv'] = { ['no_outfit'] = 'det finns ingen uniform som passar dig!', ['open_cloackroom'] = 'tryck ~INPUT_CONTEXT~ för att välja ~y~kläder~s~.', -- Armory - ['remove_object'] = 'Ta ut objekt', - ['deposit_object'] = 'Lägg in objekt', - ['get_weapon'] = 'Ta ut vapen', - ['put_weapon'] = 'Lägg in vapen', - ['buy_weapons'] = 'Köp in vapen', - ['armory'] = 'Vapenförråd', + ['remove_object'] = 'ta ut objekt', + ['deposit_object'] = 'lägg in objekt', + ['get_weapon'] = 'ta ut vapen', + ['put_weapon'] = 'lägg in vapen', + ['buy_weapons'] = 'köp in vapen', + ['armory'] = 'vapenförråd', ['open_armory'] = 'tryck ~INPUT_CONTEXT~ för att komma åt förrådet', -- Vehicles ['vehicle_menu'] = 'Bilar', @@ -57,9 +57,9 @@ Locales['sv'] = { ['search_database_found'] = 'detta fordon är ~y~registrerat~s~ till ~b~%s~s~', -- Traffic interaction ['traffic_interaction'] = 'trafiksåtgärder', - ['cone'] = 'Kon', - ['barrier'] = 'Barriär', - ['spikestrips'] = 'Spikmatta', + ['cone'] = 'kon', + ['barrier'] = 'barriär', + ['spikestrips'] = 'spikmatta', ['box'] = 'låda', ['cash'] = 'låda med pengar', -- ID Card Menu @@ -78,6 +78,7 @@ Locales['sv'] = { ['inventory_label'] = '--- Inventory ---', ['license_label'] = ' --- Licenser ---', ['confiscate'] = 'beslagta %s', + ['confiscate_weapon'] = 'beslagta %s med %s skott', ['confiscate_inv'] = 'beslagta %sx %s', ['confiscate_dirty'] = 'beslagta svarta pengar: $%s', ['you_confiscated'] = 'du beslagtog ~y~%sx~s~ ~b~%s~s~ från ~b~%s~s~', @@ -96,18 +97,18 @@ Locales['sv'] = { ['owner_unknown'] = 'ägare: Okänt', ['owner'] = 'ägare: %s', -- Weapons Menus - ['get_weapon_menu'] = 'Vapenförråd - Ta vapen', - ['put_weapon_menu'] = 'Vapenförråd - Lägg in vapen', - ['buy_weapon_menu'] = 'Vapenförråd - Köp in vapen', - ['not_enough_money'] = 'Du har inte tillräckligt mycket pengar', + ['get_weapon_menu'] = 'vapenförråd - Ta vapen', + ['put_weapon_menu'] = 'vapenförråd - Lägg in vapen', + ['buy_weapon_menu'] = 'vapenförråd - Köp in vapen', + ['not_enough_money'] = 'du har inte tillräckligt mycket pengar', -- Boss Menu - ['take_company_money'] = 'Ta ut företagspengar', - ['deposit_money'] = 'Lägg in pengar till företaget', - ['amount_of_withdrawal'] = 'Belopp att ta ut', - ['invalid_amount'] = 'Otillgängligt belopp', - ['amount_of_deposit'] = 'Belopp att lägga in', - ['open_bossmenu'] = 'Tryck ~INPUT_CONTEXT~ för att öppna menyn', - ['quantity_invalid'] = 'Otillgängligt antal', + ['take_company_money'] = 'ta ut företagspengar', + ['deposit_money'] = 'lägg in pengar till företaget', + ['amount_of_withdrawal'] = 'belopp att ta ut', + ['invalid_amount'] = 'otillgängligt belopp', + ['amount_of_deposit'] = 'belopp att lägga in', + ['open_bossmenu'] = 'tryck ~INPUT_CONTEXT~ för att öppna menyn', + ['quantity_invalid'] = 'otillgängligt antal', ['have_withdraw'] = 'Du har tagit ut x', ['added'] = 'Du la in x', ['quantity'] = 'Antal', diff --git a/server/main.lua b/server/main.lua index 4cc26c31..2235983a 100644 --- a/server/main.lua +++ b/server/main.lua @@ -30,7 +30,7 @@ AddEventHandler('esx_policejob:confiscatePlayerItem', function(target, itemType, -- can the player carry the said amount of x item? if sourceItem.limit ~= -1 and (sourceItem.count + amount) > sourceItem.limit then - TriggerClientEvent('esx:showNotification', _source, _U('invalid_quantity')) + TriggerClientEvent('esx:showNotification', _source, _U('quantity_invalid')) else targetXPlayer.removeInventoryItem(itemName, amount) sourceXPlayer.addInventoryItem (itemName, amount) @@ -38,7 +38,7 @@ AddEventHandler('esx_policejob:confiscatePlayerItem', function(target, itemType, TriggerClientEvent('esx:showNotification', target, _U('got_confiscated', amount, sourceItem.label, sourceXPlayer.name)) end else - TriggerClientEvent('esx:showNotification', _source, _U('invalid_quantity')) + TriggerClientEvent('esx:showNotification', _source, _U('quantity_invalid')) end elseif itemType == 'item_account' then