From 20142da15e70418385814c90d156afbcf9668ecf Mon Sep 17 00:00:00 2001 From: Matti Date: Sun, 24 Nov 2024 18:31:33 +0100 Subject: [PATCH] Added multiple equipments support + added nl.json Yes, some strings are with "", instead of '', because I use an extension to style my lua code :)) I only changed the armory, nothing else, if something does not work, let me know. Some prop placements could be wrong for the food, I'm not spending my time on "perfecting" that, sorry --- config.lua | 858 ++++++++++++++------------ locales/en.json | 2 +- locales/nl.json | 92 +++ modules/job/actions/client/armory.lua | 107 ++-- 4 files changed, 619 insertions(+), 440 deletions(-) create mode 100644 locales/nl.json diff --git a/config.lua b/config.lua index 9dd87e8..db7675a 100644 --- a/config.lua +++ b/config.lua @@ -33,406 +33,464 @@ Config.PoliceVehicles = { -- vehicles that have access to the props (cones and e } Config.PoliceStations = { - ["station_1"] = { - jobs = { "police", "mechanic" }, - bossmenu = { - pos = vector3(447.08, -974.44, 30.68), - min_grade = 4 - }, - duty = vector3(440.92, -980.76, 30.72), - zone = { - pos = vec3(448.0, -997.0, 44.0), - size = vec3(96.0, 79.0, 65.0), - }, - blip = { - enable = true, - name = 'Los Santos Police Department', - type = 60, - scale = 0.8, - color = 38, - pos = vector3(440.8360, -982.6481, 30.6896), - }, - armory = { - pedPos = vector4(454.1804, -980.1198, 29.6896, 90.0000), - playerPos = vector4(452.3223, -980.0303, 29.7002, 270.0000), - model = 's_m_y_cop_01', - require_storage = true, - storage = { - stashId = 'podsalice_armory_storage', - stashLabel = 'LSPD Armory Storage', - minGradeAccess = 2, - }, - equipment = { - [1] = { - { - item = 'weapon_pistol', - label = 'Pistol', - quantity = 1, - prop = { - model = 'w_pi_pistol', - placePos = vector3(453.24318450195, -979.99542724609 - 0.1, 30.615884399414), - }, - }, - { - item = 'weapon_assaultrifle', - label = 'Rifle', - quantity = 1, - prop = { - model = 'w_ar_carbinerifle', - placePos = vector3(453.24318450195, -979.99542724609 - 0.1, 30.615884399414), - }, - }, - { - item = 'water', - label = 'Water', - quantity = 5, - prop = { - model = 'prop_ld_flow_bottle', - placePos = vector3(453.24318450195, -979.99542724609 - 0.1, 30.615884399414), - }, - }, - }, - }, - }, - garage = { - ['police_garage_1'] = { - pedPos = vector3(446.5634, -1023.0416, 27.5633), - model = 'mp_m_weapexp_01', - spawn = vector4(450.4673, -1019.8383, 28.4502, 90.0492), - deposit = vector3(450.4673, -1019.8383, 28.4502), - driverSpawnCoords = vector3(452.0132, -1025.2670, 27.5377), + ["station_1"] = { + jobs = { "police", "mechanic" }, + bossmenu = { + pos = vector3(447.08, -974.44, 30.68), + min_grade = 4, + }, + duty = vector3(440.92, -980.76, 30.72), + zone = { + pos = vec3(448.0, -997.0, 44.0), + size = vec3(96.0, 79.0, 65.0), + }, + blip = { + enable = true, + name = "Los Santos Police Department", + type = 60, + scale = 0.8, + color = 38, + pos = vector3(440.8360, -982.6481, 30.6896), + }, + armory = { + pedPos = vector4(454.1804, -980.1198, 29.6896, 90.0000), + playerPos = vector4(452.3223, -980.0303, 29.7002, 270.0000), + model = "s_m_y_cop_01", + require_storage = true, + storage = { + stashId = "podsalice_armory_storage", + stashLabel = "LSPD Armory Storage", + minGradeAccess = 2, + }, + equipment = { + [0] = { -- Grade 0 (Recruit by default) + name = "Food & Drinks", + icon = "fas fa-utensils", + { + item = "tosti", + label = "Tosti", + quantity = 10, + prop = { + model = "prop_cs_burger_01", + placePos = vector3(453.24318450195, -979.99542724609 - 0.1, 30.615884399414), + }, + }, + { + item = "water", + label = "Water", + quantity = 10, + prop = { + model = "ba_prop_club_water_bottle", + placePos = vector3(453.24318450195, -979.99542724609 - 0.1, 30.615884399414), + }, + }, + }, + [1] = { -- Grade 1 (Officer by default) + name = "Pistols", + icon = "fas fa-gun", + { + item = "weapon_combatpistol", + label = "Pistol", + quantity = 1, + prop = { + model = "w_pi_pistol", + placePos = vector3(453.24318450195, -979.99542724609 - 0.1, 30.615884399414), + }, + }, + { + item = "ammo-9", + label = "9mm ammo", + quantity = 100, + prop = { + model = "h4_prop_h4_box_ammo_01a", + placePos = vector3(453.24318450195, -979.99542724609 - 0.1, 30.615884399414), + }, + }, + }, + [2] = { + name = "Assault", + icon = "fas fa-gun", + { + item = "weapon_carbinerifle", + label = "Carbine Rifle", + quantity = 1, + prop = { + model = "w_ar_carbinerifle", + placePos = vector3(453.24318450195, -979.99542724609 - 0.1, 30.615884399414), + }, + }, + { + item = "ammo-rifle", + label = "Rifle ammo", + quantity = 300, + prop = { + model = "h4_prop_h4_box_ammo_01a", + placePos = vector3(453.24318450195, -979.99542724609 - 0.1, 30.615884399414), + }, + }, + }, + [3] = { + name = "Shotgun", + icon = "fas fa-gun", + { + item = "weapon_pumpshotgun", + label = "Pump Shotgun", + quantity = 1, + prop = { + model = "w_sg_pumpshotgun", + placePos = vector3(453.24318450195, -979.99542724609 - 0.1, 30.615884399414), + }, + }, + { + item = "ammo-shotgun", + label = "Shotgun ammo", + quantity = 50, + prop = { + model = "h4_prop_h4_box_ammo_01a", + placePos = vector3(453.24318450195, -979.99542724609 - 0.1, 30.615884399414), + }, + }, + }, + }, + }, + garage = { + ["police_garage_1"] = { + pedPos = vector3(446.5634, -1023.0416, 27.5633), + model = "mp_m_weapexp_01", + spawn = vector4(450.4673, -1019.8383, 28.4502, 90.0492), + deposit = vector3(450.4673, -1019.8383, 28.4502), + driverSpawnCoords = vector3(452.0132, -1025.2670, 27.5377), - vehicles = { - { - label = 'Police', - spawn_code = 'police', - min_grade = 0, - modifications = {} -- es. {color1 = {255, 12, 25}} - }, - { - label = 'Police 2', - spawn_code = 'police2', - min_grade = 2, - modifications = {} - }, - } - } - }, - stash = { - ['police_stash_1'] = { - slots = 50, - weight = 50, -- kg - min_grade = 0, - label = 'Lspd stash', - shared = true, -- false if you want to make everyone has a personal stash - pos = vector3(451.70455932617, -974.02062988281, 30.689004898071) - } - }, - cameras = { - pos = vector3(441.64836425781, -979.58472167969, 30.75832862854), - views = { - { - pos = vector3(433.63613891602, -978.21331787109, 33.510547637939), - rot = vector3(-2.2620145045948e-07, 1.3051226233074e-06, 125.97998046875) - }, - { - pos = vector3(424.19268798828, -996.83068847656, 34.037242889404), - rot = vector3(9.8608965345193e-05, 2.7001857233699e-05, 124.36595153809) - }, - { - pos = vector3(438.27066040039, -999.63421630859, 32.715244293213), - rot = vector3(0.0, -0.0, -154.93447875977) - }, - { - pos = vector3(489.390625, -1004.2265014648, 30.153388977051), - rot = vector3(0.0, 0.0, -56.987983703613) - }, - { - pos = vector3(482.24676513672, -978.32403564453, 30.483800888062), - rot = vector3(0.0, 0.0, 25.241655349731) - }, - { - pos = vector3(455.39239501953, -971.02227783203, 33.162532806396), - rot = vector3(1.9254218841525e-07, -1.1291083268361e-07, 22.17286491394) - }, - } - }, - clothes = { - enable = true, - pos = vector4(452.6250, -991.7988, 29.6896, 357.0948), - model = 'a_f_m_bevhills_01', - male = { - [1] = { - ['mask_1'] = 0, - ['mask_2'] = 0, - ['arms'] = 0, - ['tshirt_1'] = 15, - ['tshirt_2'] = 0, - ['torso_1'] = 86, - ['torso_2'] = 0, - ['bproof_1'] = 0, - ['bproof_2'] = 0, - ['decals_1'] = 0, - ['decals_2'] = 0, - ['chain_1'] = 0, - ['chain_2'] = 0, - ['pants_1'] = 10, - ['pants_2'] = 2, - ['shoes_1'] = 56, - ['shoes_2'] = 0, - ['helmet_1'] = 34, - ['helmet_2'] = 0, - ['glasses_1'] = 34, - ['glasses_2'] = 1, - }, - [2] = { - ['mask_1'] = 0, - ['mask_2'] = 0, - ['arms'] = 0, - ['tshirt_1'] = 15, - ['tshirt_2'] = 0, - ['torso_1'] = 86, - ['torso_2'] = 0, - ['bproof_1'] = 0, - ['bproof_2'] = 0, - ['decals_1'] = 0, - ['decals_2'] = 0, - ['chain_1'] = 0, - ['chain_2'] = 0, - ['pants_1'] = 10, - ['pants_2'] = 2, - ['shoes_1'] = 56, - ['shoes_2'] = 0, - ['helmet_1'] = 34, - ['helmet_2'] = 0, - ['glasses_1'] = 34, - ['glasses_2'] = 1, - }, - }, - female = { - [1] = { - ['mask_1'] = 0, - ['mask_2'] = 0, - ['arms'] = 0, - ['tshirt_1'] = 15, - ['tshirt_2'] = 0, - ['torso_1'] = 86, - ['torso_2'] = 0, - ['bproof_1'] = 0, - ['bproof_2'] = 0, - ['decals_1'] = 0, - ['decals_2'] = 0, - ['chain_1'] = 0, - ['chain_2'] = 0, - ['pants_1'] = 10, - ['pants_2'] = 2, - ['shoes_1'] = 56, - ['shoes_2'] = 0, - ['helmet_1'] = 34, - ['helmet_2'] = 0, - ['glasses_1'] = 34, - ['glasses_2'] = 1, - }, - }, - }, - }, - -- ["station_2"] = { - -- jobs = { "police", "mechanic" }, - -- zone = { - -- pos = vec3(448.0, -997.0, 44.0), - -- size = vec3(96.0, 79.0, 65.0), - -- }, - -- blip = { - -- enable = true, - -- name = 'Los Santos Police Department', - -- type = 60, - -- scale = 0.8, - -- color = 38, - -- pos = vector3(440.8360, -982.6481, 30.6896), - -- }, - -- armory = { - -- pedPos = vector4(454.1804, -980.1198, 29.6896, 90.0000), - -- playerPos = vector4(452.3223, -980.0303, 29.7002, 270.0000), - -- model = 's_m_y_cop_01', - -- require_storage = true, - -- storage = { - -- stashId = 'podsalice_armory_storage', - -- stashLabel = 'LSPD Armory Storage', - -- minGradeAccess = 2, - -- }, - -- equipment = { - -- [1] = { - -- { - -- item = 'weapon_pistol', - -- label = 'Pistol', - -- quantity = 1, - -- prop = { - -- model = 'w_pi_pistol', - -- placePos = vector3(453.24318450195, -979.99542724609 - 0.1, 30.615884399414), - -- }, - -- }, - -- { - -- item = 'weapon_assaultrifle', - -- label = 'Rifle', - -- quantity = 1, - -- prop = { - -- model = 'w_ar_carbinerifle', - -- placePos = vector3(453.24318450195, -979.99542724609 - 0.1, 30.615884399414), - -- }, - -- }, - -- { - -- item = 'water', - -- label = 'Water', - -- quantity = 5, - -- prop = { - -- model = 'prop_ld_flow_bottle', - -- placePos = vector3(453.24318450195, -979.99542724609 - 0.1, 30.615884399414), - -- }, - -- }, - -- }, - -- }, - -- }, - -- garage = { - -- ['police_garage_1'] = { - -- pedPos = vector3(446.5634, -1023.0416, 27.5633), - -- model = 'mp_m_weapexp_01', - -- spawn = vector4(450.4673, -1019.8383, 28.4502, 90.0492), - -- deposit = vector3(450.4673, -1019.8383, 28.4502), - -- driverSpawnCoords = vector3(452.0132, -1025.2670, 27.5377), - - -- vehicles = { - -- { - -- label = 'Police', - -- spawn_code = 'police', - -- min_grade = 0, - -- modifications = {} -- es. {color1 = {255, 12, 25}} - -- }, - -- { - -- label = 'Police 2', - -- spawn_code = 'police2', - -- min_grade = 2, - -- modifications = {} - -- }, - -- } - -- } - -- }, - -- stash = { - -- ['police_stash_1'] = { - -- slots = 50, - -- weight = 50, -- kg - -- min_grade = 0, - -- label = 'Lspd stash', - -- shared = true, -- false if you want to make everyone has a personal stash - -- pos = vector3(451.70455932617, -974.02062988281, 30.689004898071) - -- } - -- }, - -- cameras = { - -- pos = vector3(441.64836425781, -979.58472167969, 30.75832862854), - -- views = { - -- { - -- pos = vector3(433.63613891602, -978.21331787109, 33.510547637939), - -- rot = vector3(-2.2620145045948e-07, 1.3051226233074e-06, 125.97998046875) - -- }, - -- { - -- pos = vector3(424.19268798828, -996.83068847656, 34.037242889404), - -- rot = vector3(9.8608965345193e-05, 2.7001857233699e-05, 124.36595153809) - -- }, - -- { - -- pos = vector3(438.27066040039, -999.63421630859, 32.715244293213), - -- rot = vector3(0.0, -0.0, -154.93447875977) - -- }, - -- { - -- pos = vector3(489.390625, -1004.2265014648, 30.153388977051), - -- rot = vector3(0.0, 0.0, -56.987983703613) - -- }, - -- { - -- pos = vector3(482.24676513672, -978.32403564453, 30.483800888062), - -- rot = vector3(0.0, 0.0, 25.241655349731) - -- }, - -- { - -- pos = vector3(455.39239501953, -971.02227783203, 33.162532806396), - -- rot = vector3(1.9254218841525e-07, -1.1291083268361e-07, 22.17286491394) - -- }, - -- } - -- }, - -- clothes = { - -- enable = true, - -- pos = vector4(452.6250, -991.7988, 29.6896, 357.0948), - -- model = 'a_f_m_bevhills_01', - -- male = { - -- [1] = { - -- ['mask_1'] = 0, - -- ['mask_2'] = 0, - -- ['arms'] = 0, - -- ['tshirt_1'] = 15, - -- ['tshirt_2'] = 0, - -- ['torso_1'] = 86, - -- ['torso_2'] = 0, - -- ['bproof_1'] = 0, - -- ['bproof_2'] = 0, - -- ['decals_1'] = 0, - -- ['decals_2'] = 0, - -- ['chain_1'] = 0, - -- ['chain_2'] = 0, - -- ['pants_1'] = 10, - -- ['pants_2'] = 2, - -- ['shoes_1'] = 56, - -- ['shoes_2'] = 0, - -- ['helmet_1'] = 34, - -- ['helmet_2'] = 0, - -- ['glasses_1'] = 34, - -- ['glasses_2'] = 1, - -- }, - -- [2] = { - -- ['mask_1'] = 0, - -- ['mask_2'] = 0, - -- ['arms'] = 0, - -- ['tshirt_1'] = 15, - -- ['tshirt_2'] = 0, - -- ['torso_1'] = 86, - -- ['torso_2'] = 0, - -- ['bproof_1'] = 0, - -- ['bproof_2'] = 0, - -- ['decals_1'] = 0, - -- ['decals_2'] = 0, - -- ['chain_1'] = 0, - -- ['chain_2'] = 0, - -- ['pants_1'] = 10, - -- ['pants_2'] = 2, - -- ['shoes_1'] = 56, - -- ['shoes_2'] = 0, - -- ['helmet_1'] = 34, - -- ['helmet_2'] = 0, - -- ['glasses_1'] = 34, - -- ['glasses_2'] = 1, - -- }, - -- }, - -- female = { - -- [1] = { - -- ['mask_1'] = 0, - -- ['mask_2'] = 0, - -- ['arms'] = 0, - -- ['tshirt_1'] = 15, - -- ['tshirt_2'] = 0, - -- ['torso_1'] = 86, - -- ['torso_2'] = 0, - -- ['bproof_1'] = 0, - -- ['bproof_2'] = 0, - -- ['decals_1'] = 0, - -- ['decals_2'] = 0, - -- ['chain_1'] = 0, - -- ['chain_2'] = 0, - -- ['pants_1'] = 10, - -- ['pants_2'] = 2, - -- ['shoes_1'] = 56, - -- ['shoes_2'] = 0, - -- ['helmet_1'] = 34, - -- ['helmet_2'] = 0, - -- ['glasses_1'] = 34, - -- ['glasses_2'] = 1, - -- }, - -- }, - -- }, - -- }, + vehicles = { + { + label = "Police", + spawn_code = "police", + min_grade = 0, + modifications = {}, -- es. {color1 = {255, 12, 25}} + }, + { + label = "Police 2", + spawn_code = "police2", + min_grade = 2, + modifications = {}, + }, + }, + }, + }, + stash = { + ["police_stash_1"] = { + slots = 50, + weight = 50, -- kg + min_grade = 0, + label = "Lspd stash", + shared = true, -- false if you want to make everyone has a personal stash + pos = vector3(451.70455932617, -974.02062988281, 30.689004898071), + }, + }, + cameras = { + pos = vector3(441.64836425781, -979.58472167969, 30.75832862854), + views = { + { + pos = vector3(433.63613891602, -978.21331787109, 33.510547637939), + rot = vector3(-2.2620145045948e-07, 1.3051226233074e-06, 125.97998046875), + }, + { + pos = vector3(424.19268798828, -996.83068847656, 34.037242889404), + rot = vector3(9.8608965345193e-05, 2.7001857233699e-05, 124.36595153809), + }, + { + pos = vector3(438.27066040039, -999.63421630859, 32.715244293213), + rot = vector3(0.0, -0.0, -154.93447875977), + }, + { + pos = vector3(489.390625, -1004.2265014648, 30.153388977051), + rot = vector3(0.0, 0.0, -56.987983703613), + }, + { + pos = vector3(482.24676513672, -978.32403564453, 30.483800888062), + rot = vector3(0.0, 0.0, 25.241655349731), + }, + { + pos = vector3(455.39239501953, -971.02227783203, 33.162532806396), + rot = vector3(1.9254218841525e-07, -1.1291083268361e-07, 22.17286491394), + }, + }, + }, + clothes = { + enable = false, + pos = vector4(452.6250, -991.7988, 29.6896, 357.0948), + model = "a_f_m_bevhills_01", + male = { + [1] = { + ["mask_1"] = 0, + ["mask_2"] = 0, + ["arms"] = 0, + ["tshirt_1"] = 15, + ["tshirt_2"] = 0, + ["torso_1"] = 86, + ["torso_2"] = 0, + ["bproof_1"] = 0, + ["bproof_2"] = 0, + ["decals_1"] = 0, + ["decals_2"] = 0, + ["chain_1"] = 0, + ["chain_2"] = 0, + ["pants_1"] = 10, + ["pants_2"] = 2, + ["shoes_1"] = 56, + ["shoes_2"] = 0, + ["helmet_1"] = 34, + ["helmet_2"] = 0, + ["glasses_1"] = 34, + ["glasses_2"] = 1, + }, + [2] = { + ["mask_1"] = 0, + ["mask_2"] = 0, + ["arms"] = 0, + ["tshirt_1"] = 15, + ["tshirt_2"] = 0, + ["torso_1"] = 86, + ["torso_2"] = 0, + ["bproof_1"] = 0, + ["bproof_2"] = 0, + ["decals_1"] = 0, + ["decals_2"] = 0, + ["chain_1"] = 0, + ["chain_2"] = 0, + ["pants_1"] = 10, + ["pants_2"] = 2, + ["shoes_1"] = 56, + ["shoes_2"] = 0, + ["helmet_1"] = 34, + ["helmet_2"] = 0, + ["glasses_1"] = 34, + ["glasses_2"] = 1, + }, + }, + female = { + [1] = { + ["mask_1"] = 0, + ["mask_2"] = 0, + ["arms"] = 0, + ["tshirt_1"] = 15, + ["tshirt_2"] = 0, + ["torso_1"] = 86, + ["torso_2"] = 0, + ["bproof_1"] = 0, + ["bproof_2"] = 0, + ["decals_1"] = 0, + ["decals_2"] = 0, + ["chain_1"] = 0, + ["chain_2"] = 0, + ["pants_1"] = 10, + ["pants_2"] = 2, + ["shoes_1"] = 56, + ["shoes_2"] = 0, + ["helmet_1"] = 34, + ["helmet_2"] = 0, + ["glasses_1"] = 34, + ["glasses_2"] = 1, + }, + }, + }, + }, + -- ["station_2"] = { + -- jobs = { "police", "mechanic" }, + -- zone = { + -- pos = vec3(448.0, -997.0, 44.0), + -- size = vec3(96.0, 79.0, 65.0), + -- }, + -- blip = { + -- enable = true, + -- name = 'Los Santos Police Department', + -- type = 60, + -- scale = 0.8, + -- color = 38, + -- pos = vector3(440.8360, -982.6481, 30.6896), + -- }, + -- armory = { + -- pedPos = vector4(454.1804, -980.1198, 29.6896, 90.0000), + -- playerPos = vector4(452.3223, -980.0303, 29.7002, 270.0000), + -- model = 's_m_y_cop_01', + -- require_storage = true, + -- storage = { + -- stashId = 'podsalice_armory_storage', + -- stashLabel = 'LSPD Armory Storage', + -- minGradeAccess = 2, + -- }, + -- equipment = { + -- [1] = { + -- { + -- item = 'weapon_pistol', + -- label = 'Pistol', + -- quantity = 1, + -- prop = { + -- model = 'w_pi_pistol', + -- placePos = vector3(453.24318450195, -979.99542724609 - 0.1, 30.615884399414), + -- }, + -- }, + -- { + -- item = 'weapon_assaultrifle', + -- label = 'Rifle', + -- quantity = 1, + -- prop = { + -- model = 'w_ar_carbinerifle', + -- placePos = vector3(453.24318450195, -979.99542724609 - 0.1, 30.615884399414), + -- }, + -- }, + -- { + -- item = 'water', + -- label = 'Water', + -- quantity = 5, + -- prop = { + -- model = 'prop_ld_flow_bottle', + -- placePos = vector3(453.24318450195, -979.99542724609 - 0.1, 30.615884399414), + -- }, + -- }, + -- }, + -- }, + -- }, + -- garage = { + -- ['police_garage_1'] = { + -- pedPos = vector3(446.5634, -1023.0416, 27.5633), + -- model = 'mp_m_weapexp_01', + -- spawn = vector4(450.4673, -1019.8383, 28.4502, 90.0492), + -- deposit = vector3(450.4673, -1019.8383, 28.4502), + -- driverSpawnCoords = vector3(452.0132, -1025.2670, 27.5377), + -- vehicles = { + -- { + -- label = 'Police', + -- spawn_code = 'police', + -- min_grade = 0, + -- modifications = {} -- es. {color1 = {255, 12, 25}} + -- }, + -- { + -- label = 'Police 2', + -- spawn_code = 'police2', + -- min_grade = 2, + -- modifications = {} + -- }, + -- } + -- } + -- }, + -- stash = { + -- ['police_stash_1'] = { + -- slots = 50, + -- weight = 50, -- kg + -- min_grade = 0, + -- label = 'Lspd stash', + -- shared = true, -- false if you want to make everyone has a personal stash + -- pos = vector3(451.70455932617, -974.02062988281, 30.689004898071) + -- } + -- }, + -- cameras = { + -- pos = vector3(441.64836425781, -979.58472167969, 30.75832862854), + -- views = { + -- { + -- pos = vector3(433.63613891602, -978.21331787109, 33.510547637939), + -- rot = vector3(-2.2620145045948e-07, 1.3051226233074e-06, 125.97998046875) + -- }, + -- { + -- pos = vector3(424.19268798828, -996.83068847656, 34.037242889404), + -- rot = vector3(9.8608965345193e-05, 2.7001857233699e-05, 124.36595153809) + -- }, + -- { + -- pos = vector3(438.27066040039, -999.63421630859, 32.715244293213), + -- rot = vector3(0.0, -0.0, -154.93447875977) + -- }, + -- { + -- pos = vector3(489.390625, -1004.2265014648, 30.153388977051), + -- rot = vector3(0.0, 0.0, -56.987983703613) + -- }, + -- { + -- pos = vector3(482.24676513672, -978.32403564453, 30.483800888062), + -- rot = vector3(0.0, 0.0, 25.241655349731) + -- }, + -- { + -- pos = vector3(455.39239501953, -971.02227783203, 33.162532806396), + -- rot = vector3(1.9254218841525e-07, -1.1291083268361e-07, 22.17286491394) + -- }, + -- } + -- }, + -- clothes = { + -- enable = true, + -- pos = vector4(452.6250, -991.7988, 29.6896, 357.0948), + -- model = 'a_f_m_bevhills_01', + -- male = { + -- [1] = { + -- ['mask_1'] = 0, + -- ['mask_2'] = 0, + -- ['arms'] = 0, + -- ['tshirt_1'] = 15, + -- ['tshirt_2'] = 0, + -- ['torso_1'] = 86, + -- ['torso_2'] = 0, + -- ['bproof_1'] = 0, + -- ['bproof_2'] = 0, + -- ['decals_1'] = 0, + -- ['decals_2'] = 0, + -- ['chain_1'] = 0, + -- ['chain_2'] = 0, + -- ['pants_1'] = 10, + -- ['pants_2'] = 2, + -- ['shoes_1'] = 56, + -- ['shoes_2'] = 0, + -- ['helmet_1'] = 34, + -- ['helmet_2'] = 0, + -- ['glasses_1'] = 34, + -- ['glasses_2'] = 1, + -- }, + -- [2] = { + -- ['mask_1'] = 0, + -- ['mask_2'] = 0, + -- ['arms'] = 0, + -- ['tshirt_1'] = 15, + -- ['tshirt_2'] = 0, + -- ['torso_1'] = 86, + -- ['torso_2'] = 0, + -- ['bproof_1'] = 0, + -- ['bproof_2'] = 0, + -- ['decals_1'] = 0, + -- ['decals_2'] = 0, + -- ['chain_1'] = 0, + -- ['chain_2'] = 0, + -- ['pants_1'] = 10, + -- ['pants_2'] = 2, + -- ['shoes_1'] = 56, + -- ['shoes_2'] = 0, + -- ['helmet_1'] = 34, + -- ['helmet_2'] = 0, + -- ['glasses_1'] = 34, + -- ['glasses_2'] = 1, + -- }, + -- }, + -- female = { + -- [1] = { + -- ['mask_1'] = 0, + -- ['mask_2'] = 0, + -- ['arms'] = 0, + -- ['tshirt_1'] = 15, + -- ['tshirt_2'] = 0, + -- ['torso_1'] = 86, + -- ['torso_2'] = 0, + -- ['bproof_1'] = 0, + -- ['bproof_2'] = 0, + -- ['decals_1'] = 0, + -- ['decals_2'] = 0, + -- ['chain_1'] = 0, + -- ['chain_2'] = 0, + -- ['pants_1'] = 10, + -- ['pants_2'] = 2, + -- ['shoes_1'] = 56, + -- ['shoes_2'] = 0, + -- ['helmet_1'] = 34, + -- ['helmet_2'] = 0, + -- ['glasses_1'] = 34, + -- ['glasses_2'] = 1, + -- }, + -- }, + -- }, + -- }, } diff --git a/locales/en.json b/locales/en.json index cae2a22..00874d8 100644 --- a/locales/en.json +++ b/locales/en.json @@ -2,7 +2,7 @@ "clothing_interact_label": "Interact", "armory_interact_label": "Get equipment", "armory_interact_storage_label": "Open storage", - "already_have_item": "You already have this item", + "already_have_item": "You already have an %s", "no_item_in_storage": "is out of stock", "search_suspect_label": "Search suspect", "handcuff_suspect_label": "Handcuff suspect", diff --git a/locales/nl.json b/locales/nl.json new file mode 100644 index 0000000..e530bc1 --- /dev/null +++ b/locales/nl.json @@ -0,0 +1,92 @@ +{ + "clothing_interact_label": "Interactie", + "armory_interact_label": "Uitrusting verkrijgen", + "armory_interact_storage_label": "Open opslag", + "already_have_item": "Je hebt al %s", + "no_item_in_storage": "is uitverkocht", + "search_suspect_label": "Suspect doorzoeken", + "handcuff_suspect_label": "Handboeien aanleggen", + "uncuff_suspect_label": "Handboeien verwijderen", + "drag_suspect_label": "Suspect slepen", + "put_suspect_in_vehicle_label": "Suspect in voertuig plaatsen", + "take_suspect_out_vehicle_label": "Suspect uit voertuig nemen", + "stop_dragging_msg": "[BACKSPACE] - Slaan", + "fine_suspect_label": "Suspect beboeten", + "fine_dialog_title": "Beboetingsmenu", + "fine_amount_title": "Beboetingsbedrag", + "fine_reason_title": "Beboetingsreden", + "have_been_fined": "Je hebt een boete van %s voor %s", + "arrest_suspect_label": "Suspect arresteren", + "garage_interact_label": "Garage openen", + "deposit_vehicle": "[E] - Voertuig inleveren", + "open_stash_label": "[E] - Opslag openen", + "restrict_area_dialog_title": "Gebied beperken", + "restrict_area_message_title": "Bericht", + "restrict_area_message_description": "Bericht voor de mensen", + "restrict_area_radius_title": "Radius", + "restrict_area_radius_description": "Gebied om te beperken", + "restrict_area_time_title": "Tijd", + "restrict_area_time_description": "Tijd om het gebied te beperken, bijvoorbeeld 5", + "restrict_area_type_title": "Type", + "restrict_area_type_description": "Type van beperking", + "restrict_area_type_1": "Schietspel", + "restrict_area_type_2": "Overval", + "restrict_area_type_3": "Presidentsveiligheid", + "placing_prop_label": "Object plaatsen", + "picking_up_prop_label": "Object oppakken", + "take_cone_label": "Kegel", + "take_barrier_label": "Barricade", + "take_spikestrips_label": "Spikes", + "placing_prop_instructions": " **CONTROLES** \n [ENTER] om te plaatsen \n [BACKSPACE] om te annuleren \n [E] om links te draaien \n [Q] om rechts te draaien", + "view_cameras_label": "Camera bekijken", + "camera_instructions": " **CONTROLES** \n [E / Q] om cam te switchen \n [A] om links te draaien \n [D] om rechts te draaien \n [SCROLL UP] om in te zoomen \n [SCROLL DOWN] om uit te zoomen \n [BACKSPACE] om te stoppen \n [HUIDIGE CAM] %s", + "stop_dragging": "[BACKSPACE] om te stoppen ", + "bossmenu_label": "Open bossmenu ", + "emergency_blip_label": "Hulp", + "adam_notif_label": "Adam: ", + "status_notif_label": "Status: ", + "location_notif_label": "Locatie: ", + "status_notif_title": " LSPD NOTIFICATIE ", + "your_off_duty": "Je bent niet in dienst", + "call_metting_label": "Vergadering oproepen", + "set_adam_label": "Stel uw Adam in", + "set_adam_label_status": "Stel uw Adam status in", + "adam_receive_notif_label": "Ontvang statusnotificaties", + "adam_receive_notif_dec": "Schakel in om statusnotificaties van andere politieagenten te ontvangen", + "meeting_reason_label": "Vergaderingsreden:", + "read_meeting_reason_label": "Lees de reden hieronder", + "fz_metting": "Vergadering in Fz: ", + "join_fz": "Dienstfrequentie", + "open_called_meeting_menu": "Een hoge officier heeft een vergadering opgeroepen. Druk [U] voor meer informatie", + "no_adam_set": "Geen Adam ingesteld", + "police_menu_title": " Politie Menu ", + "open_adam_menu_label": "Adam", + "open_adam_menu_description": "Adam-instellingen", + "open_meeting_menu_label": "Vergadering oproepen", + "meeting_input_reason": "Reden", + "meeting_input_radio": "Radio Fz", + "meeting_input_confirmation": "Bevestiging", + "meeting_input_reason_desc": "Reden voor de vergadering", + "meeting_input_radio_desc": "Radiofrequentie dat iedereen zal joinen", + "police_meeting_menu_title": " Vergaderingsinfo ", + "adam_menu_title": " Adam Menu ", + "input_set_adam_title": " LSPD", + "input_enter_adam_num": "Voer uw Adam-nummer in", + "input_enter_adam_num_desc": "Voer het nummer van uw toegewezen Adam in", + "your_in_adam_x": "Je bent nu in Adam ", + "adam_status_menu_title": " Set Your Adam Status ", + "adam_status_changed": "Je hebt je status gewijzigd", + "clock_in": "Inloggen", + "clock_out": "Uitloggen", + "clocked_in": "Je hebt ingelogd voor het werk", + "already_in_duty": "Je bent al ingelogd", + "clocked_out": "Je hebt uitgelogd", + "already_off_duty": "Je bent al uitgelogd", + "broadcast_alert_label": "Bericht versturen naar iedereen", + "broadcast_alert_label_dsc": "", + "broadcast_input_title": "Bericht", + "broadcast_input_reason": "Bericht", + "broadcast_input_reason_desc": "Het bericht dat iedereen zal zien", + "broadcast_notif_title": " LSPD NOTIFICATIE " +} + diff --git a/modules/job/actions/client/armory.lua b/modules/job/actions/client/armory.lua index c7ce739..3069c23 100644 --- a/modules/job/actions/client/armory.lua +++ b/modules/job/actions/client/armory.lua @@ -12,30 +12,25 @@ local ClearPedTasks = ClearPedTasks local IsEntityPlayingAnim = IsEntityPlayingAnim local TriggerServerEvent = TriggerServerEvent -local function getEquipment(data) - utils.debug("Getting equipment") - +local function giveEquipment(equipmentBundle, data) local playerPed = cache.ped local policePed = data.entity + local animDict = lib.requestAnimDict("mp_cop_armoury") SetEntityCoords(playerPed, data.playerPos.x, data.playerPos.y, data.playerPos.z) SetEntityHeading(playerPed, data.playerPos.w) - SetCurrentPedWeapon(playerPed, joaat('weapon_unarmed'), true) + SetCurrentPedWeapon(playerPed, joaat("weapon_unarmed"), true) - local animDict = lib.requestAnimDict('mp_cop_armoury') - local jobGrade = getPlayerJobGrade() - local equipment = data.equipment[jobGrade] or data.equipment[1] - - for _, equipmentItem in ipairs(equipment) do - local playerItem = exports.ox_inventory:Search('count', equipmentItem.item) or 0 + for _, equipmentItem in ipairs(equipmentBundle) do + local playerItem = exports.ox_inventory:Search("count", equipmentItem.item) or 0 - if type(playerItem) == 'table' then + if type(playerItem) == "table" then playerItem = playerItem[string.upper(equipmentItem.item)] end if data.require_storage then - local storageItem = lib.callback.await('ars_policejob:getItemCount', false, data.storage.stashId, equipmentItem.item) - if type(storageItem) == 'table' then + local storageItem = lib.callback.await("ars_policejob:getItemCount", false, data.storage.stashId, equipmentItem.item) + if type(storageItem) == "table" then storageItem = storageItem[string.upper(equipmentItem.item)] end @@ -44,8 +39,7 @@ local function getEquipment(data) local itemToGive = storageItem > equipmentItem.quantity and equipmentItem.quantity or storageItem utils.debug("Getting item" .. equipmentItem.item .. " quantity: " .. itemToGive - playerItem) - TaskPlayAnim(policePed, animDict, 'pistol_on_counter_cop', 1.0, -1, 1.0, 0, 0, 0, 0, 0) - + TaskPlayAnim(policePed, animDict, "pistol_on_counter_cop", 1.0, -1, 1.0, 0, 0, 0, 0, 0) Wait(1100) local itemModel = lib.requestModel(equipmentItem.prop.model) @@ -53,7 +47,7 @@ local function getEquipment(data) local object = CreateObject(itemModel, playerCoords.x, playerCoords.y, playerCoords.z + 1, true, true, true) AttachEntityToEntity(object, policePed, GetPedBoneIndex(policePed, 57005), 0, 0, -0, 0, 0, 0, true, true, false, true, 1, true) - TaskPlayAnim(playerPed, animDict, 'pistol_on_counter', 1.0, -1, 1.0, 0, 0, 0, 0, 0) + TaskPlayAnim(playerPed, animDict, "pistol_on_counter", 1.0, -1, 1.0, 0, 0, 0, 0, 0) Wait(2000) @@ -64,34 +58,32 @@ local function getEquipment(data) Wait(2000) AttachEntityToEntity(placedObject, playerPed, GetPedBoneIndex(playerPed, 57005), 0, 0, -0, -0, 0, -0, true, true, false, true, 1, true) - while IsEntityPlayingAnim(playerPed, animDict, 'pistol_on_counter', 3) do + while IsEntityPlayingAnim(playerPed, animDict, "pistol_on_counter", 3) do Wait(0) end ClearPedTasks(policePed) - TriggerServerEvent('ars_policejob:giveItemToPlayer', data.storage.stashId, equipmentItem.item, itemToGive - playerItem, true, data.jobs) + TriggerServerEvent("ars_policejob:giveItemToPlayer", data.storage.stashId, equipmentItem.item, equipmentItem.quantity - playerItem, true, data.jobs) DeleteEntity(placedObject) else - utils.showNotification(equipmentItem.label .. ' ' .. locale('already_have_item')) + utils.showNotification(locale("already_have_item", equipmentItem.label)) end else - utils.showNotification(equipmentItem.label .. ' ' .. locale('no_item_in_storage')) + utils.showNotification(equipmentItem.label .. " " .. locale("no_item_in_storage")) end else if playerItem < equipmentItem.quantity then utils.debug("Getting item" .. equipmentItem.item .. " quantity: " .. equipmentItem.quantity - playerItem) - TaskPlayAnim(policePed, animDict, 'pistol_on_counter_cop', 1.0, -1, 1.0, 0, 0, 0, 0, 0) - + TaskPlayAnim(policePed, animDict, "pistol_on_counter_cop", 1.0, -1, 1.0, 0, 0, 0, 0, 0) Wait(1100) local itemModel = lib.requestModel(equipmentItem.prop.model) local playerCoords = cache.coords - local object = CreateObject(itemModel, playerCoords.x, playerCoords.y, playerCoords.z + 1, true, true, - true) + local object = CreateObject(itemModel, playerCoords.x, playerCoords.y, playerCoords.z + 1, true, true, true) AttachEntityToEntity(object, policePed, GetPedBoneIndex(policePed, 57005), 0, 0, -0, 0, 0, 0, true, true, false, true, 1, true) - TaskPlayAnim(playerPed, animDict, 'pistol_on_counter', 1.0, -1, 1.0, 0, 0, 0, 0, 0) + TaskPlayAnim(playerPed, animDict, "pistol_on_counter", 1.0, -1, 1.0, 0, 0, 0, 0, 0) Wait(2000) @@ -102,30 +94,67 @@ local function getEquipment(data) Wait(2000) AttachEntityToEntity(placedObject, playerPed, GetPedBoneIndex(playerPed, 57005), 0, 0, -0, -0, 0, -0, true, true, false, true, 1, true) - while IsEntityPlayingAnim(playerPed, animDict, 'pistol_on_counter', 3) do + while IsEntityPlayingAnim(playerPed, animDict, "pistol_on_counter", 3) do Wait(0) end ClearPedTasks(policePed) - TriggerServerEvent('ars_policejob:giveItemToPlayer', data.storage.stashId, equipmentItem.item, equipmentItem.quantity - playerItem, false, data.jobs) + TriggerServerEvent("ars_policejob:giveItemToPlayer", nil, equipmentItem.item, equipmentItem.quantity - playerItem, true, data.jobs) DeleteEntity(placedObject) else - utils.showNotification(equipmentItem.label .. ' ' .. locale('already_have_item')) + utils.showNotification(equipmentItem.label .. " " .. locale("already_have_item")) + end + end + end +end + +local function getEquipment(data) + utils.debug("Getting equipment") + local jobGrade = getPlayerJobGrade() + local equipmentOptions = {} + + for grade = 0, #data.equipment do + if grade <= jobGrade then + local equipmentBundle = data.equipment[grade] + local equipmentName = equipmentBundle.name + local equipmentIcon = equipmentBundle.icon + local equipmentItems = {} + for _, item in ipairs(equipmentBundle) do + table.insert(equipmentItems, item.label .. " (" .. tostring(item.quantity) .. "x)") end + table.insert(equipmentOptions, { + title = equipmentName, + description = table.concat(equipmentItems, ", "), + icon = equipmentIcon, + onSelect = function() + giveEquipment(equipmentBundle, data) + end, + }) end end + + if #equipmentOptions > 0 then + lib.registerContext({ + id = "select_equipment_bundle", + title = locale("armory_interact_label"), + options = equipmentOptions, + }) + lib.showContext("select_equipment_bundle") + else + utils.showNotification(locale("no_equipment")) + end end function initArmory(data) local ped = utils.createPed(data.model, data.pedPos) local options = { { - name = 'armory' .. ped, - label = locale('armory_interact_label'), - icon = 'fa-solid fa-road', + name = "armory" .. ped, + label = locale("armory_interact_label"), + icon = "fa-solid fa-boxes-stacked", groups = data.jobs, canInteract = function(entity, distance, coords, name, bone) - if IsEntityPlayingAnim(entity, 'mp_cop_armoury', 'pistol_on_counter_cop', 3) or IsEntityPlayingAnim(entity, 'mp_cop_armoury', 'rifle_on_counter_cop', 3) then + if IsEntityPlayingAnim(entity, "mp_cop_armoury", "pistol_on_counter_cop", 3) or IsEntityPlayingAnim(entity, "mp_cop_armoury", "rifle_on_counter_cop", 3) then return false end @@ -134,19 +163,19 @@ function initArmory(data) onSelect = function(entity) data.entity = entity.entity getEquipment(data) - end + end, }, { - name = 'armory_storage' .. ped, - label = locale('armory_interact_storage_label'), - icon = 'fa-solid fa-road', + name = "armory_storage" .. ped, + label = locale("armory_interact_storage_label"), + icon = "fa-solid fa-boxes-stacked", canInteract = function(entity, distance, coords, name, bone) return data.require_storage and hasJob(data.jobs) and getPlayerJobGrade() >= data.storage.minGradeAccess and player.inDuty() end, onSelect = function(entity) - exports.ox_inventory:openInventory('stash', data.storage.stashId) - end - } + exports.ox_inventory:openInventory("stash", data.storage.stashId) + end, + }, } exports.ox_target:addLocalEntity(ped, options) end