Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 4 additions & 83 deletions [esx_addons]/esx_policejob/client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,7 @@ function OpenArmoryMenu(station)
if Config.EnableArmoryManagement then
table.insert(elements, {label = TranslateCap('get_weapon'), value = 'get_weapon'})
table.insert(elements, {label = TranslateCap('put_weapon'), value = 'put_weapon'})
table.insert(elements, {label = TranslateCap('remove_object'), value = 'get_stock'})
table.insert(elements, {label = TranslateCap('deposit_object'), value = 'put_stock'})
table.insert(elements, {label = TranslateCap('open_inventory'), value = 'stock'})
end

OpenPoliceMenu('default', 'armory', TranslateCap('armory'), elements, function(data, menu)
Expand All @@ -237,10 +236,9 @@ function OpenArmoryMenu(station)
OpenPutWeaponMenu()
elseif data.current.value == 'buy_weapons' then
OpenBuyWeaponsMenu()
elseif data.current.value == 'put_stock' then
OpenPutStocksMenu()
elseif data.current.value == 'get_stock' then
OpenGetStocksMenu()
elseif data.current.value == 'stock' then
TriggerServerEvent('esx_policejob:openInventory')
menu.close()
end
end, function(data, menu)
menu.close()
Expand Down Expand Up @@ -840,83 +838,6 @@ function OpenWeaponComponentShop(components, weaponName, parentShop)
end)
end

function OpenGetStocksMenu()
xLib.callback('esx_policejob:getStockItems', false, function(items)
local elements = {}

for i=1, #items, 1 do
elements[#elements+1] = {
label = 'x' .. items[i].count .. ' ' .. items[i].label,
value = items[i].name
}
end

OpenPoliceMenu('default', 'stocks_menu', TranslateCap('police_stock'), elements, function(data, menu)
local itemName = data.current.value

OpenPoliceMenu('dialog', 'stocks_menu_get_item_count', TranslateCap('quantity'), nil, function(data2, menu2)
local count = tonumber(data2.value)

if not count then
ESX.ShowNotification(TranslateCap('quantity_invalid'))
else
menu2.close()
menu.close()
TriggerServerEvent('esx_policejob:getStockItem', itemName, count)

Wait(300)
OpenGetStocksMenu()
end
end, function(data2, menu2)
menu2.close()
end)
end, function(data, menu)
menu.close()
end)
end)
end

function OpenPutStocksMenu()
xLib.callback('esx_policejob:getPlayerInventory', false, function(inventory)
local elements = {}

for i=1, #inventory.items, 1 do
local item = inventory.items[i]

if item.count > 0 then
elements[#elements+1] = {
label = item.label .. ' x' .. item.count,
type = 'item_standard',
value = item.name
}
end
end

OpenPoliceMenu('default', 'stocks_menu', TranslateCap('inventory'), elements, function(data, menu)
local itemName = data.current.value

OpenPoliceMenu('dialog', 'stocks_menu_put_item_count', TranslateCap('quantity'), nil, function(data2, menu2)
local count = tonumber(data2.value)

if not count then
ESX.ShowNotification(TranslateCap('quantity_invalid'))
else
menu2.close()
menu.close()
TriggerServerEvent('esx_policejob:putStockItems', itemName, count)

Wait(300)
OpenPutStocksMenu()
end
end, function(data2, menu2)
menu2.close()
end)
end, function(data, menu)
menu.close()
end)
end)
end

