diff --git a/server-data/resources/[esx_addons]/esx_mechanicjob/client/main.lua b/server-data/resources/[esx_addons]/esx_mechanicjob/client/main.lua index ff798ec4c..6d1f7e64f 100644 --- a/server-data/resources/[esx_addons]/esx_mechanicjob/client/main.lua +++ b/server-data/resources/[esx_addons]/esx_mechanicjob/client/main.lua @@ -2,7 +2,7 @@ local HasAlreadyEnteredMarker, LastZone = false, nil local CurrentAction, CurrentActionMsg, CurrentActionData = nil, "", {} local CurrentlyTowedVehicle, Blips, NPCOnJob, NPCTargetTowable, NPCTargetTowableZone = nil, {}, false, nil, nil local NPCHasSpawnedTowable, NPCLastCancel, NPCHasBeenNextToTowable, NPCTargetDeleterZone = false, GetGameTimer() - 5 * 60000, false, false -local isDead, isBusy = false, false +local isBusy = false function SelectRandomTowable() local index = GetRandomIntInRange(1, #Config.Towables) @@ -47,8 +47,6 @@ function StopNPCJob(cancel) if cancel then ESX.ShowNotification(TranslateCap("mission_canceled"), "error") - else - --TriggerServerEvent('esx_mechanicjob:onNPCJobCompleted') end end @@ -70,7 +68,7 @@ function OpenMechanicActionsMenu() } end - ESX.OpenContext("right", elements, function(menu, element) + ESX.OpenContext("right", elements, function(_, element) if element.value == "vehicle_list" then if Config.EnableSocietyOwnedVehicles then local elements2 = { @@ -86,7 +84,7 @@ function OpenMechanicActionsMenu() } end - ESX.OpenContext("right", elements2, function(menu2, element2) + ESX.OpenContext("right", elements2, function(_, element2) ESX.CloseContext() local vehicleProps = element2.value @@ -114,7 +112,7 @@ function OpenMechanicActionsMenu() } end - ESX.OpenContext("right", elements2, function(menu2, element2) + ESX.OpenContext("right", elements2, function(_, element2) if Config.MaxInService == -1 then ESX.CloseContext() ESX.Game.SpawnVehicle(element2.value, Config.Zones.VehicleSpawnPoint.Pos, 90.0, function(vehicle) @@ -147,7 +145,7 @@ function OpenMechanicActionsMenu() end) elseif element.value == "cloakroom2" then ESX.CloseContext() - ESX.TriggerServerCallback("esx_skin:getPlayerSkin", function(skin, jobSkin) + ESX.TriggerServerCallback("esx_skin:getPlayerSkin", function(skin) TriggerEvent("skinchanger:loadSkin", skin) end) elseif Config.OxInventory and (element.value == "put_stock" or element.value == "get_stock") then @@ -158,71 +156,17 @@ function OpenMechanicActionsMenu() elseif element.value == "get_stock" then OpenGetStocksMenu() elseif element.value == "boss_actions" then - TriggerEvent("esx_society:openBossMenu", "mechanic", function(data, menu) + TriggerEvent("esx_society:openBossMenu", "mechanic", function() ESX.CloseContext() end) end - end, function(menu) + end, function() CurrentAction = "mechanic_actions_menu" CurrentActionMsg = TranslateCap("open_actions") CurrentActionData = {} end) end -function OpenMechanicHarvestMenu() - if Config.EnablePlayerManagement and ESX.PlayerData.job and ESX.PlayerData.job.grade_name ~= "recrue" then - local elements = { - { unselectable = true, icon = "fas fa-gear", title = "Mechanic Harvest Menu" }, - { icon = "fas fa-gear", title = TranslateCap("gas_can"), value = "gaz_bottle" }, - { icon = "fas fa-gear", title = TranslateCap("repair_tools"), value = "fix_tool" }, - { icon = "fas fa-gear", title = TranslateCap("body_work_tools"), value = "caro_tool" }, - } - - ESX.OpenContext("right", elements, function(menu, element) - if element.value == "gaz_bottle" then - TriggerServerEvent("esx_mechanicjob:startHarvest") - elseif element.value == "fix_tool" then - TriggerServerEvent("esx_mechanicjob:startHarvest2") - elseif element.value == "caro_tool" then - TriggerServerEvent("esx_mechanicjob:startHarvest3") - end - end, function(menu) - CurrentAction = "mechanic_harvest_menu" - CurrentActionMsg = TranslateCap("harvest_menu") - CurrentActionData = {} - end) - else - ESX.ShowNotification(TranslateCap("not_experienced_enough")) - end -end - -function OpenMechanicCraftMenu() - if Config.EnablePlayerManagement and ESX.PlayerData.job and ESX.PlayerData.job.grade_name ~= "recrue" then - local elements = { - { unselectable = true, icon = "fas fa-gear", title = "Mechanic Craft Menu" }, - { icon = "fas fa-gear", title = TranslateCap("blowtorch"), value = "blow_pipe" }, - { icon = "fas fa-gear", title = TranslateCap("repair_kit"), value = "fix_kit" }, - { icon = "fas fa-gear", title = TranslateCap("body_kit"), value = "caro_kit" }, - } - - ESX.OpenContext("right", elements, function(menu, element) - if element.value == "blow_pipe" then - TriggerServerEvent("esx_mechanicjob:startCraft") - elseif element.value == "fix_kit" then - TriggerServerEvent("esx_mechanicjob:startCraft2") - elseif element.value == "caro_kit" then - TriggerServerEvent("esx_mechanicjob:startCraft3") - end - end, function(menu) - CurrentAction = "mechanic_craft_menu" - CurrentActionMsg = TranslateCap("craft_menu") - CurrentActionData = {} - end) - else - ESX.ShowNotification(TranslateCap("not_experienced_enough")) - end -end - function OpenMobileMechanicActionsMenu() local elements = { { unselectable = true, icon = "fas fa-gear", title = TranslateCap("mechanic") }, @@ -231,11 +175,11 @@ function OpenMobileMechanicActionsMenu() { icon = "fas fa-gear", title = TranslateCap("repair"), value = "fix_vehicle" }, { icon = "fas fa-gear", title = TranslateCap("clean"), value = "clean_vehicle" }, { icon = "fas fa-gear", title = TranslateCap("imp_veh"), value = "del_vehicle" }, - { icon = "fas fa-gear", title = TranslateCap("flat_bed"), value = "dep_vehicle" }, + { icon = "fas fa-gear", title = TranslateCap("tow"), value = "dep_vehicle" }, { icon = "fas fa-gear", title = TranslateCap("place_objects"), value = "object_spawner" }, } - ESX.OpenContext("right", elements, function(menu, element) + ESX.OpenContext("right", elements, function(_, element) if isBusy then return end @@ -247,7 +191,7 @@ function OpenMobileMechanicActionsMenu() { icon = "fas fa-check-double", title = "Confirm", value = "confirm" }, } - ESX.OpenContext("right", elements2, function(menu2, element2) + ESX.OpenContext("right", elements2, function(menu2) local amount = tonumber(menu2.eles[2].inputValue) if amount == nil or amount < 0 then @@ -265,7 +209,7 @@ function OpenMobileMechanicActionsMenu() elseif element.value == "hijack_vehicle" then local playerPed = PlayerPedId() local vehicle = ESX.Game.GetVehicleInDirection() - local coords = GetEntityCoords(playerPed) + local _ = GetEntityCoords(playerPed) if IsPedSittingInAnyVehicle(playerPed) then ESX.ShowNotification(TranslateCap("inside_vehicle")) @@ -291,7 +235,7 @@ function OpenMobileMechanicActionsMenu() elseif element.value == "fix_vehicle" then local playerPed = PlayerPedId() local vehicle = ESX.Game.GetVehicleInDirection() - local coords = GetEntityCoords(playerPed) + local _ = GetEntityCoords(playerPed) if IsPedSittingInAnyVehicle(playerPed) then ESX.ShowNotification(TranslateCap("inside_vehicle")) @@ -319,7 +263,7 @@ function OpenMobileMechanicActionsMenu() elseif element.value == "clean_vehicle" then local playerPed = PlayerPedId() local vehicle = ESX.Game.GetVehicleInDirection() - local coords = GetEntityCoords(playerPed) + local _ = GetEntityCoords(playerPed) if IsPedSittingInAnyVehicle(playerPed) then ESX.ShowNotification(TranslateCap("inside_vehicle")) @@ -441,7 +385,7 @@ function OpenMobileMechanicActionsMenu() { icon = "fas fa-object", title = TranslateCap("toolbox"), value = "prop_toolchest_01" }, } - ESX.OpenContext("right", elements2, function(menuObj, elementObj) + ESX.OpenContext("right", elements2, function(_, elementObj) local model = elementObj.value local coords = GetEntityCoords(playerPed) local forward = GetEntityForwardVector(playerPed) @@ -476,7 +420,7 @@ function OpenGetStocksMenu() } end - ESX.OpenContext("right", elements, function(menu, element) + ESX.OpenContext("right", elements, function(_, element) local itemName = element.value local elements2 = { @@ -485,7 +429,7 @@ function OpenGetStocksMenu() { icon = "fas fa-check-double", title = "Confirm", value = "confirm" }, } - ESX.OpenContext("right", elements2, function(menu2, element2) + ESX.OpenContext("right", elements2, function(menu2) local count = tonumber(menu2.eles[2].inputValue) if count == nil then @@ -521,7 +465,7 @@ function OpenPutStocksMenu() end end - ESX.OpenContext("right", elements, function(menu, element) + ESX.OpenContext("right", elements, function(_, element) local itemName = element.value local elements2 = { @@ -530,7 +474,7 @@ function OpenPutStocksMenu() { icon = "fas fa-check-double", title = "Confirm", value = "confirm" }, } - ESX.OpenContext("right", elements2, function(menu2, element2) + ESX.OpenContext("right", elements2, function(menu2) local count = tonumber(menu2.eles[2].inputValue) if count == nil then @@ -588,35 +532,8 @@ AddEventHandler("esx_mechanicjob:onHijack", function() end end) -RegisterNetEvent("esx_mechanicjob:onCarokit") -AddEventHandler("esx_mechanicjob:onCarokit", function() - local playerPed = PlayerPedId() - local coords = GetEntityCoords(playerPed) - - if IsAnyVehicleNearPoint(coords.x, coords.y, coords.z, 5.0) then - local vehicle - - if IsPedInAnyVehicle(playerPed, false) then - vehicle = GetVehiclePedIsIn(playerPed, false) - else - vehicle = ESX.Game.GetClosestVehicle(coords) - end - - if DoesEntityExist(vehicle) then - TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_HAMMERING", 0, true) - CreateThread(function() - Wait(10000) - SetVehicleFixed(vehicle) - SetVehicleDeformationFixed(vehicle) - ClearPedTasksImmediately(playerPed) - ESX.ShowNotification(TranslateCap("body_repaired")) - end) - end - end -end) - -RegisterNetEvent("esx_mechanicjob:onFixkit") -AddEventHandler("esx_mechanicjob:onFixkit", function() +RegisterNetEvent("esx_mechanicjob:onfixkit") +AddEventHandler("esx_mechanicjob:onfixkit", function() local playerPed = PlayerPedId() local coords = GetEntityCoords(playerPed) @@ -662,14 +579,6 @@ AddEventHandler("esx_mechanicjob:hasEnteredMarker", function(zone) CurrentAction = "mechanic_actions_menu" CurrentActionMsg = TranslateCap("open_actions") CurrentActionData = {} - elseif zone == "Garage" then - CurrentAction = "mechanic_harvest_menu" - CurrentActionMsg = TranslateCap("harvest_menu") - CurrentActionData = {} - elseif zone == "Craft" then - CurrentAction = "mechanic_craft_menu" - CurrentActionMsg = TranslateCap("craft_menu") - CurrentActionData = {} elseif zone == "VehicleDeleter" then local playerPed = PlayerPedId() @@ -684,53 +593,6 @@ AddEventHandler("esx_mechanicjob:hasEnteredMarker", function(zone) ESX.TextUI(CurrentActionMsg) end) -AddEventHandler("esx_mechanicjob:hasExitedMarker", function(zone) - if zone == "VehicleDelivery" then - NPCTargetDeleterZone = false - elseif zone == "Craft" then - TriggerServerEvent("esx_mechanicjob:stopCraft") - TriggerServerEvent("esx_mechanicjob:stopCraft2") - TriggerServerEvent("esx_mechanicjob:stopCraft3") - elseif zone == "Garage" then - TriggerServerEvent("esx_mechanicjob:stopHarvest") - TriggerServerEvent("esx_mechanicjob:stopHarvest2") - TriggerServerEvent("esx_mechanicjob:stopHarvest3") - end - - CurrentAction = nil - ESX.CloseContext() - ESX.HideUI() -end) - -AddEventHandler("esx_mechanicjob:hasEnteredEntityZone", function(entity) - local playerPed = PlayerPedId() - - if ESX.PlayerData.job and ESX.PlayerData.job.name == "mechanic" and not IsPedInAnyVehicle(playerPed, false) then - CurrentAction = "remove_entity" - CurrentActionMsg = TranslateCap("press_remove_obj") - CurrentActionData = { entity = entity } - ESX.TextUI(CurrentActionMsg) - end -end) - -AddEventHandler("esx_mechanicjob:hasExitedEntityZone", function(entity) - if CurrentAction == "remove_entity" then - CurrentAction = nil - end - ESX.HideUI() -end) - -RegisterNetEvent("esx_phone:loaded") -AddEventHandler("esx_phone:loaded", function(phoneNumber, contacts) - local specialContact = { - name = TranslateCap("mechanic"), - number = "mechanic", - base64Icon = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEwAACxMBAJqcGAAAA4BJREFUWIXtll9oU3cUx7/nJA02aSSlFouWMnXVB0ejU3wcRteHjv1puoc9rA978cUi2IqgRYWIZkMwrahUGfgkFMEZUdg6C+u21z1o3fbgqigVi7NzUtNcmsac40Npltz7S3rvUHzxQODec87vfD+/e0/O/QFv7Q0beV3QeXqmgV74/7H7fZJvuLwv8q/Xeux1gUrNBpN/nmtavdaqDqBK8VT2RDyV2VHmF1lvLERSBtCVynzYmcp+A9WqT9kcVKX4gHUehF0CEVY+1jYTTIwvt7YSIQnCTvsSUYz6gX5uDt7MP7KOKuQAgxmqQ+neUA+I1B1AiXi5X6ZAvKrabirmVYFwAMRT2RMg7F9SyKspvk73hfrtbkMPyIhA5FVqi0iBiEZMMQdAui/8E4GPv0oAJkpc6Q3+6goAAGpWBxNQmTLFmgL3jSJNgQdGv4pMts2EKm7ICJB/aG0xNdz74VEk13UYCx1/twPR8JjDT8wttyLZtkoAxSb8ZDCz0gdfKxWkFURf2v9qTYH7SK7rQIDn0P3nA0ehixvfwZwE0X9vBE/mW8piohhl1WH18UQBhYnre8N/L8b8xQvlx4ACbB4NnzaeRYDnKm0EALCMLXy84hwuTCXL/ExoB1E7qcK/8NCLIq5HcTT0i6u8TYbXUM1cAyyveVq8Xls7XhYrvY/4n3gC8C+dsmAzL1YUiyfWxvHzsy/w/dNd+KjhW2yvv/RfXr7x9QDcmo1he2RBiCCI1Q8jVj9szPNixVfgz+UiIGyDSrcoRu2J16d3I6e1VYvNSQjXpnucAcEPUOkGYZs/l4uUhowt/3kqu1UIv9n90fAY9jT3YBlbRvFTD4fw++wHjhiTRL/bG75t0jI2ITcHb5om4Xgmhv57xpGOg3d/NIqryOR7z+r+MC6qBJB/ZB2t9Om1D5lFm843G/3E3HI7Yh1xDRAfzLQr5EClBf/HBHK462TG2J0OABXeyWDPZ8VqxmBWYscpyghwtTd4EKpDTjCZdCNmzFM9k+4LHXIFACJN94Z6FiFEpKDQw9HndWsEuhnADVMhAUaYJBp9XrcGQKJ4qFE9k+6r2+MG3k5N8VQ22TVglbX2ZwOzX2VvNKr91zmY6S7N6zqZicVT2WNLyVSehESaBhxnOALfMeYX+K/S2yv7wmMAlvwyuR7FxQUyf0fgc/jztfkJr7XeGgC8BJJgWNV8ImT+AAAAAElFTkSuQmCC", - } - - TriggerEvent("esx_phone:addSpecialContact", specialContact.name, specialContact.number, specialContact.base64Icon) -end) - -- Pop NPC mission vehicle when inside area CreateThread(function() while true do @@ -789,13 +651,12 @@ CreateThread(function() if ESX.PlayerData.job and ESX.PlayerData.job.name == "mechanic" then Sleep = 500 - local coords, letSleep = GetEntityCoords(PlayerPedId()), true + local coords = GetEntityCoords(PlayerPedId()) - for k, v in pairs(Config.Zones) do + for _, v in pairs(Config.Zones) do if v.Type ~= -1 and #(coords - v.Pos) < Config.DrawDistance then Sleep = 0 DrawMarker(v.Type, v.Pos.x, v.Pos.y, v.Pos.z, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, v.Size.x, v.Size.y, v.Size.z, v.Color.r, v.Color.g, v.Color.b, 100, true, true, 2, true, nil, nil, false) - letSleep = false end end end @@ -836,49 +697,6 @@ CreateThread(function() end end) -CreateThread(function() - local trackedEntities = { - "prop_roadcone02a", - "prop_toolchest_01", - } - - while true do - Wait(500) - - local playerPed = PlayerPedId() - local coords = GetEntityCoords(playerPed) - - local closestDistance = -1 - local closestEntity = nil - - for i = 1, #trackedEntities, 1 do - local object = GetClosestObjectOfType(coords, 3.0, joaat(trackedEntities[i]), false, false, false) - - if DoesEntityExist(object) then - local objCoords = GetEntityCoords(object) - local distance = #(coords - objCoords) - - if closestDistance == -1 or closestDistance > distance then - closestDistance = distance - closestEntity = object - end - end - end - - if closestDistance ~= -1 and closestDistance <= 3.0 then - if LastEntity ~= closestEntity then - TriggerEvent("esx_mechanicjob:hasEnteredEntityZone", closestEntity) - LastEntity = closestEntity - end - else - if LastEntity then - TriggerEvent("esx_mechanicjob:hasExitedEntityZone", LastEntity) - LastEntity = nil - end - end - end -end) - -- Key Controls CreateThread(function() while true do @@ -888,10 +706,6 @@ CreateThread(function() if IsControlJustReleased(0, 38) and ESX.PlayerData.job and ESX.PlayerData.job.name == "mechanic" then if CurrentAction == "mechanic_actions_menu" then OpenMechanicActionsMenu() - elseif CurrentAction == "mechanic_harvest_menu" then - OpenMechanicHarvestMenu() - elseif CurrentAction == "mechanic_craft_menu" then - OpenMechanicCraftMenu() elseif CurrentAction == "delete_vehicle" then if Config.EnableSocietyOwnedVehicles then local vehicleProps = ESX.Game.GetVehicleProperties(CurrentActionData.vehicle) @@ -943,9 +757,6 @@ end, false) RegisterKeyMapping("mechanicMenu", "Open Mechanic Menu", "keyboard", Config.Controls.mechanicMenu) RegisterKeyMapping("mechanicjob", "Togggle NPC Job", "keyboard", Config.Controls.toggleNPCJob) -AddEventHandler("esx:onPlayerDeath", function(data) - isDead = true -end) -AddEventHandler("esx:onPlayerSpawn", function(spawn) - isDead = false -end) +AddEventHandler("esx:onPlayerDeath", function() end) + +AddEventHandler("esx:onPlayerSpawn", function() end) diff --git a/server-data/resources/[esx_addons]/esx_mechanicjob/config.lua b/server-data/resources/[esx_addons]/esx_mechanicjob/config.lua index 69a1851eb..78dde6a07 100644 --- a/server-data/resources/[esx_addons]/esx_mechanicjob/config.lua +++ b/server-data/resources/[esx_addons]/esx_mechanicjob/config.lua @@ -43,13 +43,6 @@ Config.Zones = { Type = 21, }, - Craft = { - Pos = vector3(-323.140, -129.882, 38.999), - Size = { x = 1.0, y = 1.0, z = 1.0 }, - Color = { r = 50, g = 200, b = 50 }, - Type = 21, - }, - VehicleSpawnPoint = { Pos = vector3(-366.354, -110.766, 37.696), Size = { x = 1.5, y = 1.5, z = 1.0 }, diff --git a/server-data/resources/[esx_addons]/esx_mechanicjob/esx_mechanicjob.sql b/server-data/resources/[esx_addons]/esx_mechanicjob/esx_mechanicjob.sql index e8deb2693..d73d6b38c 100644 --- a/server-data/resources/[esx_addons]/esx_mechanicjob/esx_mechanicjob.sql +++ b/server-data/resources/[esx_addons]/esx_mechanicjob/esx_mechanicjob.sql @@ -23,10 +23,7 @@ INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_ ; INSERT INTO `items` (name, label, weight) VALUES - ('gazbottle', 'bouteille de gaz', 2), ('fixtool', 'outils réparation', 2), ('carotool', 'outils carosserie', 2), - ('blowpipe', 'Chalumeaux', 2), - ('fixkit', 'Kit réparation', 3), - ('carokit', 'Kit carosserie', 3) + ('fixkit', 'Kit réparation', 3) ; diff --git a/server-data/resources/[esx_addons]/esx_mechanicjob/locales/en.lua b/server-data/resources/[esx_addons]/esx_mechanicjob/locales/en.lua index dc0ca2563..11f4d57a3 100644 --- a/server-data/resources/[esx_addons]/esx_mechanicjob/locales/en.lua +++ b/server-data/resources/[esx_addons]/esx_mechanicjob/locales/en.lua @@ -10,20 +10,13 @@ Locales["en"] = { ["boss_actions"] = "boss Actions", ["service_vehicle"] = "service Vehicle", ["flat_bed"] = "flatbed", + ["tow"] = "tow", ["tow_truck"] = "tow Truck", ["service_full"] = "service full: ", ["open_actions"] = "Press [E] to access the menu.", - ["harvest"] = "harvest", - ["harvest_menu"] = "press [E] to access the harvest menu.", - ["not_experienced_enough"] = "you are not experienced enough to perform this action.", - ["gas_can"] = "gas Can", ["repair_tools"] = "repair Tools", ["body_work_tools"] = "bodywork Tools", - ["blowtorch"] = "blowtorch", ["repair_kit"] = "repair Kit", - ["body_kit"] = "body Kit", - ["craft"] = "craft", - ["craft_menu"] = "press [E] to access the crafting menu.", ["billing"] = "billing", ["hijack"] = "hijack", ["repair"] = "repair", @@ -58,28 +51,13 @@ Locales["en"] = { ["inventory"] = "inventory", ["veh_unlocked"] = "Vehicle Unlocked", ["hijack_failed"] = "Hijack Failed", - ["body_repaired"] = "Body repaired", ["veh_repaired"] = "Vehicle Repaired", ["veh_stored"] = "press [E] to store the vehicle.", - ["press_remove_obj"] = "press [E] to remove the object", ["please_tow"] = "please tow the vehicle", ["wait_five"] = "you must wait 5 minutes", ["must_in_flatbed"] = "you must be in a flatbed to being the mission", - ["mechanic_customer"] = "mechanic Customer", - ["you_do_not_room"] = "You do not have more room", - ["recovery_gas_can"] = "Gas Can Retrieval...", - ["recovery_repair_tools"] = "Repair Tools Retrieval...", - ["recovery_body_tools"] = "Body Tools Retrieval...", - ["not_enough_gas_can"] = "You do not have enough gas cans.", - ["assembling_blowtorch"] = "Assembling Blowtorch...", - ["not_enough_repair_tools"] = "You do not have enough repair tools.", - ["assembling_repair_kit"] = "Assembling Repair Kit...", - ["not_enough_body_tools"] = "You do not have enough body tools.", - ["assembling_body_kit"] = "Assembling Body Kit...", ["your_comp_earned"] = "your company has earned $", - ["you_used_blowtorch"] = "you used a blowtorch", ["you_used_repair_kit"] = "you used a Repair Kit", - ["you_used_body_kit"] = "you used a Body Kit", ["have_withdrawn"] = "you have withdrawn x%s %s", ["have_deposited"] = "you have deposited x%s %s", ["player_cannot_hold"] = "you do not have enough free space in your inventory!", diff --git a/server-data/resources/[esx_addons]/esx_mechanicjob/locales/it.lua b/server-data/resources/[esx_addons]/esx_mechanicjob/locales/it.lua index e95df3426..a9219587b 100644 --- a/server-data/resources/[esx_addons]/esx_mechanicjob/locales/it.lua +++ b/server-data/resources/[esx_addons]/esx_mechanicjob/locales/it.lua @@ -9,23 +9,16 @@ Locales["it"] = { ["withdraw_stock"] = "ritira", ["boss_actions"] = "azioni boss", ["service_vehicle"] = "veicoli di servizio", - ["flat_bed"] = "flatbed", + ["flat_bed"] = "pianale", + ["tow"] = "carica/scarica", ["tow_truck"] = "carro attrezzi", ["service_full"] = "servizio completo: ", ["open_actions"] = "premi [E] per accedere al menu.", - ["harvest"] = "raccolto", - ["harvest_menu"] = "premi [E] per accedere al menu raccolto.", - ["not_experienced_enough"] = "non hai abbastanza esperienza per eseguire questa azione.", - ["gas_can"] = "bombola del gas", ["repair_tools"] = "riparazione strumenti", ["body_work_tools"] = "strumenti carrozzeria", - ["blowtorch"] = "fiamma ossidrica", ["repair_kit"] = "kit di riparazione", - ["body_kit"] = "body Kit", - ["craft"] = "creazione", - ["craft_menu"] = "premi [E] per accedere al menu di creazione.", ["billing"] = "fattura", - ["hijack"] = "trasportare", + ["hijack"] = "scassinare", ["repair"] = "riparazione", ["clean"] = "pulito", ["imp_veh"] = "sequestrato", @@ -58,29 +51,14 @@ Locales["it"] = { ["inventory"] = "inventario", ["veh_unlocked"] = "veicolo sbloccato", ["hijack_failed"] = "traino fallito", - ["body_repaired"] = "carrozzeria riparata", ["veh_repaired"] = "veicolo riparato", ["veh_stored"] = "press [E] per depositare il veicolo.", - ["press_remove_obj"] = "premi [E] per rimuovere", ["please_tow"] = "perfavore traina il veicolo", ["wait_five"] = "devi attendere 5 minuti", - ["must_in_flatbed"] = "devi essere in un flatbed per avviare la missione", - ["mechanic_customer"] = "cliente meccanico", - ["you_do_not_room"] = "non hai più spazio", - ["recovery_gas_can"] = "recupero bomboletta di gas...", - ["recovery_repair_tools"] = "recupero degli strumenti di riparazione...", - ["recovery_body_tools"] = "recupero body tools...", - ["not_enough_gas_can"] = "non hai abbastanza bomboletta di gas.", - ["assembling_blowtorch"] = "montaggio fiamma ossidrica...", - ["not_enough_repair_tools"] = "non hai abbastanza strumenti di riparazione.", - ["assembling_repair_kit"] = "assemblaggio kit di riparazione...", - ["not_enough_body_tools"] = "non hai abbastanza body tools.", - ["assembling_body_kit"] = "Assemblaggio Body Kit...", + ["must_in_flatbed"] = "devi essere nel pianale per avviare la missione", ["your_comp_earned"] = "la tua azienda ha guadagnato $", - ["you_used_blowtorch"] = "hai usato una fiamma ossidrica", ["you_used_repair_kit"] = "hai usato un Kit di riparazione", - ["you_used_body_kit"] = "hai usato un Body Kit", ["have_withdrawn"] = "hai prelevato x%s %s", ["have_deposited"] = "hai depositato x%s %s", - ["player_cannot_hold"] = "non hai abbastanza spazio libero nel tuo inventario!", + ["player_cannot_hold"] = "non hai abbastanza spazio nel tuo inventario!", } diff --git a/server-data/resources/[esx_addons]/esx_mechanicjob/localization/en_esx_mecanojob.sql b/server-data/resources/[esx_addons]/esx_mechanicjob/localization/en_esx_mecanojob.sql index ac1f7fb9c..c5663a3be 100644 --- a/server-data/resources/[esx_addons]/esx_mechanicjob/localization/en_esx_mecanojob.sql +++ b/server-data/resources/[esx_addons]/esx_mechanicjob/localization/en_esx_mecanojob.sql @@ -23,10 +23,7 @@ INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_ ; INSERT INTO `items` (name, label, weight) VALUES - ('gazbottle', 'Gas Bottle', 2), ('fixtool', 'Repair Tools', 2), ('carotool', 'Tools', 2), - ('blowpipe', 'Blowtorch', 2), - ('fixkit', 'Repair Kit', 3), - ('carokit', 'Body Kit', 3) + ('fixkit', 'Repair Kit', 3) ; diff --git a/server-data/resources/[esx_addons]/esx_mechanicjob/localization/it_esx_mecanojob.sql b/server-data/resources/[esx_addons]/esx_mechanicjob/localization/it_esx_mecanojob.sql index 4eb733e9c..48a434c35 100644 --- a/server-data/resources/[esx_addons]/esx_mechanicjob/localization/it_esx_mecanojob.sql +++ b/server-data/resources/[esx_addons]/esx_mechanicjob/localization/it_esx_mecanojob.sql @@ -23,11 +23,8 @@ INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_ ; INSERT INTO `items` (name, label, weight) VALUES - ('gazbottle', 'Bottiglia di gas', 2), ('fixtool', 'Strumenti di riparazione', 2), ('carotool', 'Strumenti', 2), - ('blowpipe', 'Fiamma ossidrica', 2), - ('fixkit', 'Kit di riparazione', 3), - ('carokit', 'Kit per carrozzeria', 3) + ('fixkit', 'Kit di riparazione', 3) ; diff --git a/server-data/resources/[esx_addons]/esx_mechanicjob/server/main.lua b/server-data/resources/[esx_addons]/esx_mechanicjob/server/main.lua index 339a8736f..9bc18efb4 100644 --- a/server-data/resources/[esx_addons]/esx_mechanicjob/server/main.lua +++ b/server-data/resources/[esx_addons]/esx_mechanicjob/server/main.lua @@ -1,194 +1,9 @@ -local PlayersHarvesting, PlayersHarvesting2, PlayersHarvesting3, PlayersCrafting, PlayersCrafting2, PlayersCrafting3 = {}, {}, {}, {}, {}, {} - if Config.MaxInService ~= -1 then TriggerEvent("esx_service:activateService", "mechanic", Config.MaxInService) end -TriggerEvent("esx_phone:registerNumber", "mechanic", TranslateCap("mechanic_customer"), true, true) TriggerEvent("esx_society:registerSociety", "mechanic", "mechanic", "society_mechanic", "society_mechanic", "society_mechanic", { type = "private" }) -local function Harvest(source) - SetTimeout(4000, function() - if PlayersHarvesting[source] == true then - local xPlayer = ESX.GetPlayerFromId(source) - local GazBottleQuantity = xPlayer.getInventoryItem("gazbottle").count - - if GazBottleQuantity >= 5 then - TriggerClientEvent("esx:showNotification", source, TranslateCap("you_do_not_room")) - else - xPlayer.addInventoryItem("gazbottle", 1) - Harvest(source) - end - end - end) -end - -RegisterServerEvent("esx_mechanicjob:startHarvest") -AddEventHandler("esx_mechanicjob:startHarvest", function() - local source = source - PlayersHarvesting[source] = true - TriggerClientEvent("esx:showNotification", source, TranslateCap("recovery_gas_can")) - Harvest(source) -end) - -RegisterServerEvent("esx_mechanicjob:stopHarvest") -AddEventHandler("esx_mechanicjob:stopHarvest", function() - local source = source - PlayersHarvesting[source] = false -end) - -local function Harvest2(source) - SetTimeout(4000, function() - if PlayersHarvesting2[source] == true then - local xPlayer = ESX.GetPlayerFromId(source) - local FixToolQuantity = xPlayer.getInventoryItem("fixtool").count - - if FixToolQuantity >= 5 then - TriggerClientEvent("esx:showNotification", source, TranslateCap("you_do_not_room")) - else - xPlayer.addInventoryItem("fixtool", 1) - Harvest2(source) - end - end - end) -end - -RegisterServerEvent("esx_mechanicjob:startHarvest2") -AddEventHandler("esx_mechanicjob:startHarvest2", function() - local source = source - PlayersHarvesting2[source] = true - TriggerClientEvent("esx:showNotification", source, TranslateCap("recovery_repair_tools")) - Harvest2(source) -end) - -RegisterServerEvent("esx_mechanicjob:stopHarvest2") -AddEventHandler("esx_mechanicjob:stopHarvest2", function() - local source = source - PlayersHarvesting2[source] = false -end) - -local function Harvest3(source) - SetTimeout(4000, function() - if PlayersHarvesting3[source] == true then - local xPlayer = ESX.GetPlayerFromId(source) - local CaroToolQuantity = xPlayer.getInventoryItem("carotool").count - if CaroToolQuantity >= 5 then - TriggerClientEvent("esx:showNotification", source, TranslateCap("you_do_not_room")) - else - xPlayer.addInventoryItem("carotool", 1) - Harvest3(source) - end - end - end) -end - -RegisterServerEvent("esx_mechanicjob:startHarvest3") -AddEventHandler("esx_mechanicjob:startHarvest3", function() - local source = source - PlayersHarvesting3[source] = true - TriggerClientEvent("esx:showNotification", source, TranslateCap("recovery_body_tools")) - Harvest3(source) -end) - -RegisterServerEvent("esx_mechanicjob:stopHarvest3") -AddEventHandler("esx_mechanicjob:stopHarvest3", function() - local source = source - PlayersHarvesting3[source] = false -end) - -local function Craft(source) - SetTimeout(4000, function() - if PlayersCrafting[source] == true then - local xPlayer = ESX.GetPlayerFromId(source) - local GazBottleQuantity = xPlayer.getInventoryItem("gazbottle").count - - if GazBottleQuantity <= 0 then - TriggerClientEvent("esx:showNotification", source, TranslateCap("not_enough_gas_can")) - else - xPlayer.removeInventoryItem("gazbottle", 1) - xPlayer.addInventoryItem("blowpipe", 1) - Craft(source) - end - end - end) -end - -RegisterServerEvent("esx_mechanicjob:startCraft") -AddEventHandler("esx_mechanicjob:startCraft", function() - local source = source - PlayersCrafting[source] = true - TriggerClientEvent("esx:showNotification", source, TranslateCap("assembling_blowtorch")) - Craft(source) -end) - -RegisterServerEvent("esx_mechanicjob:stopCraft") -AddEventHandler("esx_mechanicjob:stopCraft", function() - local source = source - PlayersCrafting[source] = false -end) - -local function Craft2(source) - SetTimeout(4000, function() - if PlayersCrafting2[source] == true then - local xPlayer = ESX.GetPlayerFromId(source) - local FixToolQuantity = xPlayer.getInventoryItem("fixtool").count - - if FixToolQuantity <= 0 then - TriggerClientEvent("esx:showNotification", source, TranslateCap("not_enough_repair_tools")) - else - xPlayer.removeInventoryItem("fixtool", 1) - xPlayer.addInventoryItem("fixkit", 1) - Craft2(source) - end - end - end) -end - -RegisterServerEvent("esx_mechanicjob:startCraft2") -AddEventHandler("esx_mechanicjob:startCraft2", function() - local source = source - PlayersCrafting2[source] = true - TriggerClientEvent("esx:showNotification", source, TranslateCap("assembling_repair_kit")) - Craft2(source) -end) - -RegisterServerEvent("esx_mechanicjob:stopCraft2") -AddEventHandler("esx_mechanicjob:stopCraft2", function() - local source = source - PlayersCrafting2[source] = false -end) - -local function Craft3(source) - SetTimeout(4000, function() - if PlayersCrafting3[source] == true then - local xPlayer = ESX.GetPlayerFromId(source) - local CaroToolQuantity = xPlayer.getInventoryItem("carotool").count - - if CaroToolQuantity <= 0 then - TriggerClientEvent("esx:showNotification", source, TranslateCap("not_enough_body_tools")) - else - xPlayer.removeInventoryItem("carotool", 1) - xPlayer.addInventoryItem("carokit", 1) - Craft3(source) - end - end - end) -end - -RegisterServerEvent("esx_mechanicjob:startCraft3") -AddEventHandler("esx_mechanicjob:startCraft3", function() - local source = source - PlayersCrafting3[source] = true - TriggerClientEvent("esx:showNotification", source, TranslateCap("assembling_body_kit")) - Craft3(source) -end) - -RegisterServerEvent("esx_mechanicjob:stopCraft3") -AddEventHandler("esx_mechanicjob:stopCraft3", function() - local source = source - PlayersCrafting3[source] = false -end) - RegisterServerEvent("esx_mechanicjob:onNPCJobMissionCompleted") AddEventHandler("esx_mechanicjob:onNPCJobMissionCompleted", function() local source = source @@ -206,36 +21,16 @@ AddEventHandler("esx_mechanicjob:onNPCJobMissionCompleted", function() TriggerClientEvent("esx:showNotification", source, TranslateCap("your_comp_earned") .. total) end) -ESX.RegisterUsableItem("blowpipe", function(source) - local source = source - local xPlayer = ESX.GetPlayerFromId(source) - - xPlayer.removeInventoryItem("blowpipe", 1) - - TriggerClientEvent("esx_mechanicjob:onHijack", source) - TriggerClientEvent("esx:showNotification", source, TranslateCap("you_used_blowtorch")) -end) - ESX.RegisterUsableItem("fixkit", function(source) - local source = source + local _ = source local xPlayer = ESX.GetPlayerFromId(source) xPlayer.removeInventoryItem("fixkit", 1) - TriggerClientEvent("esx_mechanicjob:onFixkit", source) + TriggerClientEvent("esx_mechanicjob:onfixkit", source) TriggerClientEvent("esx:showNotification", source, TranslateCap("you_used_repair_kit")) end) -ESX.RegisterUsableItem("carokit", function(source) - local source = source - local xPlayer = ESX.GetPlayerFromId(source) - - xPlayer.removeInventoryItem("carokit", 1) - - TriggerClientEvent("esx_mechanicjob:onCarokit", source) - TriggerClientEvent("esx:showNotification", source, TranslateCap("you_used_body_kit")) -end) - RegisterServerEvent("esx_mechanicjob:getStockItem") AddEventHandler("esx_mechanicjob:getStockItem", function(itemName, count) local xPlayer = ESX.GetPlayerFromId(source) @@ -259,7 +54,7 @@ AddEventHandler("esx_mechanicjob:getStockItem", function(itemName, count) end) end) -ESX.RegisterServerCallback("esx_mechanicjob:getStockItems", function(source, cb) +ESX.RegisterServerCallback("esx_mechanicjob:getStockItems", function(_, cb) TriggerEvent("bpt_addoninventory:getSharedInventory", "society_mechanic", function(inventory) cb(inventory.items) end) diff --git a/server-data/resources/[ox]/ox_inventory/data/items.lua b/server-data/resources/[ox]/ox_inventory/data/items.lua index a91ba340e..349b1b442 100644 --- a/server-data/resources/[ox]/ox_inventory/data/items.lua +++ b/server-data/resources/[ox]/ox_inventory/data/items.lua @@ -338,8 +338,7 @@ return { ["fixkit"] = { label = "kit di riparazione", - weight = 100, - consume = 1, + weight = 3, stack = true, close = true, },