From f9cd4f7ebcb680021bde868aa66ae14609d65b52 Mon Sep 17 00:00:00 2001 From: Romain Lanz Date: Thu, 14 Sep 2017 18:04:21 +0200 Subject: [PATCH] chore(coding-style): correct indentation --- .editorconfig | 9 + __resource.lua | 20 +- client/main.lua | 1495 +++++++++++++++-------------- config.lua | 180 ++-- esx_mecanojob.sql | 14 +- locales/en.lua | 161 ++-- locales/fr.lua | 161 ++-- localization/esx_mecanojob_en.sql | 12 +- server/main.lua | 302 +++--- 9 files changed, 1179 insertions(+), 1175 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..41c2aaf2 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +indent_size = 2 +indent_style = space +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true \ No newline at end of file diff --git a/__resource.lua b/__resource.lua index ed54f8fb..fd64bbc2 100644 --- a/__resource.lua +++ b/__resource.lua @@ -3,17 +3,17 @@ resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' description 'ESX Mecano Job' client_scripts { - '@es_extended/locale.lua', - 'locales/en.lua', - 'locales/fr.lua', - 'config.lua', - 'client/main.lua' + '@es_extended/locale.lua', + 'locales/en.lua', + 'locales/fr.lua', + 'config.lua', + 'client/main.lua' } server_scripts { - '@es_extended/locale.lua', - 'locales/en.lua', - 'locales/fr.lua', - 'config.lua', - 'server/main.lua' + '@es_extended/locale.lua', + 'locales/en.lua', + 'locales/fr.lua', + 'config.lua', + 'server/main.lua' } diff --git a/client/main.lua b/client/main.lua index 5b9cd4ad..9fb72829 100644 --- a/client/main.lua +++ b/client/main.lua @@ -10,10 +10,8 @@ local Keys = { ["NENTER"] = 201, ["N4"] = 108, ["N5"] = 60, ["N6"] = 107, ["N+"] = 96, ["N-"] = 97, ["N7"] = 117, ["N8"] = 61, ["N9"] = 118 } -ESX = nil local PlayerData = {} local GUI = {} -GUI.Time = 0 local HasAlreadyEnteredMarker = false local LastZone = nil local CurrentAction = nil @@ -30,11 +28,14 @@ local NPCHasSpawnedTowable = false local NPCLastCancel = GetGameTimer() - 5 * 60000 local NPCHasBeenNextToTowable = false +ESX = nil +GUI.Time = 0 + Citizen.CreateThread(function() - while ESX == nil do - TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) - Citizen.Wait(0) - end + while ESX == nil do + TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) + Citizen.Wait(0) + end end) function SelectRandomTowable() @@ -81,7 +82,7 @@ function StopNPCJob(cancel) NPCTargetTowable = nil NPCTargetTowableZone = nil NPCHasSpawnedTowable = false - NPCHasBeenNextToTowable = false + NPCHasBeenNextToTowable = false if cancel then ESX.ShowNotification(_U('mission_canceled')) @@ -93,604 +94,604 @@ end function OpenMecanoActionsMenu() - local elements = { - {label = _U('vehicle_list'), value = 'vehicle_list'}, - {label = _U('work_wear'), value = 'cloakroom'}, - {label = _U('civ_wear'), value = 'cloakroom2'}, - {label = _U('deposit_stock'), value = 'put_stock'}, - {label = _U('withdraw_stock'), value = 'get_stock'} - } - if Config.EnablePlayerManagement and PlayerData.job ~= nil and PlayerData.job.grade_name == 'boss' then - table.insert(elements, {label = _U('boss_actions'), value = 'boss_actions'}) - end + local elements = { + {label = _U('vehicle_list'), value = 'vehicle_list'}, + {label = _U('work_wear'), value = 'cloakroom'}, + {label = _U('civ_wear'), value = 'cloakroom2'}, + {label = _U('deposit_stock'), value = 'put_stock'}, + {label = _U('withdraw_stock'), value = 'get_stock'} + } + if Config.EnablePlayerManagement and PlayerData.job ~= nil and PlayerData.job.grade_name == 'boss' then + table.insert(elements, {label = _U('boss_actions'), value = 'boss_actions'}) + end - ESX.UI.Menu.CloseAll() + ESX.UI.Menu.CloseAll() - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'mecano_actions', - { - title = _U('mechanic'), - elements = elements - }, - function(data, menu) - if data.current.value == 'vehicle_list' then + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'mecano_actions', + { + title = _U('mechanic'), + elements = elements + }, + function(data, menu) + if data.current.value == 'vehicle_list' then - if Config.EnableSocietyOwnedVehicles then + if Config.EnableSocietyOwnedVehicles then - local elements = {} + local elements = {} - ESX.TriggerServerCallback('esx_society:getVehiclesInGarage', function(vehicles) + ESX.TriggerServerCallback('esx_society:getVehiclesInGarage', function(vehicles) - for i=1, #vehicles, 1 do - table.insert(elements, {label = GetDisplayNameFromVehicleModel(vehicles[i].model) .. ' [' .. vehicles[i].plate .. ']', value = vehicles[i]}) - end + for i=1, #vehicles, 1 do + table.insert(elements, {label = GetDisplayNameFromVehicleModel(vehicles[i].model) .. ' [' .. vehicles[i].plate .. ']', value = vehicles[i]}) + end - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'vehicle_spawner', - { - title = _U('service_vehicle'), - align = 'top-left', - elements = elements, - }, - function(data, menu) + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'vehicle_spawner', + { + title = _U('service_vehicle'), + align = 'top-left', + elements = elements, + }, + function(data, menu) - menu.close() + menu.close() - local vehicleProps = data.current.value + local vehicleProps = data.current.value - ESX.Game.SpawnVehicle(vehicleProps.model, Config.Zones.VehicleSpawnPoint.Pos, 270.0, function(vehicle) - ESX.Game.SetVehicleProperties(vehicle, vehicleProps) - local playerPed = GetPlayerPed(-1) - TaskWarpPedIntoVehicle(playerPed, vehicle, -1) - end) + ESX.Game.SpawnVehicle(vehicleProps.model, Config.Zones.VehicleSpawnPoint.Pos, 270.0, function(vehicle) + ESX.Game.SetVehicleProperties(vehicle, vehicleProps) + local playerPed = GetPlayerPed(-1) + TaskWarpPedIntoVehicle(playerPed, vehicle, -1) + end) - TriggerServerEvent('esx_society:removeVehicleFromGarage', 'mecano', vehicleProps) + TriggerServerEvent('esx_society:removeVehicleFromGarage', 'mecano', vehicleProps) - end, - function(data, menu) - menu.close() - end - ) + end, + function(data, menu) + menu.close() + end + ) - end, 'mecano') + end, 'mecano') - else + else - local elements = { - {label = _U('flat_bed'), value = 'flatbed'}, - {label = _U('tow_truck'), value = 'towtruck2'} - } + local elements = { + {label = _U('flat_bed'), value = 'flatbed'}, + {label = _U('tow_truck'), value = 'towtruck2'} + } - if Config.EnablePlayerManagement and PlayerData.job ~= nil and - (PlayerData.job.grade_name == 'boss' or PlayerData.job.grade_name == 'chef' or PlayerData.job.grade_name == 'experimente') then - table.insert(elements, {label = 'SlamVan', value = 'slamvan3'}) - end + if Config.EnablePlayerManagement and PlayerData.job ~= nil and + (PlayerData.job.grade_name == 'boss' or PlayerData.job.grade_name == 'chef' or PlayerData.job.grade_name == 'experimente') then + table.insert(elements, {label = 'SlamVan', value = 'slamvan3'}) + end - ESX.UI.Menu.CloseAll() + ESX.UI.Menu.CloseAll() - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'spawn_vehicle', - { - title = _U('service_vehicle'), - elements = elements - }, - function(data, menu) - for i=1, #elements, 1 do - if Config.MaxInService == -1 then - ESX.Game.SpawnVehicle(data.current.value, Config.Zones.VehicleSpawnPoint.Pos, 90.0, function(vehicle) - local playerPed = GetPlayerPed(-1) - TaskWarpPedIntoVehicle(playerPed, vehicle, -1) - end) - break - else - ESX.TriggerServerCallback('esx_service:enableService', function(canTakeService, maxInService, inServiceCount) - if canTakeService then - ESX.Game.SpawnVehicle(data.current.value, Config.Zones.VehicleSpawnPoint.Pos, 90.0, function(vehicle) - local playerPed = GetPlayerPed(-1) - TaskWarpPedIntoVehicle(playerPed, vehicle, -1) - end) - else - ESX.ShowNotification(_U('service_full') .. inServiceCount .. '/' .. maxInService) - end - end, 'mecano') - break - end - end - menu.close() - end, - function(data, menu) - menu.close() - OpenMecanoActionsMenu() - end - ) + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'spawn_vehicle', + { + title = _U('service_vehicle'), + elements = elements + }, + function(data, menu) + for i=1, #elements, 1 do + if Config.MaxInService == -1 then + ESX.Game.SpawnVehicle(data.current.value, Config.Zones.VehicleSpawnPoint.Pos, 90.0, function(vehicle) + local playerPed = GetPlayerPed(-1) + TaskWarpPedIntoVehicle(playerPed, vehicle, -1) + end) + break + else + ESX.TriggerServerCallback('esx_service:enableService', function(canTakeService, maxInService, inServiceCount) + if canTakeService then + ESX.Game.SpawnVehicle(data.current.value, Config.Zones.VehicleSpawnPoint.Pos, 90.0, function(vehicle) + local playerPed = GetPlayerPed(-1) + TaskWarpPedIntoVehicle(playerPed, vehicle, -1) + end) + else + ESX.ShowNotification(_U('service_full') .. inServiceCount .. '/' .. maxInService) + end + end, 'mecano') + break + end + end + menu.close() + end, + function(data, menu) + menu.close() + OpenMecanoActionsMenu() + end + ) - end - end + end + end - if data.current.value == 'cloakroom' then - menu.close() - ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) + if data.current.value == 'cloakroom' then + menu.close() + ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) - if skin.sex == 0 then - TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_male) - else - TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_female) - end + if skin.sex == 0 then + TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_male) + else + TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_female) + end - end) - end + end) + end - if data.current.value == 'cloakroom2' then - menu.close() - ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) + if data.current.value == 'cloakroom2' then + menu.close() + ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) - TriggerEvent('skinchanger:loadSkin', skin) + TriggerEvent('skinchanger:loadSkin', skin) - end) - end + end) + end - if data.current.value == 'put_stock' then - OpenPutStocksMenu() - end + if data.current.value == 'put_stock' then + OpenPutStocksMenu() + end - if data.current.value == 'get_stock' then - OpenGetStocksMenu() - end + if data.current.value == 'get_stock' then + OpenGetStocksMenu() + end - if data.current.value == 'boss_actions' then - TriggerEvent('esx_society:openBossMenu', 'mecano', function(data, menu) - menu.close() - end) - end + if data.current.value == 'boss_actions' then + TriggerEvent('esx_society:openBossMenu', 'mecano', function(data, menu) + menu.close() + end) + end - end, - function(data, menu) - menu.close() - CurrentAction = 'mecano_actions_menu' - CurrentActionMsg = _U('open_actions') - CurrentActionData = {} - end - ) + end, + function(data, menu) + menu.close() + CurrentAction = 'mecano_actions_menu' + CurrentActionMsg = _U('open_actions') + CurrentActionData = {} + end + ) end function OpenMecanoHarvestMenu() - if Config.EnablePlayerManagement and PlayerData.job ~= nil and PlayerData.job.grade_name ~= 'recrue' then - local elements = { - {label = _U('gas_can'), value = 'gaz_bottle'}, - {label = _U('repair_tools'), value = 'fix_tool'}, - {label = _U('body_work_tools'), value = 'caro_tool'} - } + if Config.EnablePlayerManagement and PlayerData.job ~= nil and PlayerData.job.grade_name ~= 'recrue' then + local elements = { + {label = _U('gas_can'), value = 'gaz_bottle'}, + {label = _U('repair_tools'), value = 'fix_tool'}, + {label = _U('body_work_tools'), value = 'caro_tool'} + } - ESX.UI.Menu.CloseAll() + ESX.UI.Menu.CloseAll() - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'mecano_harvest', - { - title = _U('harvest'), - elements = elements - }, - function(data, menu) - if data.current.value == 'gaz_bottle' then - menu.close() - TriggerServerEvent('esx_mecanojob:startHarvest') - end + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'mecano_harvest', + { + title = _U('harvest'), + elements = elements + }, + function(data, menu) + if data.current.value == 'gaz_bottle' then + menu.close() + TriggerServerEvent('esx_mecanojob:startHarvest') + end - if data.current.value == 'fix_tool' then - menu.close() - TriggerServerEvent('esx_mecanojob:startHarvest2') - end + if data.current.value == 'fix_tool' then + menu.close() + TriggerServerEvent('esx_mecanojob:startHarvest2') + end - if data.current.value == 'caro_tool' then - menu.close() - TriggerServerEvent('esx_mecanojob:startHarvest3') - end + if data.current.value == 'caro_tool' then + menu.close() + TriggerServerEvent('esx_mecanojob:startHarvest3') + end - end, - function(data, menu) - menu.close() - CurrentAction = 'mecano_harvest_menu' - CurrentActionMsg = _U('harvest_menu') - CurrentActionData = {} - end - ) - else - ESX.ShowNotification(_U('not_experienced_enough')) - end + end, + function(data, menu) + menu.close() + CurrentAction = 'mecano_harvest_menu' + CurrentActionMsg = _U('harvest_menu') + CurrentActionData = {} + end + ) + else + ESX.ShowNotification(_U('not_experienced_enough')) + end end function OpenMecanoCraftMenu() - if Config.EnablePlayerManagement and PlayerData.job ~= nil and PlayerData.job.grade_name ~= 'recrue' then + if Config.EnablePlayerManagement and PlayerData.job ~= nil and PlayerData.job.grade_name ~= 'recrue' then - local elements = { - {label = _U('blowtorch'), value = 'blow_pipe'}, - {label = _U('repair_kit'), value = 'fix_kit'}, - {label = _U('body_kit'), value = 'caro_kit'} - } + local elements = { + {label = _U('blowtorch'), value = 'blow_pipe'}, + {label = _U('repair_kit'), value = 'fix_kit'}, + {label = _U('body_kit'), value = 'caro_kit'} + } - ESX.UI.Menu.CloseAll() + ESX.UI.Menu.CloseAll() - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'mecano_craft', - { - title = _U('craft'), - elements = elements - }, - function(data, menu) - if data.current.value == 'blow_pipe' then - menu.close() - TriggerServerEvent('esx_mecanojob:startCraft') - end + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'mecano_craft', + { + title = _U('craft'), + elements = elements + }, + function(data, menu) + if data.current.value == 'blow_pipe' then + menu.close() + TriggerServerEvent('esx_mecanojob:startCraft') + end - if data.current.value == 'fix_kit' then - menu.close() - TriggerServerEvent('esx_mecanojob:startCraft2') - end + if data.current.value == 'fix_kit' then + menu.close() + TriggerServerEvent('esx_mecanojob:startCraft2') + end - if data.current.value == 'caro_kit' then - menu.close() - TriggerServerEvent('esx_mecanojob:startCraft3') - end + if data.current.value == 'caro_kit' then + menu.close() + TriggerServerEvent('esx_mecanojob:startCraft3') + end - end, - function(data, menu) - menu.close() - CurrentAction = 'mecano_craft_menu' - CurrentActionMsg = _U('craft_menu') - CurrentActionData = {} - end - ) - else - ESX.ShowNotification(_U('not_experienced_enough')) - end + end, + function(data, menu) + menu.close() + CurrentAction = 'mecano_craft_menu' + CurrentActionMsg = _U('craft_menu') + CurrentActionData = {} + end + ) + else + ESX.ShowNotification(_U('not_experienced_enough')) + end end function OpenMobileMecanoActionsMenu() - ESX.UI.Menu.CloseAll() + ESX.UI.Menu.CloseAll() - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'mobile_mecano_actions', - { - title = _U('mechanic'), - elements = { - {label = _U('billing'), value = 'billing'}, - {label = _U('hijack'), value = 'hijack_vehicle'}, - {label = _U('repair'), value = 'fix_vehicle'}, - {label = _U('clean'), value = 'clean_vehicle'}, - {label = _U('imp_veh'), value = 'del_vehicle'}, - {label = _U('flat_bed'), value = 'dep_vehicle'}, - {label = _U('place_objects'), value = 'object_spawner'} - } - }, - function(data, menu) - if data.current.value == 'billing' then - ESX.UI.Menu.Open( - 'dialog', GetCurrentResourceName(), 'billing', - { - title = _U('invoice_amount') - }, - function(data, menu) - local amount = tonumber(data.value) - if amount == nil then - ESX.ShowNotification(_U('amount_invalid')) - else - menu.close() - local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer() - if closestPlayer == -1 or closestDistance > 3.0 then - ESX.ShowNotification(_U('no_players_nearby')) - else - TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(closestPlayer), 'society_mecano', _U('mechanic'), amount) - end - end - end, - function(data, menu) - menu.close() - end - ) - end + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'mobile_mecano_actions', + { + title = _U('mechanic'), + elements = { + {label = _U('billing'), value = 'billing'}, + {label = _U('hijack'), value = 'hijack_vehicle'}, + {label = _U('repair'), value = 'fix_vehicle'}, + {label = _U('clean'), value = 'clean_vehicle'}, + {label = _U('imp_veh'), value = 'del_vehicle'}, + {label = _U('flat_bed'), value = 'dep_vehicle'}, + {label = _U('place_objects'), value = 'object_spawner'} + } + }, + function(data, menu) + if data.current.value == 'billing' then + ESX.UI.Menu.Open( + 'dialog', GetCurrentResourceName(), 'billing', + { + title = _U('invoice_amount') + }, + function(data, menu) + local amount = tonumber(data.value) + if amount == nil then + ESX.ShowNotification(_U('amount_invalid')) + else + menu.close() + local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer() + if closestPlayer == -1 or closestDistance > 3.0 then + ESX.ShowNotification(_U('no_players_nearby')) + else + TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(closestPlayer), 'society_mecano', _U('mechanic'), amount) + end + end + end, + function(data, menu) + menu.close() + end + ) + end - if data.current.value == 'hijack_vehicle' then + if data.current.value == 'hijack_vehicle' then - local playerPed = GetPlayerPed(-1) - local coords = GetEntityCoords(playerPed) + local playerPed = GetPlayerPed(-1) + local coords = GetEntityCoords(playerPed) - if IsAnyVehicleNearPoint(coords.x, coords.y, coords.z, 5.0) then + if IsAnyVehicleNearPoint(coords.x, coords.y, coords.z, 5.0) then - local vehicle = nil + local vehicle = nil - if IsPedInAnyVehicle(playerPed, false) then - vehicle = GetVehiclePedIsIn(playerPed, false) - else - vehicle = GetClosestVehicle(coords.x, coords.y, coords.z, 5.0, 0, 71) - end + if IsPedInAnyVehicle(playerPed, false) then + vehicle = GetVehiclePedIsIn(playerPed, false) + else + vehicle = GetClosestVehicle(coords.x, coords.y, coords.z, 5.0, 0, 71) + end - if DoesEntityExist(vehicle) then - TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_WELDING", 0, true) - Citizen.CreateThread(function() - Citizen.Wait(10000) - SetVehicleDoorsLocked(vehicle, 1) - SetVehicleDoorsLockedForAllPlayers(vehicle, false) - ClearPedTasksImmediately(playerPed) - ESX.ShowNotification(_U('vehicle_unlocked')) - end) - end + if DoesEntityExist(vehicle) then + TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_WELDING", 0, true) + Citizen.CreateThread(function() + Citizen.Wait(10000) + SetVehicleDoorsLocked(vehicle, 1) + SetVehicleDoorsLockedForAllPlayers(vehicle, false) + ClearPedTasksImmediately(playerPed) + ESX.ShowNotification(_U('vehicle_unlocked')) + end) + end - end + end - end + end - if data.current.value == 'fix_vehicle' then + if data.current.value == 'fix_vehicle' then - local playerPed = GetPlayerPed(-1) - local coords = GetEntityCoords(playerPed) + local playerPed = GetPlayerPed(-1) + local coords = GetEntityCoords(playerPed) - if IsAnyVehicleNearPoint(coords.x, coords.y, coords.z, 5.0) then + if IsAnyVehicleNearPoint(coords.x, coords.y, coords.z, 5.0) then - local vehicle = nil + local vehicle = nil - if IsPedInAnyVehicle(playerPed, false) then - vehicle = GetVehiclePedIsIn(playerPed, false) - else - vehicle = GetClosestVehicle(coords.x, coords.y, coords.z, 5.0, 0, 71) - end + if IsPedInAnyVehicle(playerPed, false) then + vehicle = GetVehiclePedIsIn(playerPed, false) + else + vehicle = GetClosestVehicle(coords.x, coords.y, coords.z, 5.0, 0, 71) + end - if DoesEntityExist(vehicle) then - TaskStartScenarioInPlace(playerPed, "PROP_HUMAN_BUM_BIN", 0, true) - Citizen.CreateThread(function() - Citizen.Wait(20000) - SetVehicleFixed(vehicle) - SetVehicleDeformationFixed(vehicle) - SetVehicleUndriveable(vehicle, false) - SetVehicleEngineOn(vehicle, true, true) - ClearPedTasksImmediately(playerPed) - ESX.ShowNotification(_U('vehicle_repaired')) - end) - end - end - end + if DoesEntityExist(vehicle) then + TaskStartScenarioInPlace(playerPed, "PROP_HUMAN_BUM_BIN", 0, true) + Citizen.CreateThread(function() + Citizen.Wait(20000) + SetVehicleFixed(vehicle) + SetVehicleDeformationFixed(vehicle) + SetVehicleUndriveable(vehicle, false) + SetVehicleEngineOn(vehicle, true, true) + ClearPedTasksImmediately(playerPed) + ESX.ShowNotification(_U('vehicle_repaired')) + end) + end + end + end - if data.current.value == 'clean_vehicle' then + if data.current.value == 'clean_vehicle' then - local playerPed = GetPlayerPed(-1) - local coords = GetEntityCoords(playerPed) + local playerPed = GetPlayerPed(-1) + local coords = GetEntityCoords(playerPed) - if IsAnyVehicleNearPoint(coords.x, coords.y, coords.z, 5.0) then + if IsAnyVehicleNearPoint(coords.x, coords.y, coords.z, 5.0) then - local vehicle = nil + local vehicle = nil - if IsPedInAnyVehicle(playerPed, false) then - vehicle = GetVehiclePedIsIn(playerPed, false) - else - vehicle = GetClosestVehicle(coords.x, coords.y, coords.z, 5.0, 0, 71) - end + if IsPedInAnyVehicle(playerPed, false) then + vehicle = GetVehiclePedIsIn(playerPed, false) + else + vehicle = GetClosestVehicle(coords.x, coords.y, coords.z, 5.0, 0, 71) + end - if DoesEntityExist(vehicle) then - TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_MAID_CLEAN", 0, true) - Citizen.CreateThread(function() - Citizen.Wait(10000) - SetVehicleDirtLevel(vehicle, 0) - ClearPedTasksImmediately(playerPed) - ESX.ShowNotification(_U('vehicle_cleaned')) - end) - end - end - end + if DoesEntityExist(vehicle) then + TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_MAID_CLEAN", 0, true) + Citizen.CreateThread(function() + Citizen.Wait(10000) + SetVehicleDirtLevel(vehicle, 0) + ClearPedTasksImmediately(playerPed) + ESX.ShowNotification(_U('vehicle_cleaned')) + end) + end + end + end - if data.current.value == 'del_vehicle' then + if data.current.value == 'del_vehicle' then - local ped = GetPlayerPed( -1 ) + local ped = GetPlayerPed( -1 ) - if ( DoesEntityExist( ped ) and not IsEntityDead( ped ) ) then - local pos = GetEntityCoords( ped ) + if ( DoesEntityExist( ped ) and not IsEntityDead( ped ) ) then + local pos = GetEntityCoords( ped ) - if ( IsPedSittingInAnyVehicle( ped ) ) then - local vehicle = GetVehiclePedIsIn( ped, false ) + if ( IsPedSittingInAnyVehicle( ped ) ) then + local vehicle = GetVehiclePedIsIn( ped, false ) - if ( GetPedInVehicleSeat( vehicle, -1 ) == ped ) then - ESX.ShowNotification(_U('vehicle_impounded')) - SetEntityAsMissionEntity( vehicle, true, true ) - deleteCar( vehicle ) - else - ESX.ShowNotification(_U('must_seat_driver')) - end - else - local playerPos = GetEntityCoords( ped, 1 ) - local inFrontOfPlayer = GetOffsetFromEntityInWorldCoords( ped, 0.0, distanceToCheck, 0.0 ) - local vehicle = GetVehicleInDirection( playerPos, inFrontOfPlayer ) + if ( GetPedInVehicleSeat( vehicle, -1 ) == ped ) then + ESX.ShowNotification(_U('vehicle_impounded')) + SetEntityAsMissionEntity( vehicle, true, true ) + deleteCar( vehicle ) + else + ESX.ShowNotification(_U('must_seat_driver')) + end + else + local playerPos = GetEntityCoords( ped, 1 ) + local inFrontOfPlayer = GetOffsetFromEntityInWorldCoords( ped, 0.0, distanceToCheck, 0.0 ) + local vehicle = GetVehicleInDirection( playerPos, inFrontOfPlayer ) - if ( DoesEntityExist( vehicle ) ) then - ESX.ShowNotification(_U('vehicle_impounded')) - SetEntityAsMissionEntity( vehicle, true, true ) - deleteCar( vehicle ) - else - ESX.ShowNotification(_U('must_near')) - end - end - end - end + if ( DoesEntityExist( vehicle ) ) then + ESX.ShowNotification(_U('vehicle_impounded')) + SetEntityAsMissionEntity( vehicle, true, true ) + deleteCar( vehicle ) + else + ESX.ShowNotification(_U('must_near')) + end + end + end + end - if data.current.value == 'dep_vehicle' then + if data.current.value == 'dep_vehicle' then - local playerped = GetPlayerPed(-1) - local vehicle = GetVehiclePedIsIn(playerped, true) + local playerped = GetPlayerPed(-1) + local vehicle = GetVehiclePedIsIn(playerped, true) - local towmodel = GetHashKey('flatbed') - local isVehicleTow = IsVehicleModel(vehicle, towmodel) + local towmodel = GetHashKey('flatbed') + local isVehicleTow = IsVehicleModel(vehicle, towmodel) - if isVehicleTow then + if isVehicleTow then - local coordA = GetEntityCoords(playerped, 1) - local coordB = GetOffsetFromEntityInWorldCoords(playerped, 0.0, 5.0, 0.0) - local targetVehicle = getVehicleInDirection(coordA, coordB) + local coordA = GetEntityCoords(playerped, 1) + local coordB = GetOffsetFromEntityInWorldCoords(playerped, 0.0, 5.0, 0.0) + local targetVehicle = getVehicleInDirection(coordA, coordB) - if CurrentlyTowedVehicle == nil then - if targetVehicle ~= 0 then - if not IsPedInAnyVehicle(playerped, true) then - if vehicle ~= targetVehicle then - AttachEntityToEntity(targetVehicle, vehicle, 20, -0.5, -5.0, 1.0, 0.0, 0.0, 0.0, false, false, false, false, 20, true) - CurrentlyTowedVehicle = targetVehicle - ESX.ShowNotification(_U('vehicle_success_attached')) + if CurrentlyTowedVehicle == nil then + if targetVehicle ~= 0 then + if not IsPedInAnyVehicle(playerped, true) then + if vehicle ~= targetVehicle then + AttachEntityToEntity(targetVehicle, vehicle, 20, -0.5, -5.0, 1.0, 0.0, 0.0, 0.0, false, false, false, false, 20, true) + CurrentlyTowedVehicle = targetVehicle + ESX.ShowNotification(_U('vehicle_success_attached')) - if NPCOnJob then + if NPCOnJob then - if NPCTargetTowable == targetVehicle then - ESX.ShowNotification(_U('please_drop_off')) + if NPCTargetTowable == targetVehicle then + ESX.ShowNotification(_U('please_drop_off')) - Config.Zones.VehicleDelivery.Type = 1 + Config.Zones.VehicleDelivery.Type = 1 - if Blips['NPCTargetTowableZone'] ~= nil then - RemoveBlip(Blips['NPCTargetTowableZone']) - Blips['NPCTargetTowableZone'] = nil - end + if Blips['NPCTargetTowableZone'] ~= nil then + RemoveBlip(Blips['NPCTargetTowableZone']) + Blips['NPCTargetTowableZone'] = nil + end - Blips['NPCDelivery'] = AddBlipForCoord(Config.Zones.VehicleDelivery.Pos.x, Config.Zones.VehicleDelivery.Pos.y, Config.Zones.VehicleDelivery.Pos.z) + Blips['NPCDelivery'] = AddBlipForCoord(Config.Zones.VehicleDelivery.Pos.x, Config.Zones.VehicleDelivery.Pos.y, Config.Zones.VehicleDelivery.Pos.z) - SetBlipRoute(Blips['NPCDelivery'], true) + SetBlipRoute(Blips['NPCDelivery'], true) - end + end - end + end - else - ESX.ShowNotification(_U('cant_attach_own_tt')) - end - end - else - ESX.ShowNotification(_U('no_veh_att')) - end - else + else + ESX.ShowNotification(_U('cant_attach_own_tt')) + end + end + else + ESX.ShowNotification(_U('no_veh_att')) + end + else - AttachEntityToEntity(CurrentlyTowedVehicle, vehicle, 20, -0.5, -12.0, 1.0, 0.0, 0.0, 0.0, false, false, false, false, 20, true) - DetachEntity(CurrentlyTowedVehicle, true, true) + AttachEntityToEntity(CurrentlyTowedVehicle, vehicle, 20, -0.5, -12.0, 1.0, 0.0, 0.0, 0.0, false, false, false, false, 20, true) + DetachEntity(CurrentlyTowedVehicle, true, true) - if NPCOnJob then + if NPCOnJob then - if CurrentlyTowedVehicle == NPCTargetTowable then - ESX.Game.DeleteVehicle(NPCTargetTowable) - TriggerServerEvent('esx_mecanojob:onNPCJobMissionCompleted') - StopNPCJob() + if CurrentlyTowedVehicle == NPCTargetTowable then + ESX.Game.DeleteVehicle(NPCTargetTowable) + TriggerServerEvent('esx_mecanojob:onNPCJobMissionCompleted') + StopNPCJob() - else - ESX.ShowNotification(_U('not_right_veh')) - end + else + ESX.ShowNotification(_U('not_right_veh')) + end - end + end - CurrentlyTowedVehicle = nil + CurrentlyTowedVehicle = nil - ESX.ShowNotification(_U('veh_det_succ')) - end - else - ESX.ShowNotification(_U('imp_flatbed')) - end - end + ESX.ShowNotification(_U('veh_det_succ')) + end + else + ESX.ShowNotification(_U('imp_flatbed')) + end + end - if data.current.value == 'object_spawner' then + if data.current.value == 'object_spawner' then - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'mobile_mecano_actions_spawn', - { - title = _U('objects'), - align = 'top-left', - elements = { - {label = _U('roadcone'), value = 'prop_roadcone02a'}, - {label = _U('toolbox'), value = 'prop_toolchest_01'}, - }, - }, - function(data2, menu2) + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'mobile_mecano_actions_spawn', + { + title = _U('objects'), + align = 'top-left', + elements = { + {label = _U('roadcone'), value = 'prop_roadcone02a'}, + {label = _U('toolbox'), value = 'prop_toolchest_01'}, + }, + }, + function(data2, menu2) - local model = data2.current.value - local playerPed = GetPlayerPed(-1) - local coords = GetEntityCoords(playerPed) - local forward = GetEntityForwardVector(playerPed) - local x, y, z = table.unpack(coords + forward * 1.0) + local model = data2.current.value + local playerPed = GetPlayerPed(-1) + local coords = GetEntityCoords(playerPed) + local forward = GetEntityForwardVector(playerPed) + local x, y, z = table.unpack(coords + forward * 1.0) - if model == 'prop_roadcone02a' then - z = z - 2.0 - elseif model == 'prop_toolchest_01' then - z = z - 2.0 - end + if model == 'prop_roadcone02a' then + z = z - 2.0 + elseif model == 'prop_toolchest_01' then + z = z - 2.0 + end - ESX.Game.SpawnObject(model, { - x = x, - y = y, - z = z - }, function(obj) - SetEntityHeading(obj, GetEntityHeading(playerPed)) - PlaceObjectOnGroundProperly(obj) - end) + ESX.Game.SpawnObject(model, { + x = x, + y = y, + z = z + }, function(obj) + SetEntityHeading(obj, GetEntityHeading(playerPed)) + PlaceObjectOnGroundProperly(obj) + end) - end, - function(data2, menu2) - menu2.close() - end - ) + end, + function(data2, menu2) + menu2.close() + end + ) - end + end - end, - function(data, menu) - menu.close() - end - ) + end, + function(data, menu) + menu.close() + end + ) end function OpenGetStocksMenu() - ESX.TriggerServerCallback('esx_mecanojob:getStockItems', function(items) + ESX.TriggerServerCallback('esx_mecanojob:getStockItems', function(items) - print(json.encode(items)) + print(json.encode(items)) - local elements = {} + local elements = {} - for i=1, #items, 1 do - table.insert(elements, {label = 'x' .. items[i].count .. ' ' .. items[i].label, value = items[i].name}) - end + for i=1, #items, 1 do + table.insert(elements, {label = 'x' .. items[i].count .. ' ' .. items[i].label, value = items[i].name}) + end - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'stocks_menu', - { - title = _U('mechanic_stock'), - elements = elements - }, - function(data, menu) + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'stocks_menu', + { + title = _U('mechanic_stock'), + elements = elements + }, + function(data, menu) - local itemName = data.current.value + local itemName = data.current.value - ESX.UI.Menu.Open( - 'dialog', GetCurrentResourceName(), 'stocks_menu_get_item_count', - { - title = _U('quantity') - }, - function(data2, menu2) + ESX.UI.Menu.Open( + 'dialog', GetCurrentResourceName(), 'stocks_menu_get_item_count', + { + title = _U('quantity') + }, + function(data2, menu2) - local count = tonumber(data2.value) + local count = tonumber(data2.value) - if count == nil then - ESX.ShowNotification(_U('invalid_quantity')) - else - menu2.close() - menu.close() - OpenGetStocksMenu() + if count == nil then + ESX.ShowNotification(_U('invalid_quantity')) + else + menu2.close() + menu.close() + OpenGetStocksMenu() - TriggerServerEvent('esx_mecanojob:getStockItem', itemName, count) - end + TriggerServerEvent('esx_mecanojob:getStockItem', itemName, count) + end - end, - function(data2, menu2) - menu2.close() - end - ) + end, + function(data2, menu2) + menu2.close() + end + ) - end, - function(data, menu) - menu.close() - end - ) + end, + function(data, menu) + menu.close() + end + ) - end) + end) end @@ -698,160 +699,160 @@ function OpenPutStocksMenu() ESX.TriggerServerCallback('esx_mecanojob:getPlayerInventory', function(inventory) - local elements = {} + local elements = {} - for i=1, #inventory.items, 1 do + for i=1, #inventory.items, 1 do - local item = inventory.items[i] + local item = inventory.items[i] - if item.count > 0 then - table.insert(elements, {label = item.label .. ' x' .. item.count, type = 'item_standard', value = item.name}) - end + if item.count > 0 then + table.insert(elements, {label = item.label .. ' x' .. item.count, type = 'item_standard', value = item.name}) + end - end + end - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'stocks_menu', - { - title = _U('inventory'), - elements = elements - }, - function(data, menu) + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'stocks_menu', + { + title = _U('inventory'), + elements = elements + }, + function(data, menu) - local itemName = data.current.value + local itemName = data.current.value - ESX.UI.Menu.Open( - 'dialog', GetCurrentResourceName(), 'stocks_menu_put_item_count', - { - title = _U('quantity') - }, - function(data2, menu2) + ESX.UI.Menu.Open( + 'dialog', GetCurrentResourceName(), 'stocks_menu_put_item_count', + { + title = _U('quantity') + }, + function(data2, menu2) - local count = tonumber(data2.value) + local count = tonumber(data2.value) - if count == nil then - ESX.ShowNotification(_U('invalid_quantity')) - else - menu2.close() - menu.close() - OpenPutStocksMenu() + if count == nil then + ESX.ShowNotification(_U('invalid_quantity')) + else + menu2.close() + menu.close() + OpenPutStocksMenu() - TriggerServerEvent('esx_mecanojob:putStockItems', itemName, count) - end + TriggerServerEvent('esx_mecanojob:putStockItems', itemName, count) + end - end, - function(data2, menu2) - menu2.close() - end - ) + end, + function(data2, menu2) + menu2.close() + end + ) - end, - function(data, menu) - menu.close() - end - ) + end, + function(data, menu) + menu.close() + end + ) - end) + end) end RegisterNetEvent('esx_mecanojob:onHijack') AddEventHandler('esx_mecanojob:onHijack', function() - local playerPed = GetPlayerPed(-1) - local coords = GetEntityCoords(playerPed) + local playerPed = GetPlayerPed(-1) + local coords = GetEntityCoords(playerPed) - if IsAnyVehicleNearPoint(coords.x, coords.y, coords.z, 5.0) then + if IsAnyVehicleNearPoint(coords.x, coords.y, coords.z, 5.0) then - local vehicle = nil + local vehicle = nil - if IsPedInAnyVehicle(playerPed, false) then - vehicle = GetVehiclePedIsIn(playerPed, false) - else - vehicle = GetClosestVehicle(coords.x, coords.y, coords.z, 5.0, 0, 71) - end + if IsPedInAnyVehicle(playerPed, false) then + vehicle = GetVehiclePedIsIn(playerPed, false) + else + vehicle = GetClosestVehicle(coords.x, coords.y, coords.z, 5.0, 0, 71) + end - local crochete = math.random(100) - local alarm = math.random(100) + local crochete = math.random(100) + local alarm = math.random(100) - if DoesEntityExist(vehicle) then - if alarm <= 33 then - SetVehicleAlarm(vehicle, true) - StartVehicleAlarm(vehicle) - end - TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_WELDING", 0, true) - Citizen.CreateThread(function() - Citizen.Wait(10000) - if crochete <= 66 then - SetVehicleDoorsLocked(vehicle, 1) - SetVehicleDoorsLockedForAllPlayers(vehicle, false) - ClearPedTasksImmediately(playerPed) - ESX.ShowNotification(_U('veh_unlocked')) - else - ESX.ShowNotification(_U('hijack_failed')) - ClearPedTasksImmediately(playerPed) - end - end) - end + if DoesEntityExist(vehicle) then + if alarm <= 33 then + SetVehicleAlarm(vehicle, true) + StartVehicleAlarm(vehicle) + end + TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_WELDING", 0, true) + Citizen.CreateThread(function() + Citizen.Wait(10000) + if crochete <= 66 then + SetVehicleDoorsLocked(vehicle, 1) + SetVehicleDoorsLockedForAllPlayers(vehicle, false) + ClearPedTasksImmediately(playerPed) + ESX.ShowNotification(_U('veh_unlocked')) + else + ESX.ShowNotification(_U('hijack_failed')) + ClearPedTasksImmediately(playerPed) + end + end) + end - end + end end) RegisterNetEvent('esx_mecanojob:onCarokit') AddEventHandler('esx_mecanojob:onCarokit', function() - local playerPed = GetPlayerPed(-1) - local coords = GetEntityCoords(playerPed) + local playerPed = GetPlayerPed(-1) + local coords = GetEntityCoords(playerPed) - if IsAnyVehicleNearPoint(coords.x, coords.y, coords.z, 5.0) then + if IsAnyVehicleNearPoint(coords.x, coords.y, coords.z, 5.0) then - local vehicle = nil + local vehicle = nil - if IsPedInAnyVehicle(playerPed, false) then - vehicle = GetVehiclePedIsIn(playerPed, false) - else - vehicle = GetClosestVehicle(coords.x, coords.y, coords.z, 5.0, 0, 71) - end + if IsPedInAnyVehicle(playerPed, false) then + vehicle = GetVehiclePedIsIn(playerPed, false) + else + vehicle = GetClosestVehicle(coords.x, coords.y, coords.z, 5.0, 0, 71) + end - if DoesEntityExist(vehicle) then - TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_HAMMERING", 0, true) - Citizen.CreateThread(function() - Citizen.Wait(10000) - SetVehicleFixed(vehicle) - SetVehicleDeformationFixed(vehicle) - ClearPedTasksImmediately(playerPed) - ESX.ShowNotification(_U('body_repaired')) - end) - end - end + if DoesEntityExist(vehicle) then + TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_HAMMERING", 0, true) + Citizen.CreateThread(function() + Citizen.Wait(10000) + SetVehicleFixed(vehicle) + SetVehicleDeformationFixed(vehicle) + ClearPedTasksImmediately(playerPed) + ESX.ShowNotification(_U('body_repaired')) + end) + end + end end) RegisterNetEvent('esx_mecanojob:onFixkit') AddEventHandler('esx_mecanojob:onFixkit', function() - local playerPed = GetPlayerPed(-1) - local coords = GetEntityCoords(playerPed) + local playerPed = GetPlayerPed(-1) + local coords = GetEntityCoords(playerPed) - if IsAnyVehicleNearPoint(coords.x, coords.y, coords.z, 5.0) then + if IsAnyVehicleNearPoint(coords.x, coords.y, coords.z, 5.0) then - local vehicle = nil + local vehicle = nil - if IsPedInAnyVehicle(playerPed, false) then - vehicle = GetVehiclePedIsIn(playerPed, false) - else - vehicle = GetClosestVehicle(coords.x, coords.y, coords.z, 5.0, 0, 71) - end + if IsPedInAnyVehicle(playerPed, false) then + vehicle = GetVehiclePedIsIn(playerPed, false) + else + vehicle = GetClosestVehicle(coords.x, coords.y, coords.z, 5.0, 0, 71) + end - if DoesEntityExist(vehicle) then - TaskStartScenarioInPlace(playerPed, "PROP_HUMAN_BUM_BIN", 0, true) - Citizen.CreateThread(function() - Citizen.Wait(20000) - SetVehicleFixed(vehicle) - SetVehicleDeformationFixed(vehicle) - SetVehicleUndriveable(vehicle, false) - ClearPedTasksImmediately(playerPed) - ESX.ShowNotification(_U('veh_repaired')) - end) - end - end + if DoesEntityExist(vehicle) then + TaskStartScenarioInPlace(playerPed, "PROP_HUMAN_BUM_BIN", 0, true) + Citizen.CreateThread(function() + Citizen.Wait(20000) + SetVehicleFixed(vehicle) + SetVehicleDeformationFixed(vehicle) + SetVehicleUndriveable(vehicle, false) + ClearPedTasksImmediately(playerPed) + ESX.ShowNotification(_U('veh_repaired')) + end) + end + end end) function setEntityHeadingFromEntity ( vehicle, playerPed ) @@ -860,9 +861,9 @@ function setEntityHeadingFromEntity ( vehicle, playerPed ) end function getVehicleInDirection(coordFrom, coordTo) - local rayHandle = CastRayPointToPoint(coordFrom.x, coordFrom.y, coordFrom.z, coordTo.x, coordTo.y, coordTo.z, 10, GetPlayerPed(-1), 0) - local a, b, c, d, vehicle = GetRaycastResult(rayHandle) - return vehicle + local rayHandle = CastRayPointToPoint(coordFrom.x, coordFrom.y, coordFrom.z, coordTo.x, coordTo.y, coordTo.z, 10, GetPlayerPed(-1), 0) + local a, b, c, d, vehicle = GetRaycastResult(rayHandle) + return vehicle end function deleteCar( entity ) @@ -871,100 +872,100 @@ end RegisterNetEvent('esx:playerLoaded') AddEventHandler('esx:playerLoaded', function(xPlayer) - PlayerData = xPlayer + PlayerData = xPlayer end) RegisterNetEvent('esx:setJob') AddEventHandler('esx:setJob', function(job) - PlayerData.job = job + PlayerData.job = job end) AddEventHandler('esx_mecanojob:hasEnteredMarker', function(zone) - if zone == NPCJobTargetTowable then + if zone == NPCJobTargetTowable then - end + end - if zone == 'MecanoActions' then - CurrentAction = 'mecano_actions_menu' - CurrentActionMsg = _U('open_actions') - CurrentActionData = {} - end + if zone == 'MecanoActions' then + CurrentAction = 'mecano_actions_menu' + CurrentActionMsg = _U('open_actions') + CurrentActionData = {} + end - if zone == 'Garage' then - CurrentAction = 'mecano_harvest_menu' - CurrentActionMsg = _U('harvest_menu') - CurrentActionData = {} - end + if zone == 'Garage' then + CurrentAction = 'mecano_harvest_menu' + CurrentActionMsg = _U('harvest_menu') + CurrentActionData = {} + end - if zone == 'Craft' then - CurrentAction = 'mecano_craft_menu' - CurrentActionMsg = _U('craft_menu') - CurrentActionData = {} - end + if zone == 'Craft' then + CurrentAction = 'mecano_craft_menu' + CurrentActionMsg = _U('craft_menu') + CurrentActionData = {} + end - if zone == 'VehicleDeleter' then + if zone == 'VehicleDeleter' then - local playerPed = GetPlayerPed(-1) + local playerPed = GetPlayerPed(-1) - if IsPedInAnyVehicle(playerPed, false) then + if IsPedInAnyVehicle(playerPed, false) then - local vehicle = GetVehiclePedIsIn(playerPed, false) + local vehicle = GetVehiclePedIsIn(playerPed, false) - CurrentAction = 'delete_vehicle' - CurrentActionMsg = _U('veh_stored') - CurrentActionData = {vehicle = vehicle} - end - end + CurrentAction = 'delete_vehicle' + CurrentActionMsg = _U('veh_stored') + CurrentActionData = {vehicle = vehicle} + end + end end) AddEventHandler('esx_mecanojob:hasExitedMarker', function(zone) - if zone == 'Craft' then - TriggerServerEvent('esx_mecanojob:stopCraft') - TriggerServerEvent('esx_mecanojob:stopCraft2') - TriggerServerEvent('esx_mecanojob:stopCraft3') - end + if zone == 'Craft' then + TriggerServerEvent('esx_mecanojob:stopCraft') + TriggerServerEvent('esx_mecanojob:stopCraft2') + TriggerServerEvent('esx_mecanojob:stopCraft3') + end - if zone == 'Garage' then - TriggerServerEvent('esx_mecanojob:stopHarvest') - TriggerServerEvent('esx_mecanojob:stopHarvest2') - TriggerServerEvent('esx_mecanojob:stopHarvest3') - end + if zone == 'Garage' then + TriggerServerEvent('esx_mecanojob:stopHarvest') + TriggerServerEvent('esx_mecanojob:stopHarvest2') + TriggerServerEvent('esx_mecanojob:stopHarvest3') + end - CurrentAction = nil - ESX.UI.Menu.CloseAll() + CurrentAction = nil + ESX.UI.Menu.CloseAll() end) AddEventHandler('esx_mecanojob:hasEnteredEntityZone', function(entity) - local playerPed = GetPlayerPed(-1) + local playerPed = GetPlayerPed(-1) - if PlayerData.job ~= nil and PlayerData.job.name == 'mecano' and not IsPedInAnyVehicle(playerPed, false) then - CurrentAction = 'remove_entity' - CurrentActionMsg = _U('press_remove_obj') - CurrentActionData = {entity = entity} - end + if PlayerData.job ~= nil and PlayerData.job.name == 'mecano' and not IsPedInAnyVehicle(playerPed, false) then + CurrentAction = 'remove_entity' + CurrentActionMsg = _U('press_remove_obj') + CurrentActionData = {entity = entity} + end end) AddEventHandler('esx_mecanojob:hasExitedEntityZone', function(entity) - if CurrentAction == 'remove_entity' then - CurrentAction = nil - end + if CurrentAction == 'remove_entity' then + CurrentAction = nil + end end) RegisterNetEvent('esx_phone:loaded') AddEventHandler('esx_phone:loaded', function(phoneNumber, contacts) - local specialContact = { - name = _U('mechanic'), - number = 'mecano', - 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) + local specialContact = { + name = _U('mechanic'), + number = 'mecano', + 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 @@ -983,7 +984,7 @@ Citizen.CreateThread(function() local model = Config.Vehicles[GetRandomIntInRange(1, #Config.Vehicles)] ESX.Game.SpawnVehicle(model, zone.Pos, 0, function(vehicle) - NPCTargetTowable = vehicle + NPCTargetTowable = vehicle end) NPCHasSpawnedTowable = true @@ -1009,91 +1010,91 @@ end) -- Create Blips Citizen.CreateThread(function() - local blip = AddBlipForCoord(Config.Zones.MecanoActions.Pos.x, Config.Zones.MecanoActions.Pos.y, Config.Zones.MecanoActions.Pos.z) - SetBlipSprite (blip, 446) - SetBlipDisplay(blip, 4) - SetBlipScale (blip, 1.8) - SetBlipColour (blip, 5) - SetBlipAsShortRange(blip, true) - BeginTextCommandSetBlipName("STRING") - AddTextComponentString(_U('mechanic')) - EndTextCommandSetBlipName(blip) + local blip = AddBlipForCoord(Config.Zones.MecanoActions.Pos.x, Config.Zones.MecanoActions.Pos.y, Config.Zones.MecanoActions.Pos.z) + SetBlipSprite (blip, 446) + SetBlipDisplay(blip, 4) + SetBlipScale (blip, 1.8) + SetBlipColour (blip, 5) + SetBlipAsShortRange(blip, true) + BeginTextCommandSetBlipName("STRING") + AddTextComponentString(_U('mechanic')) + EndTextCommandSetBlipName(blip) end) -- Display markers Citizen.CreateThread(function() - while true do - Wait(0) - if PlayerData.job ~= nil and PlayerData.job.name == 'mecano' then + while true do + Wait(0) + if PlayerData.job ~= nil and PlayerData.job.name == 'mecano' then - local coords = GetEntityCoords(GetPlayerPed(-1)) + local coords = GetEntityCoords(GetPlayerPed(-1)) - for k,v in pairs(Config.Zones) do - if(v.Type ~= -1 and GetDistanceBetweenCoords(coords, v.Pos.x, v.Pos.y, v.Pos.z, true) < Config.DrawDistance) then - DrawMarker(v.Type, v.Pos.x, v.Pos.y, v.Pos.z, 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, false, true, 2, false, false, false, false) - end - end - end - end + for k,v in pairs(Config.Zones) do + if(v.Type ~= -1 and GetDistanceBetweenCoords(coords, v.Pos.x, v.Pos.y, v.Pos.z, true) < Config.DrawDistance) then + DrawMarker(v.Type, v.Pos.x, v.Pos.y, v.Pos.z, 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, false, true, 2, false, false, false, false) + end + end + end + end end) -- Enter / Exit marker events Citizen.CreateThread(function() - while true do - Wait(0) - if PlayerData.job ~= nil and PlayerData.job.name == 'mecano' then - local coords = GetEntityCoords(GetPlayerPed(-1)) - local isInMarker = false - local currentZone = nil - for k,v in pairs(Config.Zones) do - if(GetDistanceBetweenCoords(coords, v.Pos.x, v.Pos.y, v.Pos.z, true) < v.Size.x) then - isInMarker = true - currentZone = k - end - end - if (isInMarker and not HasAlreadyEnteredMarker) or (isInMarker and LastZone ~= currentZone) then - HasAlreadyEnteredMarker = true - LastZone = currentZone - TriggerEvent('esx_mecanojob:hasEnteredMarker', currentZone) - end - if not isInMarker and HasAlreadyEnteredMarker then - HasAlreadyEnteredMarker = false - TriggerEvent('esx_mecanojob:hasExitedMarker', LastZone) - end - end - end + while true do + Wait(0) + if PlayerData.job ~= nil and PlayerData.job.name == 'mecano' then + local coords = GetEntityCoords(GetPlayerPed(-1)) + local isInMarker = false + local currentZone = nil + for k,v in pairs(Config.Zones) do + if(GetDistanceBetweenCoords(coords, v.Pos.x, v.Pos.y, v.Pos.z, true) < v.Size.x) then + isInMarker = true + currentZone = k + end + end + if (isInMarker and not HasAlreadyEnteredMarker) or (isInMarker and LastZone ~= currentZone) then + HasAlreadyEnteredMarker = true + LastZone = currentZone + TriggerEvent('esx_mecanojob:hasEnteredMarker', currentZone) + end + if not isInMarker and HasAlreadyEnteredMarker then + HasAlreadyEnteredMarker = false + TriggerEvent('esx_mecanojob:hasExitedMarker', LastZone) + end + end + end end) Citizen.CreateThread(function() - while true do + while true do - Citizen.Wait(0) + Citizen.Wait(0) - local playerPed = GetPlayerPed(-1) - local coords = GetEntityCoords(playerPed) + local playerPed = GetPlayerPed(-1) + local coords = GetEntityCoords(playerPed) - local entity, distance = ESX.Game.GetClosestObject({ - 'prop_roadcone02a', - 'prop_toolchest_01' - }) + local entity, distance = ESX.Game.GetClosestObject({ + 'prop_roadcone02a', + 'prop_toolchest_01' + }) - if distance ~= -1 and distance <= 3.0 then + if distance ~= -1 and distance <= 3.0 then - if LastEntity ~= entity then - TriggerEvent('esx_mecanojob:hasEnteredEntityZone', entity) - LastEntity = entity - end + if LastEntity ~= entity then + TriggerEvent('esx_mecanojob:hasEnteredEntityZone', entity) + LastEntity = entity + end - else + else - if LastEntity ~= nil then - TriggerEvent('esx_mecanojob:hasExitedEntityZone', LastEntity) - LastEntity = nil - end + if LastEntity ~= nil then + TriggerEvent('esx_mecanojob:hasExitedEntityZone', LastEntity) + LastEntity = nil + end - end + end - end + end end) @@ -1124,29 +1125,29 @@ Citizen.CreateThread(function() if CurrentAction == 'delete_vehicle' then - if Config.EnableSocietyOwnedVehicles then + if Config.EnableSocietyOwnedVehicles then - local vehicleProps = ESX.Game.GetVehicleProperties(CurrentActionData.vehicle) - TriggerServerEvent('esx_society:putVehicleInGarage', 'mecano', vehicleProps) + local vehicleProps = ESX.Game.GetVehicleProperties(CurrentActionData.vehicle) + TriggerServerEvent('esx_society:putVehicleInGarage', 'mecano', vehicleProps) - else + else - if - GetEntityModel(vehicle) == GetHashKey('flatbed') or - GetEntityModel(vehicle) == GetHashKey('towtrcuk2') or - GetEntityModel(vehicle) == GetHashKey('slamvan3') - then - TriggerServerEvent('esx_service:disableService', 'mecano') - end + if + GetEntityModel(vehicle) == GetHashKey('flatbed') or + GetEntityModel(vehicle) == GetHashKey('towtrcuk2') or + GetEntityModel(vehicle) == GetHashKey('slamvan3') + then + TriggerServerEvent('esx_service:disableService', 'mecano') + end - end + end - ESX.Game.DeleteVehicle(CurrentActionData.vehicle) + ESX.Game.DeleteVehicle(CurrentActionData.vehicle) end if CurrentAction == 'remove_entity' then - DeleteEntity(CurrentActionData.entity) - end + DeleteEntity(CurrentActionData.entity) + end CurrentAction = nil end @@ -1156,30 +1157,30 @@ Citizen.CreateThread(function() OpenMobileMecanoActionsMenu() end - if IsControlJustReleased(0, Keys['DELETE']) and PlayerData.job ~= nil and PlayerData.job.name == 'mecano' then + if IsControlJustReleased(0, Keys['DELETE']) and PlayerData.job ~= nil and PlayerData.job.name == 'mecano' then - if NPCOnJob then + if NPCOnJob then - if GetGameTimer() - NPCLastCancel > 5 * 60000 then - StopNPCJob(true) - NPCLastCancel = GetGameTimer() - else - ESX.ShowNotification(_U('wait_five')) - end + if GetGameTimer() - NPCLastCancel > 5 * 60000 then + StopNPCJob(true) + NPCLastCancel = GetGameTimer() + else + ESX.ShowNotification(_U('wait_five')) + end - else + else - local playerPed = GetPlayerPed(-1) + local playerPed = GetPlayerPed(-1) - if IsPedInAnyVehicle(playerPed, false) and IsVehicleModel(GetVehiclePedIsIn(playerPed, false), GetHashKey("flatbed")) then - StartNPCJob() - else - ESX.ShowNotification(_U('must_in_flatbed')) - end + if IsPedInAnyVehicle(playerPed, false) and IsVehicleModel(GetVehiclePedIsIn(playerPed, false), GetHashKey("flatbed")) then + StartNPCJob() + else + ESX.ShowNotification(_U('must_in_flatbed')) + end - end + end - end + end end end) diff --git a/config.lua b/config.lua index 208219ec..2ecf3fce 100644 --- a/config.lua +++ b/config.lua @@ -5,112 +5,108 @@ Config.EnablePlayerManagement = false Config.EnableSocietyOwnedVehicles = false Config.NPCSpawnDistance = 500.0 Config.NPCNextToDistance = 25.0 -Config.NPCJobEarnings = {min = 15, max = 40} -Config.Locale = 'fr' +Config.NPCJobEarnings = { min = 15, max = 40 } +Config.Locale = 'fr' Config.Zones = { + MecanoActions = { + Pos = { x = -347.291, y = -133.370, z = 38.009 }, + Size = { x = 1.5, y = 1.5, z = 1.0 }, + Color = { r = 204, g = 204, b = 0 }, + Type = 1, + }, - MecanoActions = { - Pos = {x = -347.291, y = -133.370, z = 38.009}, - Size = {x = 1.5, y = 1.5, z = 1.0}, - Color = {r = 204, g = 204, b = 0}, - Type = 1 - }, + Garage = { + Pos = { x = -97.5797576904297, y = 6496.11376953125, z = 30.4909038543701 }, + Size = { x = 1.5, y = 1.5, z = 1.0 }, + Color = { r = 204, g = 204, b = 0 }, + Type = 1, + }, - Garage = { - Pos = {x = -97.5797576904297, y = 6496.11376953125, z = 30.4909038543701}, - Size = {x = 1.5, y = 1.5, z = 1.0}, - Color = {r = 204, g = 204, b = 0}, - Type = 1 - }, + Craft = { + Pos = { x = -323.140, y = -129.882, z = 37.999 }, + Size = { x = 1.5, y = 1.5, z = 1.0 }, + Color = { r = 204, g = 204, b = 0 }, + Type = 1, + }, - Craft = { - Pos = {x = -323.140, y = -129.882, z = 37.999}, - Size = {x = 1.5, y = 1.5, z = 1.0}, - Color = {r = 204, g = 204, b = 0}, - Type = 1 - }, + VehicleSpawnPoint = { + Pos = { x = -366.354, y = -110.766, z = 37.696 }, + Size = { x = 1.5, y = 1.5, z = 1.0 }, + Type = -1, + }, - VehicleSpawnPoint = { - Pos = {x = -366.354, y = -110.766, z = 37.696}, - Size = {x = 1.5, y = 1.5, z = 1.0}, - Type = -1 - }, - - VehicleDeleter = { - Pos = {x = -386.899, y = -105.675, z = 37.683}, - Size = {x = 3.0, y = 3.0, z = 1.0}, - Color = {r = 204, g = 204, b = 0}, - Type = 1 - }, - - VehicleDelivery = { - Pos = {x = -382.925, y = -133.748, z = 37.685}, - Size = {x = 20.0, y = 20.0, z = 3.0}, - Color = {r = 204, g = 204, b = 0}, - Type = -1 - }, + VehicleDeleter = { + Pos = { x = -386.899, y = -105.675, z = 37.683 }, + Size = { x = 3.0, y = 3.0, z = 1.0 }, + Color = { r = 204, g = 204, b = 0 }, + Type = 1, + }, + VehicleDelivery = { + Pos = { x = -382.925, y = -133.748, z = 37.685 }, + Size = { x = 20.0, y = 20.0, z = 3.0 }, + Color = { r = 204, g = 204, b = 0 }, + Type = -1, + }, } Config.Towables = { - { ['x'] = -2480.8720703125, ['y'] = -211.96409606934, ['z'] = 17.397672653198 }, - { ['x'] = -2723.392578125, ['y'] = 13.207388877869, ['z'] = 15.12806892395 }, - { ['x'] = -3169.6235351563, ['y'] = 976.18127441406, ['z'] = 15.038360595703 }, - { ['x'] = -3139.7568359375, ['y'] = 1078.7182617188, ['z'] = 20.189767837524 }, - { ['x'] = -1656.9357910156, ['y'] = -246.16479492188, ['z'] = 54.510955810547 }, - { ['x'] = -1586.6560058594, ['y'] = -647.56115722656, ['z'] = 29.441320419312 }, - { ['x'] = -1036.1470947266, ['y'] = -491.05856323242, ['z'] = 36.214912414551 }, - { ['x'] = -1029.1884765625, ['y'] = -475.53167724609, ['z'] = 36.416831970215 }, - { ['x'] = 75.212287902832, ['y'] = 164.8522644043, ['z'] = 104.69123077393 }, - { ['x'] = -534.60491943359, ['y'] = -756.71801757813, ['z'] = 31.599143981934 }, - { ['x'] = 487.24212646484, ['y'] = -30.827201843262, ['z'] = 88.856712341309 }, - { ['x'] = -772.20111083984, ['y'] = -1281.8114013672, ['z'] = 4.5642876625061 }, - { ['x'] = -663.84173583984, ['y'] = -1206.9936523438, ['z'] = 10.171216011047 }, - { ['x'] = 719.12451171875, ['y'] = -767.77545166016, ['z'] = 24.892364501953 }, - { ['x'] = -970.95465087891, ['y'] = -2410.4453125, ['z'] = 13.344270706177 }, - { ['x'] = -1067.5234375, ['y'] = -2571.4064941406, ['z'] = 13.211874008179 }, - { ['x'] = -619.23968505859, ['y'] = -2207.2927246094, ['z'] = 5.5659561157227 }, - { ['x'] = 1192.0831298828, ['y'] = -1336.9086914063, ['z'] = 35.106426239014 }, - { ['x'] = -432.81033325195, ['y'] = -2166.0505371094, ['z'] = 9.8885231018066 }, - { ['x'] = -451.82403564453, ['y'] = -2269.34765625, ['z'] = 7.1719741821289 }, - { ['x'] = 939.26702880859, ['y'] = -2197.5390625, ['z'] = 30.546691894531 }, - { ['x'] = -556.11486816406, ['y'] = -1794.7312011719, ['z'] = 22.043060302734 }, - { ['x'] = 591.73504638672, ['y'] = -2628.2197265625, ['z'] = 5.5735430717468 }, - { ['x'] = 1654.515625, ['y'] = -2535.8325195313, ['z'] = 74.491394042969 }, - { ['x'] = 1642.6146240234, ['y'] = -2413.3159179688, ['z'] = 93.139915466309 }, - { ['x'] = 1371.3223876953, ['y'] = -2549.525390625, ['z'] = 47.575256347656 }, - { ['x'] = 383.83779907227, ['y'] = -1652.8695068359, ['z'] = 37.278503417969 }, - { ['x'] = 27.219129562378, ['y'] = -1030.8818359375, ['z'] = 29.414621353149 }, - { ['x'] = 229.26435852051, ['y'] = -365.91101074219, ['z'] = 43.750762939453 }, - { ['x'] = -85.809432983398, ['y'] = -51.665500640869, ['z'] = 61.10591506958 }, - { ['x'] = -4.5967531204224, ['y'] = -670.27124023438, ['z'] = 31.85863494873 }, - { ['x'] = -111.89884185791, ['y'] = 91.96940612793, ['z'] = 71.080169677734 }, - { ['x'] = -314.26129150391, ['y'] = -698.23309326172, ['z'] = 32.545776367188 }, - { ['x'] = -366.90979003906, ['y'] = 115.53963470459, ['z'] = 65.575706481934 }, - { ['x'] = -592.06726074219, ['y'] = 138.20733642578, ['z'] = 60.074813842773 }, - { ['x'] = -1613.8572998047, ['y'] = 18.759860992432, ['z'] = 61.799819946289 }, - { ['x'] = -1709.7995605469, ['y'] = 55.105819702148, ['z'] = 65.706237792969 }, - { ['x'] = -521.88830566406, ['y'] = -266.7805480957, ['z'] = 34.940990447998 }, - { ['x'] = -451.08666992188, ['y'] = -333.52026367188, ['z'] = 34.021533966064 }, - { ['x'] = 322.36480712891, ['y'] = -1900.4990234375, ['z'] = 25.773607254028 }, + { ['x'] = -2480.8720703125, ['y'] = -211.96409606934, ['z'] = 17.397672653198 }, + { ['x'] = -2723.392578125, ['y'] = 13.207388877869, ['z'] = 15.12806892395 }, + { ['x'] = -3169.6235351563, ['y'] = 976.18127441406, ['z'] = 15.038360595703 }, + { ['x'] = -3139.7568359375, ['y'] = 1078.7182617188, ['z'] = 20.189767837524 }, + { ['x'] = -1656.9357910156, ['y'] = -246.16479492188, ['z'] = 54.510955810547 }, + { ['x'] = -1586.6560058594, ['y'] = -647.56115722656, ['z'] = 29.441320419312 }, + { ['x'] = -1036.1470947266, ['y'] = -491.05856323242, ['z'] = 36.214912414551 }, + { ['x'] = -1029.1884765625, ['y'] = -475.53167724609, ['z'] = 36.416831970215 }, + { ['x'] = 75.212287902832, ['y'] = 164.8522644043, ['z'] = 104.69123077393 }, + { ['x'] = -534.60491943359, ['y'] = -756.71801757813, ['z'] = 31.599143981934 }, + { ['x'] = 487.24212646484, ['y'] = -30.827201843262, ['z'] = 88.856712341309 }, + { ['x'] = -772.20111083984, ['y'] = -1281.8114013672, ['z'] = 4.5642876625061 }, + { ['x'] = -663.84173583984, ['y'] = -1206.9936523438, ['z'] = 10.171216011047 }, + { ['x'] = 719.12451171875, ['y'] = -767.77545166016, ['z'] = 24.892364501953 }, + { ['x'] = -970.95465087891, ['y'] = -2410.4453125, ['z'] = 13.344270706177 }, + { ['x'] = -1067.5234375, ['y'] = -2571.4064941406, ['z'] = 13.211874008179 }, + { ['x'] = -619.23968505859, ['y'] = -2207.2927246094, ['z'] = 5.5659561157227 }, + { ['x'] = 1192.0831298828, ['y'] = -1336.9086914063, ['z'] = 35.106426239014 }, + { ['x'] = -432.81033325195, ['y'] = -2166.0505371094, ['z'] = 9.8885231018066 }, + { ['x'] = -451.82403564453, ['y'] = -2269.34765625, ['z'] = 7.1719741821289 }, + { ['x'] = 939.26702880859, ['y'] = -2197.5390625, ['z'] = 30.546691894531 }, + { ['x'] = -556.11486816406, ['y'] = -1794.7312011719, ['z'] = 22.043060302734 }, + { ['x'] = 591.73504638672, ['y'] = -2628.2197265625, ['z'] = 5.5735430717468 }, + { ['x'] = 1654.515625, ['y'] = -2535.8325195313, ['z'] = 74.491394042969 }, + { ['x'] = 1642.6146240234, ['y'] = -2413.3159179688, ['z'] = 93.139915466309 }, + { ['x'] = 1371.3223876953, ['y'] = -2549.525390625, ['z'] = 47.575256347656 }, + { ['x'] = 383.83779907227, ['y'] = -1652.8695068359, ['z'] = 37.278503417969 }, + { ['x'] = 27.219129562378, ['y'] = -1030.8818359375, ['z'] = 29.414621353149 }, + { ['x'] = 229.26435852051, ['y'] = -365.91101074219, ['z'] = 43.750762939453 }, + { ['x'] = -85.809432983398, ['y'] = -51.665500640869, ['z'] = 61.10591506958 }, + { ['x'] = -4.5967531204224, ['y'] = -670.27124023438, ['z'] = 31.85863494873 }, + { ['x'] = -111.89884185791, ['y'] = 91.96940612793, ['z'] = 71.080169677734 }, + { ['x'] = -314.26129150391, ['y'] = -698.23309326172, ['z'] = 32.545776367188 }, + { ['x'] = -366.90979003906, ['y'] = 115.53963470459, ['z'] = 65.575706481934 }, + { ['x'] = -592.06726074219, ['y'] = 138.20733642578, ['z'] = 60.074813842773 }, + { ['x'] = -1613.8572998047, ['y'] = 18.759860992432, ['z'] = 61.799819946289 }, + { ['x'] = -1709.7995605469, ['y'] = 55.105819702148, ['z'] = 65.706237792969 }, + { ['x'] = -521.88830566406, ['y'] = -266.7805480957, ['z'] = 34.940990447998 }, + { ['x'] = -451.08666992188, ['y'] = -333.52026367188, ['z'] = 34.021533966064 }, + { ['x'] = 322.36480712891, ['y'] = -1900.4990234375, ['z'] = 25.773607254028 }, } for i=1, #Config.Towables, 1 do - - Config.Zones['Towable' .. i] = { - Pos = Config.Towables[i], - Size = {x = 1.5, y = 1.5, z = 1.0}, - Color = {r = 204, g = 204, b = 0}, - Type = -1 - } - + Config.Zones['Towable' .. i] = { + Pos = Config.Towables[i], + Size = { x = 1.5, y = 1.5, z = 1.0 }, + Color = { r = 204, g = 204, b = 0 }, + Type = -1 + } end Config.Vehicles = { - 'adder', - 'asea', - 'asterope', - 'banshee', - 'buffalo' + 'adder', + 'asea', + 'asterope', + 'banshee', + 'buffalo' } diff --git a/esx_mecanojob.sql b/esx_mecanojob.sql index 70391571..3e6459a1 100644 --- a/esx_mecanojob.sql +++ b/esx_mecanojob.sql @@ -21,10 +21,10 @@ INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_ ; INSERT INTO `items` (name, label) VALUES - ('gazbottle', 'bouteille de gaz'), - ('fixtool', 'outils réparation'), - ('carotool', 'outils carosserie'), - ('blowpipe', 'Chalumeaux'), - ('fixkit', 'Kit réparation'), - ('carokit', 'Kit carosserie') -; \ No newline at end of file + ('gazbottle', 'bouteille de gaz'), + ('fixtool', 'outils réparation'), + ('carotool', 'outils carosserie'), + ('blowpipe', 'Chalumeaux'), + ('fixkit', 'Kit réparation'), + ('carokit', 'Kit carosserie') +; diff --git a/locales/en.lua b/locales/en.lua index 82846444..ba70ae8f 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -1,83 +1,82 @@ Locales['en'] = { - - ['mechanic'] = 'mechanic', - ['drive_to_indicated'] = '~y~Drive~s~ to the indicated location.', - ['mission_canceled'] = 'Mission ~r~canceled~s~', - ['vehicle_list'] = 'vehicle List', - ['work_wear'] = 'workwear', - ['civ_wear'] = 'civilian clothes', - ['deposit_stock'] = 'deposit Stock', - ['withdraw_stock'] = 'withdraw Stock', - ['boss_actions'] = 'boss Actions', - ['service_vehicle'] = 'service Vehicle', - ['flat_bed'] = 'flatbed', - ['tow_truck'] = 'tow Truck', - ['service_full'] = 'service full: ', - ['open_actions'] = 'Press ~INPUT_CONTEXT~ to access the menu.', - ['harvest'] = 'harvest', - ['harvest_menu'] = 'press ~INPUT_CONTEXT~ to access the harvest menu.', - ['not_experienced_enough'] = 'you are not ~r~experienced enough~s~ 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 ~INPUT_CONTEXT~ to access the crafting menu.', - ['billing'] = 'billing', - ['hijack'] = 'hijack', - ['repair'] = 'repair', - ['clean'] = 'clean', - ['imp_veh'] = 'impound', - ['place_objects'] = 'place Objects', - ['invoice_amount'] = 'invoice Amount', - ['amount_invalid'] = 'invalid amount', - ['no_players_nearby'] = 'no players nearby', - ['vehicle_unlocked'] = 'vehicle ~g~Unlocked', - ['vehicle_repaired'] = 'vehicle ~g~Repaired', - ['vehicle_cleaned'] = 'vehicle ~g~cleaned', - ['vehicle_impounded'] = 'vehicle ~r~Impounded', - ['must_seat_driver'] = 'you must be seated on the ~r~driver\'s side!', - ['must_near'] = 'you must be ~r~near a vehicle~s~ to impound it.', - ['vehicle_success_attached'] = 'vehicle successfully ~b~attached~s~!.', - ['please_drop_off'] = 'please drop off the vehicle at the dealership', - ['cant_attach_own_tt'] = '~r~you can\'t~s~ attach own tow truck', - ['no_veh_att'] = 'there is no ~r~vehicle~s~ to be attached', - ['not_right_veh'] = 'this is not the right vehicle', - ['veh_det_succ'] = 'vehicle successfully ~b~dettached~s~!', - ['imp_flatbed'] = '~r~Action impossible!~s~ You need a ~b~Flatbed~s~ for it', - ['objects'] = 'objects', - ['roadcone'] = 'roadcone', - ['toolbox'] = 'toolbox', - ['mechanic_stock'] = 'mechanic Stock', - ['quantity'] = 'quantity', - ['invalid_quantity'] = 'invalid quantity', - ['inventory'] = 'inventory', - ['veh_unlocked'] = '~g~Vehicle Unlocked', - ['hijack_failed'] = '~r~Hijack Failed', - ['body_repaired'] = '~g~Body repaired', - ['veh_repaired'] = '~g~Vehicle Repaired', - ['veh_stored'] = 'press ~INPUT_CONTEXT~ to store the vehicle.', - ['press_remove_obj'] = 'press ~INPUT_CONTEXT~ to remove the object', - ['please_tow'] = 'please ~y~tow~s~ the vehicle', - ['wait_five'] = 'you must ~r~wait~s~ 5 mintes', - ['must_in_flatbed'] = 'you must be in a flatbed to being the mission', - ['mechanic_customer'] = 'mechanic Customer', - ['you_do_not_room'] = '~r~You do not have more room', - ['recovery_gas_can'] = '~b~Gas Can~s~ Retrieval...', - ['recovery_repair_tools'] = '~b~Repair Tools~s~ Retrieval...', - ['recovery_body_tools'] = '~b~Body Tools~s~ Retrieval...', - ['not_enough_gas_can'] = 'You do not ~r~have enough~s~ gas cans.', - ['assembling_blowtorch'] = 'Assembling ~b~Blowtorch~s~...', - ['not_enough_repair_tools'] = 'You do not ~r~have enough~s~ repair tools.', - ['assembling_repair_kit'] = 'Assembling ~b~Repair Kit~s~...', - ['not_enough_body_tools'] = 'You do not ~r~have enough~s~ body tools.', - ['assembling_body_kit'] = 'Assembling ~b~Body Kit~s~...', - ['your_comp_earned'] = 'your company has ~g~earned~s~ ~g~$', - ['you_used_blowtorch'] = 'you used a ~b~blowtorch', - ['you_used_repair_kit'] = 'you used a ~b~Repair Kit', - ['you_used_body_kit'] = 'you used a ~b~Body Kit', - ['you_removed'] = 'you have removed x', - ['you_added'] = 'you have added x', + ['mechanic'] = 'mechanic', + ['drive_to_indicated'] = '~y~Drive~s~ to the indicated location.', + ['mission_canceled'] = 'Mission ~r~canceled~s~', + ['vehicle_list'] = 'vehicle List', + ['work_wear'] = 'workwear', + ['civ_wear'] = 'civilian clothes', + ['deposit_stock'] = 'deposit Stock', + ['withdraw_stock'] = 'withdraw Stock', + ['boss_actions'] = 'boss Actions', + ['service_vehicle'] = 'service Vehicle', + ['flat_bed'] = 'flatbed', + ['tow_truck'] = 'tow Truck', + ['service_full'] = 'service full: ', + ['open_actions'] = 'Press ~INPUT_CONTEXT~ to access the menu.', + ['harvest'] = 'harvest', + ['harvest_menu'] = 'press ~INPUT_CONTEXT~ to access the harvest menu.', + ['not_experienced_enough'] = 'you are not ~r~experienced enough~s~ 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 ~INPUT_CONTEXT~ to access the crafting menu.', + ['billing'] = 'billing', + ['hijack'] = 'hijack', + ['repair'] = 'repair', + ['clean'] = 'clean', + ['imp_veh'] = 'impound', + ['place_objects'] = 'place Objects', + ['invoice_amount'] = 'invoice Amount', + ['amount_invalid'] = 'invalid amount', + ['no_players_nearby'] = 'no players nearby', + ['vehicle_unlocked'] = 'vehicle ~g~Unlocked', + ['vehicle_repaired'] = 'vehicle ~g~Repaired', + ['vehicle_cleaned'] = 'vehicle ~g~cleaned', + ['vehicle_impounded'] = 'vehicle ~r~Impounded', + ['must_seat_driver'] = 'you must be seated on the ~r~driver\'s side!', + ['must_near'] = 'you must be ~r~near a vehicle~s~ to impound it.', + ['vehicle_success_attached'] = 'vehicle successfully ~b~attached~s~!.', + ['please_drop_off'] = 'please drop off the vehicle at the dealership', + ['cant_attach_own_tt'] = '~r~you can\'t~s~ attach own tow truck', + ['no_veh_att'] = 'there is no ~r~vehicle~s~ to be attached', + ['not_right_veh'] = 'this is not the right vehicle', + ['veh_det_succ'] = 'vehicle successfully ~b~dettached~s~!', + ['imp_flatbed'] = '~r~Action impossible!~s~ You need a ~b~Flatbed~s~ for it', + ['objects'] = 'objects', + ['roadcone'] = 'roadcone', + ['toolbox'] = 'toolbox', + ['mechanic_stock'] = 'mechanic Stock', + ['quantity'] = 'quantity', + ['invalid_quantity'] = 'invalid quantity', + ['inventory'] = 'inventory', + ['veh_unlocked'] = '~g~Vehicle Unlocked', + ['hijack_failed'] = '~r~Hijack Failed', + ['body_repaired'] = '~g~Body repaired', + ['veh_repaired'] = '~g~Vehicle Repaired', + ['veh_stored'] = 'press ~INPUT_CONTEXT~ to store the vehicle.', + ['press_remove_obj'] = 'press ~INPUT_CONTEXT~ to remove the object', + ['please_tow'] = 'please ~y~tow~s~ the vehicle', + ['wait_five'] = 'you must ~r~wait~s~ 5 mintes', + ['must_in_flatbed'] = 'you must be in a flatbed to being the mission', + ['mechanic_customer'] = 'mechanic Customer', + ['you_do_not_room'] = '~r~You do not have more room', + ['recovery_gas_can'] = '~b~Gas Can~s~ Retrieval...', + ['recovery_repair_tools'] = '~b~Repair Tools~s~ Retrieval...', + ['recovery_body_tools'] = '~b~Body Tools~s~ Retrieval...', + ['not_enough_gas_can'] = 'You do not ~r~have enough~s~ gas cans.', + ['assembling_blowtorch'] = 'Assembling ~b~Blowtorch~s~...', + ['not_enough_repair_tools'] = 'You do not ~r~have enough~s~ repair tools.', + ['assembling_repair_kit'] = 'Assembling ~b~Repair Kit~s~...', + ['not_enough_body_tools'] = 'You do not ~r~have enough~s~ body tools.', + ['assembling_body_kit'] = 'Assembling ~b~Body Kit~s~...', + ['your_comp_earned'] = 'your company has ~g~earned~s~ ~g~$', + ['you_used_blowtorch'] = 'you used a ~b~blowtorch', + ['you_used_repair_kit'] = 'you used a ~b~Repair Kit', + ['you_used_body_kit'] = 'you used a ~b~Body Kit', + ['you_removed'] = 'you have removed x', + ['you_added'] = 'you have added x', } diff --git a/locales/fr.lua b/locales/fr.lua index a5651c83..aacdc13e 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -1,83 +1,82 @@ Locales['fr'] = { - - ['mechanic'] = 'mecano', - ['drive_to_indicated'] = '~y~Conduisez~s~ jusqu\'à l\'endroit indiqué', - ['mission_canceled'] = 'Mission ~r~annulée~s~', - ['vehicle_list'] = 'sortir Véhicule', - ['work_wear'] = 'tenue de travail', - ['civ_wear'] = 'Tenue civile', - ['deposit_stock'] = 'Déposer Stock', - ['withdraw_stock'] = 'Prendre Stock', - ['boss_actions'] = 'action Patron', - ['service_vehicle'] = 'Véhicule de service', - ['flat_bed'] = 'plateau', - ['tow_truck'] = 'dépaneuse', - ['service_full'] = 'service complet : ', - ['open_actions'] = 'Appuyez sur ~INPUT_CONTEXT~ pour accéder au menu.', - ['harvest'] = 'récolte', - ['harvest_menu'] = 'Appuyez sur ~INPUT_CONTEXT~ pour accéder au menu de récolte.', - ['not_experienced_enough'] = 'Vous n\'êtes ~r~pas assez expérimenté~s~ pour effectuer cette action.', - ['gas_can'] = 'Bouteille de gaz', - ['repair_tools'] = 'Outils réparation', - ['body_work_tools'] = 'Outils Carosserie', - ['blowtorch'] = 'chalumeaux', - ['repair_kit'] = 'kit Réparation', - ['body_kit'] = 'kit Carosserie', - ['craft'] = 'etabli', - ['craft_menu'] = 'appuyez sur ~INPUT_CONTEXT~ pour accéder au menu établi.', - ['billing'] = 'facturation', - ['hijack'] = 'crocheter', - ['repair'] = 'réparer', - ['clean'] = 'nettoyer', - ['impound'] = 'fourrière', - ['place_objects'] = 'placer objets', - ['invoice_amount'] = 'montant de la facture', - ['amount_invalid'] = 'montant invalide', - ['no_players_nearby'] = 'aucun joueur à proximité', - ['vehicle_unlocked'] = 'véhicule ~g~déverouillé', - ['vehicle_repaired'] = 'véhicule ~g~réparé', - ['vehicle_cleaned'] = 'véhicule ~g~néttoyé', - ['vehicle_impounded'] = 'vehicule ~r~mis en fourrière', - ['must_seat_driver'] = 'vous devez être assis du ~r~côté conducteur!', - ['must_near'] = 'vous devez être ~r~près d\'un véhicule~s~ pour le mettre en fourrière', - ['vehicle_success_attached'] = 'vehicule ~b~attaché~s~ avec succès!', - ['please_drop_off'] = 'veuillez déposer le véhicule à la concession', - ['cant_attach_own_tt'] = '~r~Impossible~s~ d\'attacher votre propre dépanneuse', - ['no_veh_att'] = 'il n\'y a ~r~pas de véhicule~s~ à attacher', - ['not_right_veh'] = 'ce n\'est pas le bon véhicule', - ['veh_det_succ'] = 'vehicule ~b~détattaché~s~ avec succès!', - ['imp_flatbed'] = '~r~Impossible! ~s~Vous devez avoir un ~b~Flatbed ~s~pour ça', - ['objects'] = 'objets', - ['roadcone'] = 'plot', - ['toolbox'] = 'boîte à outils', - ['mechanic_stock'] = 'mecano Stock', - ['quantity'] = 'quantité', - ['invalid_quantity'] = 'quantité invalide', - ['inventory'] = 'inventaire', - ['veh_unlocked'] = '~g~Véhicule déverouillé', - ['hijack_failed'] = '~r~Crochetage raté', - ['body_repaired'] = '~g~Carosserie réparée', - ['veh_repaired'] = '~g~Véhicule réparé', - ['veh_stored'] = 'appuyez sur ~INPUT_CONTEXT~ pour ranger le véhicule.', - ['press_remove_obj'] = 'appuyez sur ~INPUT_CONTEXT~ pour enlever l\'object', - ['please_tow'] = 'veuillez ~y~remorquer~s~ le véhicule', - ['wait_five'] = 'Vous devez ~r~attendre~s~ 5 minutes', - ['must_in_flatbed'] = 'Vous devez être en flatbed pour commencer la mission', - ['mechanic_customer'] = 'client mecano', - ['you_do_not_room'] = '~r~Vous n\'avez plus de place', - ['recovery_gas_can'] = 'Récupération de ~b~bouteille de gaz~s~...', - ['recovery_repair_tools'] = 'Récupération d\'~b~Outils réparation~s~...', - ['recovery_body_tools'] = 'Récupération d\'~b~Outils carosserie~s~...', - ['not_enough_gas_can'] = 'Vous n\'avez ~r~pas assez~s~ de bouteille de gaz', - ['assembling_blowtorch'] = 'Assemblage de ~b~Chalumeaux~s~...', - ['not_enough_repair_tools'] = 'Vous n\'avez ~r~pas assez~s~ d\'outils réparation', - ['assembling_blowtorch'] = 'Assemblage de ~b~Kit réparation~s~...', - ['not_enough_body_tools'] = 'Vous n\'avez ~r~pas assez~s~ d\'outils carosserie', - ['assembling_body_kit'] = 'Assemblage de ~b~kit carosserie~s~...', - ['your_comp_earned'] = 'Votre société a ~g~gagné~s~ ~g~$', - ['you_used_blowtorch'] = 'Vous avez utilisé un ~b~Chalumeau', - ['you_used_repair_kit'] = 'Vous avez utilisé un ~b~Kit de réparation', - ['you_used_body_kit'] = 'Vous avez utilisé un ~b~Kit de carosserie', - ['you_removed'] = 'vous avez retiré x', - ['you_added'] = 'Vous avez ajouté x', + ['mechanic'] = 'mecano', + ['drive_to_indicated'] = '~y~Conduisez~s~ jusqu\'à l\'endroit indiqué', + ['mission_canceled'] = 'Mission ~r~annulée~s~', + ['vehicle_list'] = 'sortir Véhicule', + ['work_wear'] = 'tenue de travail', + ['civ_wear'] = 'Tenue civile', + ['deposit_stock'] = 'Déposer Stock', + ['withdraw_stock'] = 'Prendre Stock', + ['boss_actions'] = 'action Patron', + ['service_vehicle'] = 'Véhicule de service', + ['flat_bed'] = 'plateau', + ['tow_truck'] = 'dépaneuse', + ['service_full'] = 'service complet : ', + ['open_actions'] = 'Appuyez sur ~INPUT_CONTEXT~ pour accéder au menu.', + ['harvest'] = 'récolte', + ['harvest_menu'] = 'Appuyez sur ~INPUT_CONTEXT~ pour accéder au menu de récolte.', + ['not_experienced_enough'] = 'Vous n\'êtes ~r~pas assez expérimenté~s~ pour effectuer cette action.', + ['gas_can'] = 'Bouteille de gaz', + ['repair_tools'] = 'Outils réparation', + ['body_work_tools'] = 'Outils Carosserie', + ['blowtorch'] = 'chalumeaux', + ['repair_kit'] = 'kit Réparation', + ['body_kit'] = 'kit Carosserie', + ['craft'] = 'etabli', + ['craft_menu'] = 'appuyez sur ~INPUT_CONTEXT~ pour accéder au menu établi.', + ['billing'] = 'facturation', + ['hijack'] = 'crocheter', + ['repair'] = 'réparer', + ['clean'] = 'nettoyer', + ['impound'] = 'fourrière', + ['place_objects'] = 'placer objets', + ['invoice_amount'] = 'montant de la facture', + ['amount_invalid'] = 'montant invalide', + ['no_players_nearby'] = 'aucun joueur à proximité', + ['vehicle_unlocked'] = 'véhicule ~g~déverouillé', + ['vehicle_repaired'] = 'véhicule ~g~réparé', + ['vehicle_cleaned'] = 'véhicule ~g~néttoyé', + ['vehicle_impounded'] = 'vehicule ~r~mis en fourrière', + ['must_seat_driver'] = 'vous devez être assis du ~r~côté conducteur!', + ['must_near'] = 'vous devez être ~r~près d\'un véhicule~s~ pour le mettre en fourrière', + ['vehicle_success_attached'] = 'vehicule ~b~attaché~s~ avec succès!', + ['please_drop_off'] = 'veuillez déposer le véhicule à la concession', + ['cant_attach_own_tt'] = '~r~Impossible~s~ d\'attacher votre propre dépanneuse', + ['no_veh_att'] = 'il n\'y a ~r~pas de véhicule~s~ à attacher', + ['not_right_veh'] = 'ce n\'est pas le bon véhicule', + ['veh_det_succ'] = 'vehicule ~b~détattaché~s~ avec succès!', + ['imp_flatbed'] = '~r~Impossible! ~s~Vous devez avoir un ~b~Flatbed ~s~pour ça', + ['objects'] = 'objets', + ['roadcone'] = 'plot', + ['toolbox'] = 'boîte à outils', + ['mechanic_stock'] = 'mecano Stock', + ['quantity'] = 'quantité', + ['invalid_quantity'] = 'quantité invalide', + ['inventory'] = 'inventaire', + ['veh_unlocked'] = '~g~Véhicule déverouillé', + ['hijack_failed'] = '~r~Crochetage raté', + ['body_repaired'] = '~g~Carosserie réparée', + ['veh_repaired'] = '~g~Véhicule réparé', + ['veh_stored'] = 'appuyez sur ~INPUT_CONTEXT~ pour ranger le véhicule.', + ['press_remove_obj'] = 'appuyez sur ~INPUT_CONTEXT~ pour enlever l\'object', + ['please_tow'] = 'veuillez ~y~remorquer~s~ le véhicule', + ['wait_five'] = 'Vous devez ~r~attendre~s~ 5 minutes', + ['must_in_flatbed'] = 'Vous devez être en flatbed pour commencer la mission', + ['mechanic_customer'] = 'client mecano', + ['you_do_not_room'] = '~r~Vous n\'avez plus de place', + ['recovery_gas_can'] = 'Récupération de ~b~bouteille de gaz~s~...', + ['recovery_repair_tools'] = 'Récupération d\'~b~Outils réparation~s~...', + ['recovery_body_tools'] = 'Récupération d\'~b~Outils carosserie~s~...', + ['not_enough_gas_can'] = 'Vous n\'avez ~r~pas assez~s~ de bouteille de gaz', + ['assembling_blowtorch'] = 'Assemblage de ~b~Chalumeaux~s~...', + ['not_enough_repair_tools'] = 'Vous n\'avez ~r~pas assez~s~ d\'outils réparation', + ['assembling_blowtorch'] = 'Assemblage de ~b~Kit réparation~s~...', + ['not_enough_body_tools'] = 'Vous n\'avez ~r~pas assez~s~ d\'outils carosserie', + ['assembling_body_kit'] = 'Assemblage de ~b~kit carosserie~s~...', + ['your_comp_earned'] = 'Votre société a ~g~gagné~s~ ~g~$', + ['you_used_blowtorch'] = 'Vous avez utilisé un ~b~Chalumeau', + ['you_used_repair_kit'] = 'Vous avez utilisé un ~b~Kit de réparation', + ['you_used_body_kit'] = 'Vous avez utilisé un ~b~Kit de carosserie', + ['you_removed'] = 'vous avez retiré x', + ['you_added'] = 'Vous avez ajouté x', } diff --git a/localization/esx_mecanojob_en.sql b/localization/esx_mecanojob_en.sql index 66571646..31c457f2 100644 --- a/localization/esx_mecanojob_en.sql +++ b/localization/esx_mecanojob_en.sql @@ -21,10 +21,10 @@ INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_ ; INSERT INTO `items` (name, label) VALUES - ('gazbottle', 'Gas Bottle'), - ('fixtool', 'Repair Tools'), - ('carotool', 'Tools'), - ('blowpipe', 'Blowtorch'), - ('fixkit', 'Repair Kit'), - ('carokit', 'Body Kit') + ('gazbottle', 'Gas Bottle'), + ('fixtool', 'Repair Tools'), + ('carotool', 'Tools'), + ('blowpipe', 'Blowtorch'), + ('fixkit', 'Repair Kit'), + ('carokit', 'Body Kit') ; diff --git a/server/main.lua b/server/main.lua index f7681785..44cd7b45 100644 --- a/server/main.lua +++ b/server/main.lua @@ -9,7 +9,7 @@ PlayersCrafting3 = {} TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) if Config.MaxInService ~= -1 then - TriggerEvent('esx_service:activateService', 'mecano', Config.MaxInService) + TriggerEvent('esx_service:activateService', 'mecano', Config.MaxInService) end TriggerEvent('esx_phone:registerNumber', 'mecano', _U('mechanic_customer'), true, true) @@ -19,205 +19,205 @@ TriggerEvent('esx_society:registerSociety', 'mecano', 'Mecano', 'society_mecano' ---- Sqlut je teste ------ local function Harvest(source) - SetTimeout(4000, function() + SetTimeout(4000, function() - if PlayersHarvesting[source] == true then + if PlayersHarvesting[source] == true then - local xPlayer = ESX.GetPlayerFromId(source) - local GazBottleQuantity = xPlayer.getInventoryItem('gazbottle').count + local xPlayer = ESX.GetPlayerFromId(source) + local GazBottleQuantity = xPlayer.getInventoryItem('gazbottle').count - if GazBottleQuantity >= 5 then - TriggerClientEvent('esx:showNotification', source, _U('you_do_not_room')) - else + if GazBottleQuantity >= 5 then + TriggerClientEvent('esx:showNotification', source, _U('you_do_not_room')) + else xPlayer.addInventoryItem('gazbottle', 1) - Harvest(source) - end - end - end) + Harvest(source) + end + end + end) end RegisterServerEvent('esx_mecanojob:startHarvest') AddEventHandler('esx_mecanojob:startHarvest', function() - local _source = source - PlayersHarvesting[_source] = true - TriggerClientEvent('esx:showNotification', _source, _U('recovery_gas_can')) - Harvest(source) + local _source = source + PlayersHarvesting[_source] = true + TriggerClientEvent('esx:showNotification', _source, _U('recovery_gas_can')) + Harvest(source) end) RegisterServerEvent('esx_mecanojob:stopHarvest') AddEventHandler('esx_mecanojob:stopHarvest', function() - local _source = source - PlayersHarvesting[_source] = false + local _source = source + PlayersHarvesting[_source] = false end) ------------ Récupération Outils Réparation -------------- local function Harvest2(source) - SetTimeout(4000, function() + SetTimeout(4000, function() - if PlayersHarvesting2[source] == true then + if PlayersHarvesting2[source] == true then - local xPlayer = ESX.GetPlayerFromId(source) - local FixToolQuantity = xPlayer.getInventoryItem('fixtool').count - if FixToolQuantity >= 5 then - TriggerClientEvent('esx:showNotification', source, _U('you_do_not_room')) - else + local xPlayer = ESX.GetPlayerFromId(source) + local FixToolQuantity = xPlayer.getInventoryItem('fixtool').count + if FixToolQuantity >= 5 then + TriggerClientEvent('esx:showNotification', source, _U('you_do_not_room')) + else xPlayer.addInventoryItem('fixtool', 1) - Harvest2(source) - end - end - end) + Harvest2(source) + end + end + end) end RegisterServerEvent('esx_mecanojob:startHarvest2') AddEventHandler('esx_mecanojob:startHarvest2', function() - local _source = source - PlayersHarvesting2[_source] = true - TriggerClientEvent('esx:showNotification', _source, _U('recovery_repair_tools')) - Harvest2(_source) + local _source = source + PlayersHarvesting2[_source] = true + TriggerClientEvent('esx:showNotification', _source, _U('recovery_repair_tools')) + Harvest2(_source) end) RegisterServerEvent('esx_mecanojob:stopHarvest2') AddEventHandler('esx_mecanojob:stopHarvest2', function() - local _source = source - PlayersHarvesting2[_source] = false + local _source = source + PlayersHarvesting2[_source] = false end) ----------------- Récupération Outils Carosserie ---------------- local function Harvest3(source) - SetTimeout(4000, function() + SetTimeout(4000, function() - if PlayersHarvesting3[source] == true then + if PlayersHarvesting3[source] == true then - local xPlayer = ESX.GetPlayerFromId(source) - local CaroToolQuantity = xPlayer.getInventoryItem('carotool').count + local xPlayer = ESX.GetPlayerFromId(source) + local CaroToolQuantity = xPlayer.getInventoryItem('carotool').count if CaroToolQuantity >= 5 then - TriggerClientEvent('esx:showNotification', source, _U('you_do_not_room')) - else + TriggerClientEvent('esx:showNotification', source, _U('you_do_not_room')) + else xPlayer.addInventoryItem('carotool', 1) - Harvest3(source) - end - end - end) + Harvest3(source) + end + end + end) end RegisterServerEvent('esx_mecanojob:startHarvest3') AddEventHandler('esx_mecanojob:startHarvest3', function() - local _source = source - PlayersHarvesting3[_source] = true - TriggerClientEvent('esx:showNotification', _source, _U('recovery_body_tools')) - Harvest3(_source) + local _source = source + PlayersHarvesting3[_source] = true + TriggerClientEvent('esx:showNotification', _source, _U('recovery_body_tools')) + Harvest3(_source) end) RegisterServerEvent('esx_mecanojob:stopHarvest3') AddEventHandler('esx_mecanojob:stopHarvest3', function() - local _source = source - PlayersHarvesting3[_source] = false + local _source = source + PlayersHarvesting3[_source] = false end) ------------ Craft Chalumeau ------------------- local function Craft(source) - SetTimeout(4000, function() + SetTimeout(4000, function() - if PlayersCrafting[source] == true then + if PlayersCrafting[source] == true then - local xPlayer = ESX.GetPlayerFromId(source) - local GazBottleQuantity = xPlayer.getInventoryItem('gazbottle').count + local xPlayer = ESX.GetPlayerFromId(source) + local GazBottleQuantity = xPlayer.getInventoryItem('gazbottle').count - if GazBottleQuantity <= 0 then - TriggerClientEvent('esx:showNotification', source, _U('not_enough_gas_can')) - else + if GazBottleQuantity <= 0 then + TriggerClientEvent('esx:showNotification', source, _U('not_enough_gas_can')) + else xPlayer.removeInventoryItem('gazbottle', 1) xPlayer.addInventoryItem('blowpipe', 1) - Craft(source) - end - end - end) + Craft(source) + end + end + end) end RegisterServerEvent('esx_mecanojob:startCraft') AddEventHandler('esx_mecanojob:startCraft', function() - local _source = source - PlayersCrafting[_source] = true - TriggerClientEvent('esx:showNotification', _source, _U('assembling_blowtorch')) - Craft(_source) + local _source = source + PlayersCrafting[_source] = true + TriggerClientEvent('esx:showNotification', _source, _U('assembling_blowtorch')) + Craft(_source) end) RegisterServerEvent('esx_mecanojob:stopCraft') AddEventHandler('esx_mecanojob:stopCraft', function() - local _source = source - PlayersCrafting[_source] = false + local _source = source + PlayersCrafting[_source] = false end) ------------ Craft kit Réparation -------------- local function Craft2(source) - SetTimeout(4000, function() + SetTimeout(4000, function() - if PlayersCrafting2[source] == true then + if PlayersCrafting2[source] == true then - local xPlayer = ESX.GetPlayerFromId(source) - local FixToolQuantity = xPlayer.getInventoryItem('fixtool').count - if FixToolQuantity <= 0 then - TriggerClientEvent('esx:showNotification', source, _U('not_enough_repair_tools')) - else + local xPlayer = ESX.GetPlayerFromId(source) + local FixToolQuantity = xPlayer.getInventoryItem('fixtool').count + if FixToolQuantity <= 0 then + TriggerClientEvent('esx:showNotification', source, _U('not_enough_repair_tools')) + else xPlayer.removeInventoryItem('fixtool', 1) xPlayer.addInventoryItem('fixkit', 1) - Craft2(source) - end - end - end) + Craft2(source) + end + end + end) end RegisterServerEvent('esx_mecanojob:startCraft2') AddEventHandler('esx_mecanojob:startCraft2', function() - local _source = source - PlayersCrafting2[_source] = true - TriggerClientEvent('esx:showNotification', _source, _U('assembling_blowtorch')) - Craft2(_source) + local _source = source + PlayersCrafting2[_source] = true + TriggerClientEvent('esx:showNotification', _source, _U('assembling_blowtorch')) + Craft2(_source) end) RegisterServerEvent('esx_mecanojob:stopCraft2') AddEventHandler('esx_mecanojob:stopCraft2', function() - local _source = source - PlayersCrafting2[_source] = false + local _source = source + PlayersCrafting2[_source] = false end) ----------------- Craft kit Carosserie ---------------- local function Craft3(source) - SetTimeout(4000, function() + SetTimeout(4000, function() - if PlayersCrafting3[source] == true then + if PlayersCrafting3[source] == true then - local xPlayer = ESX.GetPlayerFromId(source) - local CaroToolQuantity = xPlayer.getInventoryItem('carotool').count + local xPlayer = ESX.GetPlayerFromId(source) + local CaroToolQuantity = xPlayer.getInventoryItem('carotool').count if CaroToolQuantity <= 0 then - TriggerClientEvent('esx:showNotification', source, _U('not_enough_body_tools')) - else + TriggerClientEvent('esx:showNotification', source, _U('not_enough_body_tools')) + else xPlayer.removeInventoryItem('carotool', 1) xPlayer.addInventoryItem('carokit', 1) - Craft3(source) - end - end - end) + Craft3(source) + end + end + end) end RegisterServerEvent('esx_mecanojob:startCraft3') AddEventHandler('esx_mecanojob:startCraft3', function() - local _source = source - PlayersCrafting3[_source] = true - TriggerClientEvent('esx:showNotification', _source, _U('assembling_body_kit')) - Craft3(_source) + local _source = source + PlayersCrafting3[_source] = true + TriggerClientEvent('esx:showNotification', _source, _U('assembling_body_kit')) + Craft3(_source) end) RegisterServerEvent('esx_mecanojob:stopCraft3') AddEventHandler('esx_mecanojob:stopCraft3', function() - local _source = source - PlayersCrafting3[_source] = false + local _source = source + PlayersCrafting3[_source] = false end) ---------------------------- NPC Job Earnings ------------------------------------------------------ @@ -225,55 +225,55 @@ end) RegisterServerEvent('esx_mecanojob:onNPCJobMissionCompleted') AddEventHandler('esx_mecanojob:onNPCJobMissionCompleted', function() - local _source = source - local xPlayer = ESX.GetPlayerFromId(_source) + local _source = source + local xPlayer = ESX.GetPlayerFromId(_source) local total = math.random(Config.NPCJobEarnings.min, Config.NPCJobEarnings.max); if xPlayer.job.grade >= 3 then - total = total * 2 + total = total * 2 end TriggerEvent('esx_addonaccount:getSharedAccount', 'society_mecano', function(account) - account.addMoney(total) + account.addMoney(total) end) - TriggerClientEvent("esx:showNotification", _source, _U('your_comp_earned').. total) + TriggerClientEvent("esx:showNotification", _source, _U('your_comp_earned').. total) end) ---------------------------- register usable item -------------------------------------------------- ESX.RegisterUsableItem('blowpipe', function(source) - local _source = source - local xPlayer = ESX.GetPlayerFromId(source) + local _source = source + local xPlayer = ESX.GetPlayerFromId(source) - xPlayer.removeInventoryItem('blowpipe', 1) + xPlayer.removeInventoryItem('blowpipe', 1) - TriggerClientEvent('esx_mecanojob:onHijack', _source) + TriggerClientEvent('esx_mecanojob:onHijack', _source) TriggerClientEvent('esx:showNotification', _source, _U('you_used_blowtorch')) end) ESX.RegisterUsableItem('fixkit', function(source) - local _source = source - local xPlayer = ESX.GetPlayerFromId(source) + local _source = source + local xPlayer = ESX.GetPlayerFromId(source) - xPlayer.removeInventoryItem('fixkit', 1) + xPlayer.removeInventoryItem('fixkit', 1) - TriggerClientEvent('esx_mecanojob:onFixkit', _source) + TriggerClientEvent('esx_mecanojob:onFixkit', _source) TriggerClientEvent('esx:showNotification', _source, _U('you_used_repair_kit')) end) ESX.RegisterUsableItem('carokit', function(source) - local _source = source - local xPlayer = ESX.GetPlayerFromId(source) + local _source = source + local xPlayer = ESX.GetPlayerFromId(source) - xPlayer.removeInventoryItem('carokit', 1) + xPlayer.removeInventoryItem('carokit', 1) - TriggerClientEvent('esx_mecanojob:onCarokit', _source) + TriggerClientEvent('esx_mecanojob:onCarokit', _source) TriggerClientEvent('esx:showNotification', _source, _U('you_used_body_kit')) end) @@ -285,30 +285,30 @@ end) RegisterServerEvent('esx_mecanojob:getStockItem') AddEventHandler('esx_mecanojob:getStockItem', function(itemName, count) - local xPlayer = ESX.GetPlayerFromId(source) + local xPlayer = ESX.GetPlayerFromId(source) - TriggerEvent('esx_addoninventory:getSharedInventory', 'society_mecano', function(inventory) + TriggerEvent('esx_addoninventory:getSharedInventory', 'society_mecano', function(inventory) - local item = inventory.getItem(itemName) + local item = inventory.getItem(itemName) - if item.count >= count then - inventory.removeItem(itemName, count) - xPlayer.addInventoryItem(itemName, count) - else - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('invalid_quantity')) - end + if item.count >= count then + inventory.removeItem(itemName, count) + xPlayer.addInventoryItem(itemName, count) + else + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('invalid_quantity')) + end - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('you_removed') .. count .. ' ' .. item.label) + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('you_removed') .. count .. ' ' .. item.label) - end) + end) end) ESX.RegisterServerCallback('esx_mecanojob:getStockItems', function(source, cb) - TriggerEvent('esx_addoninventory:getSharedInventory', 'society_mecano', function(inventory) - cb(inventory.items) - end) + TriggerEvent('esx_addoninventory:getSharedInventory', 'society_mecano', function(inventory) + cb(inventory.items) + end) end) @@ -319,40 +319,40 @@ end) RegisterServerEvent('esx_mecanojob:putStockItems') AddEventHandler('esx_mecanojob:putStockItems', function(itemName, count) - local xPlayer = ESX.GetPlayerFromId(source) + local xPlayer = ESX.GetPlayerFromId(source) - TriggerEvent('esx_addoninventory:getSharedInventory', 'society_mecano', function(inventory) + TriggerEvent('esx_addoninventory:getSharedInventory', 'society_mecano', function(inventory) - local item = inventory.getItem(itemName) + local item = inventory.getItem(itemName) - if item.count >= 0 then - xPlayer.removeInventoryItem(itemName, count) - inventory.addItem(itemName, count) - else - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('invalid_quantity')) - end + if item.count >= 0 then + xPlayer.removeInventoryItem(itemName, count) + inventory.addItem(itemName, count) + else + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('invalid_quantity')) + end - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('you_added') .. count .. ' ' .. item.label) + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('you_added') .. count .. ' ' .. item.label) - end) + end) end) --ESX.RegisterServerCallback('esx_mecanojob:putStockItems', function(source, cb) --- TriggerEvent('esx_addoninventory:getSharedInventory', 'society_policestock', function(inventory) --- cb(inventory.items) --- end) +-- TriggerEvent('esx_addoninventory:getSharedInventory', 'society_policestock', function(inventory) +-- cb(inventory.items) +-- end) --end) ESX.RegisterServerCallback('esx_mecanojob:getPlayerInventory', function(source, cb) - local xPlayer = ESX.GetPlayerFromId(source) - local items = xPlayer.inventory + local xPlayer = ESX.GetPlayerFromId(source) + local items = xPlayer.inventory - cb({ - items = items - }) + cb({ + items = items + }) end)