RegisterNetEvent('esx_phone:loaded')
AddEventHandler('esx_phone:loaded', function(phoneNumber, contacts)
local specialContact = {
Expand Down
2 changes: 1 addition & 1 deletion [esx_addons]/esx_policejob/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Config.MarkerSize = { x = 1.5, y = 1.5, z = 0.5 }
Config.MarkerColor = { r = 50, g = 50, b = 204 }

Config.EnablePlayerManagement = true -- Enable if you want society managing.
Config.EnableArmoryManagement = false
Config.EnableArmoryManagement = true
Config.EnableESXIdentity = true -- Enable if you're using esx_identity.
Config.EnableESXOptionalneeds = false -- Enable if you're using esx_optionalneeds
Config.EnableLicenses = false -- Enable if you're using esx_license.
Expand Down
4 changes: 1 addition & 3 deletions [esx_addons]/esx_policejob/locales/cs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ Locales['cs'] = {
['no_outfit'] = 'není zde žádná uniforma, která by ti sedla!',
['open_cloackroom'] = 'stiskni [E] pro změnu oblečení.',
-- Armory
['remove_object'] = 'vzít objekt',
['deposit_object'] = 'odevzdat objekt',
['open_inventory'] = 'Otevřít inventář',
['get_weapon'] = 'vzít zbraň ze zbrojnice',
['put_weapon'] = 'uchovat zbraň ve zbrojnici',
['buy_weapons'] = 'koupit zbraně',
Expand Down Expand Up @@ -155,7 +154,6 @@ Locales['cs'] = {
['quantity'] = 'množství',
['quantity_placeholder'] = 'Amount to withdraw..', --not translated
['inventory'] = 'inventář',
['police_stock'] = 'policejní sklad',
-- Misc
['remove_prop'] = 'stiskni [E] pro odstranění předmětu',
['map_blip'] = 'policejní stanice',
Expand Down
4 changes: 1 addition & 3 deletions [esx_addons]/esx_policejob/locales/de.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ Locales['de'] = {
['no_outfit'] = 'Es gibt keine Klamotten die dir passen.',
['open_cloackroom'] = 'Drücke [E] um dich umzuziehen',
-- Armory
['remove_object'] = 'Objekt nehmen',
['deposit_object'] = 'Objekt verstauen',
['open_inventory'] = 'Inventar öffnen',
['get_weapon'] = 'Waffen holen',
['put_weapon'] = 'Waffen bringen',
['buy_weapons'] = 'Waffen kaufen',
Expand Down Expand Up @@ -155,7 +154,6 @@ Locales['de'] = {
['quantity'] = 'Anzahl',
['quantity_placeholder'] = 'Anzahl zum Einzahlen..',
['inventory'] = 'Inventar',
['police_stock'] = 'Polizeilager',
-- Misc
['remove_prop'] = 'Drücke [E] um das Objekt zu entfernen',
['map_blip'] = 'Polizeiwache',
Expand Down
4 changes: 1 addition & 3 deletions [esx_addons]/esx_policejob/locales/en.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ Locales['en'] = {
['no_outfit'] = 'there\'s no uniform that fits you!',
['open_cloackroom'] = 'press [E] to change clothes.',
-- Armory
['remove_object'] = 'withdraw object',
['deposit_object'] = 'deposit object',
['open_inventory'] = 'Open inventory',
['get_weapon'] = 'withdraw weapon from armory',
['put_weapon'] = 'store weapon in armory',
['buy_weapons'] = 'buy weapons',
Expand Down Expand Up @@ -155,7 +154,6 @@ Locales['en'] = {
['quantity'] = 'quantity',
['quantity_placeholder'] = 'Amount to withdraw..',
['inventory'] = 'inventory',
['police_stock'] = 'police Stock',
-- Misc
['remove_prop'] = 'press [E] to delete the object',
['map_blip'] = 'police Station',
Expand Down
4 changes: 1 addition & 3 deletions [esx_addons]/esx_policejob/locales/es.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ Locales['es'] = {
['no_outfit'] = '¡No hay ningún uniforme disponible para ti!',
['open_cloackroom'] = 'Presionar [E] para abrir su taquilla',
-- Armory
['remove_object'] = 'Coger objeto',
['deposit_object'] = 'Depositar objeto',
['open_inventory'] = 'Abrir inventario',
['get_weapon'] = 'Coger arma',
['put_weapon'] = 'Depositar arma',
['buy_weapons'] = 'Comprar armas',
Expand Down Expand Up @@ -155,7 +154,6 @@ Locales['es'] = {
['quantity'] = 'cantidad',
['quantity_placeholder'] = 'Amount to withdraw..', --not translated
['inventory'] = 'inventario',
['police_stock'] = 'almacen Policial',
-- Misc
['remove_prop'] = 'presionar [E] para eliminar el objeto',
['map_blip'] = 'comisaría de policía',
Expand Down
4 changes: 1 addition & 3 deletions [esx_addons]/esx_policejob/locales/fi.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ Locales['fi'] = {
['no_outfit'] = 'täällä ei ole sinulle sopivaa asua',
['open_cloackroom'] = 'paina [E] vaihtaaksesi vaatteita.',
-- Armory
['remove_object'] = 'ota esine',
['deposit_object'] = 'talleta esine',
['open_inventory'] = 'Avaa inventaario',
['get_weapon'] = 'ota ase',
['put_weapon'] = 'laita ase pois',
['buy_weapons'] = 'osta aseita',
Expand Down Expand Up @@ -155,7 +154,6 @@ Locales['fi'] = {
['quantity'] = 'määrä',
['quantity_placeholder'] = 'Määrä mitä otat..',
['inventory'] = 'varasto',
['police_stock'] = 'poliisin Varasto',
-- Misc
['remove_prop'] = 'paina [E] poistaaksesi objektin',
['map_blip'] = 'poliisilaitos',
Expand Down
4 changes: 1 addition & 3 deletions [esx_addons]/esx_policejob/locales/fr.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ Locales['fr'] = {
['no_outfit'] = 'il n\'y a pas d\'uniforme à votre taille...',
['open_cloackroom'] = 'appuyez sur [E] pour vous changer',
-- Armurerie
['remove_object'] = 'prendre Objet',
['deposit_object'] = 'déposer objet',
['open_inventory'] = 'Ouvrir l\'inventaire',
['get_weapon'] = 'prendre Arme',
['put_weapon'] = 'déposer Arme',
['buy_weapons'] = 'acheter Armes',
Expand Down Expand Up @@ -155,7 +154,6 @@ Locales['fr'] = {
['quantity'] = 'quantité',
['quantity_placeholder'] = 'Montant à retirer..',
['inventory'] = 'inventaire',
['police_stock'] = 'coffre de la police',
-- Misc
['remove_prop'] = 'appuyez sur [E] pour enlever l\'objet',
['map_blip'] = 'Commissariat',
Expand Down
4 changes: 1 addition & 3 deletions [esx_addons]/esx_policejob/locales/hu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ Locales['hu'] = {
['no_outfit'] = 'Nincs hozzád illő egyenruha!',
['open_cloackroom'] = 'Nyomj [E] hogy hozzáférj: Öltöző.',
-- Armory
['remove_object'] = 'Tárgy kivétele',
['deposit_object'] = 'Tárgy berakás',
['open_inventory'] = 'Leltár megnyitása',
['get_weapon'] = 'Fegyver kivétele',
['put_weapon'] = 'Fegyver berakás',
['buy_weapons'] = 'Fegyver vásárlás',
Expand Down Expand Up @@ -156,7 +155,6 @@ Locales['hu'] = {
['quantity'] = 'mennyiség',
['quantity_placeholder'] = 'Amount to withdraw..', --not translated
['inventory'] = 'leltár',
['police_stock'] = 'Állomány',
-- Misc
['remove_prop'] = 'Nyomj [E] gombot az objektum törléséhez',
['map_blip'] = 'Rendőrség',
Expand Down
4 changes: 1 addition & 3 deletions [esx_addons]/esx_policejob/locales/it.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ Locales['it'] = {
['no_outfit'] = 'Non c\'è una divisa adatta a te!',
['open_cloackroom'] = 'Premi [E] per cambiarti.',
-- Armeria
['remove_object'] = 'Prendi oggetto',
['deposit_object'] = 'Deposita oggetto',
['open_inventory'] = 'Apri inventario',
['get_weapon'] = 'Prendi arma dall\'armeria',
['put_weapon'] = 'Deposita arma nell\'armeria',
['buy_weapons'] = 'Acquista armi',
Expand Down Expand Up @@ -155,7 +154,6 @@ Locales['it'] = {
['quantity'] = 'quantità',
['quantity_placeholder'] = 'Importo da prelevare..',
['inventory'] = 'inventario',
['police_stock'] = 'stock di polizia',
-- Varie
['remove_prop'] = 'premi [E] per eliminare l\'oggetto',
['map_blip'] = 'Stazione di Polizia',
Expand Down
4 changes: 1 addition & 3 deletions [esx_addons]/esx_policejob/locales/nl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ Locales['nl'] = {
['no_outfit'] = 'Er zijn geen passende uniformen voor jou!',
['open_cloackroom'] = 'Druk op [E] om je kleding aan te passen.',
-- Wapenkamer
['remove_object'] = 'Haal item uit kluis',
['deposit_object'] = 'Leg item in kluis',
['open_inventory'] = 'Inventaris openen',
['get_weapon'] = 'Haal wapen uit wapenkamer',
['put_weapon'] = 'Leg wapen in wapenkamer',
['buy_weapons'] = 'Koop wapens',
Expand Down Expand Up @@ -156,7 +155,6 @@ Locales['nl'] = {
['quantity'] = 'Aantal',
['quantity_placeholder'] = 'Amount to withdraw..', --not translated
['inventory'] = 'Inventaris',
['police_stock'] = 'Politie Voorraad',
-- Misc
['remove_prop'] = 'Druk op [E] om dit object te verwijderen.',
['map_blip'] = 'Politiebureau',
Expand Down
4 changes: 1 addition & 3 deletions [esx_addons]/esx_policejob/locales/pl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ Locales['pl'] = {
['no_outfit'] = 'brak ubrania',
['open_cloackroom'] = 'naciśnij [E] aby zmienić ubranie.',
-- Armory
['remove_object'] = 'weź przedmiot',
['deposit_object'] = 'zdeponuj przedmiot',
['open_inventory'] = 'Otwórz ekwipunek',
['get_weapon'] = 'weź broń',
['put_weapon'] = 'odłóż broń',
['buy_weapons'] = 'kup Broń',
Expand Down Expand Up @@ -155,7 +154,6 @@ Locales['pl'] = {
['quantity'] = 'ilość',
['quantity_placeholder'] = 'Amount to withdraw..', --not translated
['inventory'] = 'ekwipunek',
['police_stock'] = 'zapasy policji',
-- Misc
['remove_prop'] = 'naciśnij [E] aby usunąć ten obiekt',
['map_blip'] = 'komisariat Policji',
Expand Down
4 changes: 1 addition & 3 deletions [esx_addons]/esx_policejob/locales/sr.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ Locales['sr'] = {
['no_outfit'] = 'Nema uniforme koja Vam odgovara!',
['open_cloackroom'] = 'Pritisni [E] da promeniš odeću.',
-- Armory
['remove_object'] = 'Ukloni objekat',
['deposit_object'] = 'Postavi objekat',
['open_inventory'] = 'Otvori inventar',
['get_weapon'] = 'Uzmi oružje iz oružarnice',
['put_weapon'] = 'Ostavi oružje u oružarnicu',
['buy_weapons'] = 'Kupi oružje',
Expand Down Expand Up @@ -147,7 +146,6 @@ Locales['sr'] = {
['have_deposited'] = 'Ostavili ste %sx %s',
['quantity'] = 'Količina',
['inventory'] = 'Inventar',
['police_stock'] = 'Policijske zalihe',
-- Misc
['remove_prop'] = 'Pritisni [E] da ukloniš objekat',
['map_blip'] = 'Policijska Stanica',
Expand Down
Loading
Loading