From c4888631050e90a3f1789be15f5b77b9b793025b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Wed, 2 Aug 2017 11:45:30 +0200 Subject: [PATCH 01/93] Initial commit --- README.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 00000000..61175955 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# fxserver-esx_taxijob +FXServer ESX Taxi Job From 5c1ef492f9310cf7e2007382433dea9030778dd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Wed, 2 Aug 2017 11:46:00 +0200 Subject: [PATCH 02/93] Update README.md --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 61175955..b44a8792 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,15 @@ # fxserver-esx_taxijob FXServer ESX Taxi Job + +[INSTALLATION] + +1) CD in your resources/[esx] folder +2) Clone the repository +``` +git clone https://github.com/FXServer-ESX/fxserver-esx_taxijob esx_taxijob +``` +3) Add this in your server.cfg : + +``` +start esx_taxijob +``` From 4f9a6e887d5cc530d324173c58893a1a514aba9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Wed, 2 Aug 2017 12:05:23 +0200 Subject: [PATCH 03/93] Update README.md --- README.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b44a8792..d6f7b23a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,15 @@ # fxserver-esx_taxijob FXServer ESX Taxi Job +[REQUIREMENTS] + +* Auto mode +No need to download another resource + +* Player management (billing and boss actions) +- esx_society => https://github.com/FXServer-ESX/fxserver-esx_society +- esx_billing => https://github.com/FXServer-ESX/fxserver-esx_billing + [INSTALLATION] 1) CD in your resources/[esx] folder @@ -8,8 +17,12 @@ FXServer ESX Taxi Job ``` git clone https://github.com/FXServer-ESX/fxserver-esx_taxijob esx_taxijob ``` -3) Add this in your server.cfg : +3) - Auto mode : Import esx_taxijob_minimal.sql in your database + - Player management : Import esx_taxijob_full.sql in your database + +4) Add this in your server.cfg : ``` start esx_taxijob ``` +5) If you want player management you have to set Config.EnablePlayerManagement to true in config.lua From 0993140e86474e13d57de763a3a0673ce840f2bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Wed, 2 Aug 2017 12:05:49 +0200 Subject: [PATCH 04/93] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d6f7b23a..b1aeec46 100644 --- a/README.md +++ b/README.md @@ -17,8 +17,8 @@ No need to download another resource ``` git clone https://github.com/FXServer-ESX/fxserver-esx_taxijob esx_taxijob ``` -3) - Auto mode : Import esx_taxijob_minimal.sql in your database - - Player management : Import esx_taxijob_full.sql in your database +3) * Auto mode : Import esx_taxijob_minimal.sql in your database + * Player management : Import esx_taxijob_full.sql in your database 4) Add this in your server.cfg : From 47b662aab181103e61bff4a90996d5bf79e57080 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Wed, 2 Aug 2017 12:06:24 +0200 Subject: [PATCH 05/93] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b1aeec46..577f6681 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,11 @@ FXServer ESX Taxi Job [REQUIREMENTS] * Auto mode -No need to download another resource + * No need to download another resource * Player management (billing and boss actions) -- esx_society => https://github.com/FXServer-ESX/fxserver-esx_society -- esx_billing => https://github.com/FXServer-ESX/fxserver-esx_billing + * esx_society => https://github.com/FXServer-ESX/fxserver-esx_society + * esx_billing => https://github.com/FXServer-ESX/fxserver-esx_billing [INSTALLATION] From dcf8df0df8f3ff6e48b0e14fd109afcd286c5a59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Wed, 2 Aug 2017 12:11:31 +0200 Subject: [PATCH 06/93] Add files --- __resource.lua | 13 + client/main.lua | 756 ++++++++++++++++++++++++++++++++++++++++ config.lua | 124 +++++++ esx_taxijob_full.sql | 15 + esx_taxijob_minimal.sql | 11 + server/main.lua | 57 +++ 6 files changed, 976 insertions(+) create mode 100644 __resource.lua create mode 100644 client/main.lua create mode 100644 config.lua create mode 100644 esx_taxijob_full.sql create mode 100644 esx_taxijob_minimal.sql create mode 100644 server/main.lua diff --git a/__resource.lua b/__resource.lua new file mode 100644 index 00000000..d8e5a59d --- /dev/null +++ b/__resource.lua @@ -0,0 +1,13 @@ +resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' + +description 'ESX Taxi Job' + +client_scripts { + 'config.lua', + 'client/main.lua' +} + +server_scripts { + 'config.lua', + 'server/main.lua' +} \ No newline at end of file diff --git a/client/main.lua b/client/main.lua new file mode 100644 index 00000000..d2cfdb00 --- /dev/null +++ b/client/main.lua @@ -0,0 +1,756 @@ +local Keys = { + ["ESC"] = 322, ["F1"] = 288, ["F2"] = 289, ["F3"] = 170, ["F5"] = 166, ["F6"] = 167, ["F7"] = 168, ["F8"] = 169, ["F9"] = 56, ["F10"] = 57, + ["~"] = 243, ["1"] = 157, ["2"] = 158, ["3"] = 160, ["4"] = 164, ["5"] = 165, ["6"] = 159, ["7"] = 161, ["8"] = 162, ["9"] = 163, ["-"] = 84, ["="] = 83, ["BACKSPACE"] = 177, + ["TAB"] = 37, ["Q"] = 44, ["W"] = 32, ["E"] = 38, ["R"] = 45, ["T"] = 245, ["Y"] = 246, ["U"] = 303, ["P"] = 199, ["["] = 39, ["]"] = 40, ["ENTER"] = 18, + ["CAPS"] = 137, ["A"] = 34, ["S"] = 8, ["D"] = 9, ["F"] = 23, ["G"] = 47, ["H"] = 74, ["K"] = 311, ["L"] = 182, + ["LEFTSHIFT"] = 21, ["Z"] = 20, ["X"] = 73, ["C"] = 26, ["V"] = 0, ["B"] = 29, ["N"] = 249, ["M"] = 244, [","] = 82, ["."] = 81, + ["LEFTCTRL"] = 36, ["LEFTALT"] = 19, ["SPACE"] = 22, ["RIGHTCTRL"] = 70, + ["HOME"] = 213, ["PAGEUP"] = 10, ["PAGEDOWN"] = 11, ["DELETE"] = 178, + ["LEFT"] = 174, ["RIGHT"] = 175, ["TOP"] = 27, ["DOWN"] = 173, + ["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 +local CurrentActionMsg = '' +local CurrentActionData = {} +local OnJob = false +local CurrentCustomer = nil +local CurrentCustomerBlip = nil +local DestinationBlip = nil +local IsNearCustomer = false +local CustomerIsEnteringVehicle = false +local CustomerEnteredVehicle = false +local TargetCoords = nil + +Citizen.CreateThread(function() + while ESX == nil do + TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) + Citizen.Wait(0) + end +end) + +function DrawSub(msg, time) + ClearPrints() + SetTextEntry_2("STRING") + AddTextComponentString(msg) + DrawSubtitleTimed(time, 1) +end + +function ShowLoadingPromt(msg, time, type) + Citizen.CreateThread(function() + Citizen.Wait(0) + N_0xaba17d7ce615adbf("STRING") + AddTextComponentString(msg) + N_0xbd12f8228410d9b4(type) + Citizen.Wait(time) + N_0x10d373323e5b9c0d() + end) +end + +function GetRandomPed() + + local peds = {} + local handle, ped = FindFirstPed() + local success = nil + + repeat + table.insert(peds, ped) + success, ped = FindNextPed(handle) + until not success + + EndFindPed(handle) + + if #peds > 0 then + return peds[GetRandomIntInRange(1, #peds)] + end + +end + +function ClearCurrentMission() + + if DoesBlipExist(CurrentCustomerBlip) then + RemoveBlip(CurrentCustomerBlip) + end + + if DoesBlipExist(DestinationBlip) then + RemoveBlip(DestinationBlip) + end + + CurrentCustomer = nil + CurrentCustomerBlip = nil + DestinationBlip = nil + IsNearCustomer = false + CustomerIsEnteringVehicle = false + CustomerEnteredVehicle = false + TargetCoords = nil + +end + +function StartTaxiJob() + + ShowLoadingPromt('Prise de service : Taxi/Uber', 5000, 3) + ClearCurrentMission() + + OnJob = true + +end + +function StopTaxiJob() + + local playerPed = GetPlayerPed(-1) + + if IsPedInAnyVehicle(playerPed, false) and CurrentCustomer ~= nil then + local vehicle = GetVehiclePedIsIn(playerPed, false) + TaskLeaveVehicle(CurrentCustomer, vehicle, 0) + + if CustomerEnteredVehicle then + TaskGoStraightToCoord(CurrentCustomer, TargetCoords.x, TargetCoords.y, TargetCoords.z, 1.0, -1, 0.0, 0.0) + end + + end + + ClearCurrentMission() + + OnJob = false + + DrawSub('Mission terminée', 5000) + +end + +function OpenTaxiActionsMenu() + + local elements = { + {label = 'Sortir Véhicule', value = 'spawn_vehicle'} + } + + if Config.EnablePlayerManagement and PlayerData.job ~= nil and PlayerData.job.grade_name == 'boss' then + table.insert(elements, {label = 'Retirer argent société', value = 'withdraw_society_money'}) + table.insert(elements, {label = 'Déposer argent ', value = 'deposit_money'}) + table.insert(elements, {label = 'Blanchir argent', value = 'wash_money'}) + end + + ESX.UI.Menu.CloseAll() + + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'taxi_actions', + { + title = 'Taxi', + elements = elements + }, + function(data, menu) + + if data.current.value == 'spawn_vehicle' then + + menu.close() + + if Config.MaxInService == -1 then + + local playerPed = GetPlayerPed(-1) + local coords = Config.Zones.VehicleSpawnPoint.Pos + + ESX.Game.SpawnVehicle('taxi', coords, 225.0, function(vehicle) + TaskWarpPedIntoVehicle(playerPed, vehicle, -1) + end) + + else + + ESX.TriggerServerCallback('esx_service:enableService', function(canTakeService, maxInService, inServiceCount) + + if canTakeService then + + local playerPed = GetPlayerPed(-1) + local coords = Config.Zones.VehicleSpawnPoint.Pos + + ESX.Game.SpawnVehicle('taxi', coords, 225.0, function(vehicle) + TaskWarpPedIntoVehicle(playerPed, vehicle, -1) + end) + + else + + ESX.ShowNotification('Service complet : ' .. inServiceCount .. '/' .. maxInService) + + end + + end, 'taxi') + + end + + end + + if data.current.value == 'withdraw_society_money' then + + ESX.UI.Menu.Open( + 'dialog', GetCurrentResourceName(), 'withdraw_society_money_amount', + { + title = 'Montant du retrait' + }, + function(data, menu) + + local amount = tonumber(data.value) + + if amount == nil then + ESX.ShowNotification('Montant invalide') + else + menu.close() + TriggerServerEvent('esx_society:withdrawMoney', 'taxi', amount) + end + + end, + function(data, menu) + menu.close() + end + ) + + end + + if data.current.value == 'deposit_money' then + + ESX.UI.Menu.Open( + 'dialog', GetCurrentResourceName(), 'deposit_money_amount', + { + title = 'Montant du dépôt' + }, + function(data, menu) + + local amount = tonumber(data.value) + + if amount == nil then + ESX.ShowNotification('Montant invalide') + else + menu.close() + TriggerServerEvent('esx_society:depositMoney', 'taxi', amount) + end + + end, + function(data, menu) + menu.close() + end + ) + + end + + if data.current.value == 'wash_money' then + + ESX.UI.Menu.Open( + 'dialog', GetCurrentResourceName(), 'wash_money_amount', + { + title = 'Montant à blanchir' + }, + function(data, menu) + + local amount = tonumber(data.value) + + if amount == nil then + ESX.ShowNotification('Montant invalide') + else + menu.close() + TriggerServerEvent('esx_society:washMoney', 'taxi', amount) + end + + end, + function(data, menu) + menu.close() + end + ) + + end + + end, + function(data, menu) + + menu.close() + + CurrentAction = 'taxi_actions_menu' + CurrentActionMsg = 'Appuez sur ~INPUT_CONTEXT~ pour accéder au menu' + CurrentActionData = {} + + end + ) + +end + +function OpenMobileTaxiActionsMenu() + + ESX.UI.Menu.CloseAll() + + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'mobile_taxi_actions', + { + title = 'Taxi', + elements = { + {label = 'Facuration', value = 'billing'} + } + }, + function(data, menu) + + if data.current.value == 'billing' then + + ESX.UI.Menu.Open( + 'dialog', GetCurrentResourceName(), 'billing', + { + title = 'Montant de la facture' + }, + function(data, menu) + + local amount = tonumber(data.value) + + if amount == nil then + ESX.ShowNotification('Montant invalide') + else + + menu.close() + + local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer() + + if closestPlayer == -1 or closestDistance > 3.0 then + ESX.ShowNotification('Aucun joueur à proximité') + else + TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(closestPlayer), 'society_taxi', 'Taxi', amount) + end + + end + + end, + function(data, menu) + menu.close() + end + ) + + end + + end, + function(data, menu) + menu.close() + end + ) + +end + +RegisterNetEvent('esx:playerLoaded') +AddEventHandler('esx:playerLoaded', function(xPlayer) + PlayerData = xPlayer +end) + +RegisterNetEvent('esx:setJob') +AddEventHandler('esx:setJob', function(job) + PlayerData.job = job +end) + +AddEventHandler('esx_taxijob:hasEnteredMarker', function(zone) + + if zone == 'TaxiActions' then + CurrentAction = 'taxi_actions_menu' + CurrentActionMsg = 'Appuez sur ~INPUT_CONTEXT~ pour accéder au menu' + CurrentActionData = {} + end + + if zone == 'VehicleDeleter' then + + local playerPed = GetPlayerPed(-1) + + if IsPedInAnyVehicle(playerPed, false) then + CurrentAction = 'delete_vehicle' + CurrentActionMsg = 'Appuez sur ~INPUT_CONTEXT~ pour ranger le véhicule' + CurrentActionData = {} + end + + end + +end) + +AddEventHandler('esx_taxijob:hasExitedMarker', function(zone) + CurrentAction = nil +end) + +RegisterNetEvent('esx_phone:loaded') +AddEventHandler('esx_phone:loaded', function(phoneNumber, contacts) + + local specialContact = { + name = 'Taxi', + number = 'taxi', + base64Icon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAGGElEQVR4XsWWW2gd1xWGv7Vn5pyRj47ut8iOYlmyWxw1KSZN4riOW6eFuCYldaBtIL1Ag4NNmt5ICORCaNKXlF6oCy0hpSoJKW4bp7Sk6YNb01RuLq4d0pQ0kWQrshVJ1uX46HJ0zpy5rCKfQYgjCUs4kA+GtTd786+ftW8jqsqHibB6TLZn2zeq09ZTWAIWCxACoTI1E+6v+eSpXwHRqkVZPcmqlBzCApLQ8dk3IWVKMQlYcHG81OODNmD6D7d9VQrTSbwsH73lFKePtvOxXSfn48U+Xpb58fl5gPmgl6DiR19PZN4+G7iODY4liIAACqiCHyp+AFvb7ML3uot1QP5yDUim292RtIqfU6Lr8wFVDVV8AsPKRDAxzYkKm2kj5sSFuUT3+v2FXkDXakD6f+7c1NGS7Ml0Pkah6jq8mhvwUy7Cyijg5Aoks6/hTp+k7vRjDJ73dmw8WHxlJRM2y5Nsb3GPDuzsZURbGMsUmRkoUPByCMrKCG7SobJiO01X7OKq6utoe3XX34BaoLDaCljj3faTcu3j3z3T+iADwzNYEmKIWcGAIAtqqkKAxZa2Sja/tY+59/7y48aveQ8A4Woq4Fa3bj7Q1/EgwWRAZ52NMTYCWAZEwIhBUEQgUiVQ8IpKvqj4kVJCyGRCRrb+hvap+gPAo0DuUhWQfx2q29u+t/vPmarbCLwII7qQTEQRLbUtBJ2PAkZARBADqkLBV/I+BGrhpoSN577FWz3P3XbTvRMvAlpuwC4crv5jwtK9RAFSu46+G8cRwESxQ+K2gESAgCiIASHuA8YCBdSUohdCKGCF0H6iGc3MgrEphvKi+6Wp24HABioSjuxFARGobyJ5OMXEiGHW6iLR0EmifhPJDddj3CoqtuwEZSkCc73/RAvTeEOvU5w8gz/Zj2TfoLFFibZvQrI5EOFiPqgAZmzApTINKKgPiW20ffkXtPXfA9Ysmf5/kHn/T0z8e5rpCS5JVQNUN1ayfn2a+qvT2JWboOOXMPg0ms6C2IAAWTc2ACPeupdbm5yb8XNQczOM90DOB0uoa01Ttz5FZ6IL3Ctg9DUIg7Lto2DZ0HIDFEbAz4AaiBRyxZJe9U7kQg84KYbH/JeJESANXPXwXdWffvzu1p+x5VE4/ST4EyAOoEAI6WsAhdx/AYulhJDqAgRm/hPPEVAfnAboeAB6v88jTw/f98SzU8eAwbgC5IGRg3vsW3E7YewYzJwF4wAhikJURGqvBO8ouAFIxBI0gqgPEp9B86+ASSAIEEHhbEnX7eTgnrFbn3iW5+K82EAA+M2V+d2EeRj9K/izIBYgJZGwCO4Gzm/uRQOwDEsI41PSfPZ+xJsBKwFo6dOwpJvezMU84Md5sSmRCM51uacGbUKvHWEjAKIelXaGJqePyopjzFTdx6Ef/gDbjo3FKEoQKN+8/yEqRt8jf67IaNDBnF9FZFwERRGspMM20+XC64nym9AMhSE1G7fjbb0bCQsISi6vFCdPMPzuUwR9AcmOKQ7cew+WZcq3IGEYMZeb4p13sjjmU4TX7Cfdtp0oDAFBbZfk/37N0MALAKbcAKaY4yPeuwy3t2J8MAKDIxDVd1Lz8Ts599vb8Wameen532GspRWIQmXPHV8k0BquvPP3TOSgsRmiCFRAHWh9420Gi7nl34JaBen7O7UWRMD740AQ7yEf8nW78TIeN+7+PCIsOYaqMJHxqKtpJ++D+DA5ARsawEmASqzv1Cz7FjRpbt951tUAOcAHdNEUC7C5NAJo7Dws03CAFMxlkdSRZmCMxaq8ejKuVwSqIJfzA61LmyIgBoxZfgmYmQazKLGumHitRso0ZVkD0aE/FI7UrYv2WUYXjo0ihNhEatA1GBEUIxEWAcKCHhHCVMG8AETlda0ENn3hrm+/6Zh47RBCtXn+mZ/sAXzWjnPHV77zkiXBgl6gFkee+em1wBlgdnEF8sCF5moLI7KwlSIMwABwgbVT21htMNjleheAfPkShEBh/PzQccexdxBT9IPjQAYYZ+3o2OjQ8cQiPb+kVwBCliENXA3sAm6Zj3E/zaq4fD07HmwEmuKYXsUFcDl6Hz7/B1RGfEbPim/bAAAAAElFTkSuQmCC', + } + + TriggerEvent('esx_phone:addSpecialContact', specialContact.name, specialContact.number, specialContact.base64Icon) + +end) + +-- Create Blips +Citizen.CreateThread(function() + + local blip = AddBlipForCoord(Config.Zones.TaxiActions.Pos.x, Config.Zones.TaxiActions.Pos.y, Config.Zones.TaxiActions.Pos.z) + + SetBlipSprite (blip, 198) + SetBlipDisplay(blip, 4) + SetBlipScale (blip, 1.0) + SetBlipColour (blip, 5) + SetBlipAsShortRange(blip, true) + + BeginTextCommandSetBlipName("STRING") + AddTextComponentString("Taxi") + EndTextCommandSetBlipName(blip) + +end) + +-- Display markers +Citizen.CreateThread(function() + while true do + + Wait(0) + + if PlayerData.job ~= nil and PlayerData.job.name == 'taxi' then + + 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 +end) + +-- Enter / Exit marker events +Citizen.CreateThread(function() + while true do + + Wait(0) + + if PlayerData.job ~= nil and PlayerData.job.name == 'taxi' 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_taxijob:hasEnteredMarker', currentZone) + end + + if not isInMarker and HasAlreadyEnteredMarker then + HasAlreadyEnteredMarker = false + TriggerEvent('esx_taxijob:hasExitedMarker', LastZone) + end + + end + + end +end) + +-- Taxi Job +Citizen.CreateThread(function() + + while true do + + Citizen.Wait(0) + + local playerPed = GetPlayerPed(-1) + + if OnJob then + + if CurrentCustomer == nil then + + DrawSub('Conduisez à la recherche de ~y~passagers', 5000) + + if IsPedInAnyVehicle(playerPed, false) and GetEntitySpeed(playerPed) > 0 then + + local waitUntil = GetGameTimer() + GetRandomIntInRange(1000, 120000) + + while OnJob and waitUntil > GetGameTimer() do + Citizen.Wait(0) + end + + if OnJob and IsPedInAnyVehicle(playerPed, false) and GetEntitySpeed(playerPed) > 0 then + + while CurrentCustomer == nil do + + local ped = GetRandomPed() + + if IsPedHuman(ped) and IsPedWalking(ped) then + CurrentCustomer = ped + end + + end + + CurrentCustomerBlip = AddBlipForEntity(CurrentCustomer) + + SetBlipAsFriendly(CurrentCustomerBlip, 1) + SetBlipColour(CurrentCustomerBlip, 2) + SetBlipCategory(CurrentCustomerBlip, 3) + SetBlipRoute(CurrentCustomerBlip, true) + + SetEntityAsMissionEntity(CurrentCustomer, true) + ClearPedTasksImmediately(CurrentCustomer) + SetBlockingOfNonTemporaryEvents(CurrentCustomer, 1) + + local standTime = GetRandomIntInRange(60000, 180000) + + TaskStandStill(CurrentCustomer, standTime) + + ESX.ShowNotification('Vous avez ~g~trouvé~s~ un client, conduisez jusqu\'à ce dernier') + + end + + end + + else + + if IsPedFatallyInjured(CurrentCustomer) then + + ESX.ShowNotification('Votre client est ~r~inconscient~w~. Cherchez-en un autre.') + + if DoesBlipExist(CurrentCustomerBlip) then + RemoveBlip(CurrentCustomerBlip) + end + + if DoesBlipExist(DestinationBlip) then + RemoveBlip(DestinationBlip) + end + + SetEntityAsMissionEntity(CurrentCustomer, false) + + CurrentCustomer = nil + CurrentCustomerBlip = nil + DestinationBlip = nil + IsNearCustomer = false + CustomerIsEnteringVehicle = false + CustomerEnteredVehicle = false + TargetCoords = nil + + end + + if IsPedInAnyVehicle(playerPed, false) then + + local vehicle = GetVehiclePedIsIn(playerPed, false) + local playerCoords = GetEntityCoords(playerPed) + local customerCoords = GetEntityCoords(CurrentCustomer) + local customerDistance = GetDistanceBetweenCoords(playerCoords.x, playerCoords.y, playerCoords.z, customerCoords.x, customerCoords.y, customerCoords.z) + + if IsPedSittingInVehicle(CurrentCustomer, vehicle) then + + if CustomerEnteredVehicle then + + local targetDistance = GetDistanceBetweenCoords(playerCoords.x, playerCoords.y, playerCoords.z, TargetCoords.x, TargetCoords.y, TargetCoords.z) + + if targetDistance <= 10.0 then + + TaskLeaveVehicle(CurrentCustomer, vehicle, 0) + + ESX.ShowNotification('Vous êtes ~g~arrivé~s~ à destination') + + TaskGoStraightToCoord(CurrentCustomer, TargetCoords.x, TargetCoords.y, TargetCoords.z, 1.0, -1, 0.0, 0.0) + SetEntityAsMissionEntity(CurrentCustomer, false) + + TriggerServerEvent('esx_taxijob:success') + + RemoveBlip(DestinationBlip) + + CurrentCustomer = nil + CurrentCustomerBlip = nil + DestinationBlip = nil + IsNearCustomer = false + CustomerIsEnteringVehicle = false + CustomerEnteredVehicle = false + TargetCoords = nil + + end + + DrawMarker(1, TargetCoords.x, TargetCoords.y, TargetCoords.z - 1.0, 0, 0, 0, 0, 0, 0, 4.0, 4.0, 2.0, 178, 236, 93, 155, 0, 0, 2, 0, 0, 0, 0) + + else + + RemoveBlip(CurrentCustomerBlip) + + CurrentCustomerBlip = nil + + TargetCoords = Config.JobLocations[GetRandomIntInRange(1, #Config.JobLocations)] + + local street = table.pack(GetStreetNameAtCoord(TargetCoords.x, TargetCoords.y, TargetCoords.z)) + local msg = nil + + if street[2] ~= 0 and street[2] ~= nil then + msg = string.format("~w~Emmenez-moi à~y~ %s~w~, près de~y~ %s", GetStreetNameFromHashKey(street[1]),GetStreetNameFromHashKey(street[2])) + else + msg = string.format("~w~Emmenez-moi à~y~ %s", GetStreetNameFromHashKey(street[1])) + end + + ESX.ShowNotification(msg) + + DestinationBlip = AddBlipForCoord(TargetCoords.x, TargetCoords.y, TargetCoords.z) + + BeginTextCommandSetBlipName("STRING") + AddTextComponentString("Destination") + EndTextCommandSetBlipName(blip) + + SetBlipRoute(DestinationBlip, true) + + CustomerEnteredVehicle = true + + end + + else + + if not CustomerIsEnteringVehicle then + DrawMarker(1, customerCoords.x, customerCoords.y, customerCoords.z - 1.0, 0, 0, 0, 0, 0, 0, 4.0, 4.0, 2.0, 178, 236, 93, 155, 0, 0, 2, 0, 0, 0, 0) + end + + if not CustomerEnteredVehicle then + + if customerDistance <= 30.0 then + + if not IsNearCustomer then + ESX.ShowNotification('Vous êtes à proximité du client, approchez-vous de lui') + IsNearCustomer = true + end + + end + + if customerDistance <= 10.0 then + + if not CustomerIsEnteringVehicle then + + ClearPedTasksImmediately(CurrentCustomer) + + local seat = 0 + + for i=4, 0, 1 do + if IsVehicleSeatFree(vehicle, seat) then + seat = i + break + end + end + + TaskEnterVehicle(CurrentCustomer, vehicle, -1, seat, 2.0, 1) + + CustomerIsEnteringVehicle = true + + end + + end + + end + + end + + else + + DrawSub('Veuillez remonter dans votre véhicule pour continuer la mission', 5000) + + end + + end + + end + + end +end) + +-- Key Controls +Citizen.CreateThread(function() + while true do + + Citizen.Wait(0) + + if CurrentAction ~= nil then + + SetTextComponentFormat('STRING') + AddTextComponentString(CurrentActionMsg) + DisplayHelpTextFromStringLabel(0, 0, 1, -1) + + if IsControlPressed(0, Keys['E']) and PlayerData.job ~= nil and PlayerData.job.name == 'taxi' and (GetGameTimer() - GUI.Time) > 300 then + + if CurrentAction == 'taxi_actions_menu' then + OpenTaxiActionsMenu() + end + + if CurrentAction == 'delete_vehicle' then + + local playerPed = GetPlayerPed(-1) + local vehicle = GetVehiclePedIsIn(playerPed, false) + + if GetEntityModel(vehicle) == GetHashKey('taxi') then + + if Config.MaxInService ~= -1 then + TriggerServerEvent('esx_service:disableService', 'taxi') + end + + DeleteVehicle(vehicle) + else + ESX.ShowNotification('Vous ne pouvez ranger que les taxi') + end + + end + + CurrentAction = nil + GUI.Time = GetGameTimer() + + end + + end + + if IsControlPressed(0, Keys['F6']) and Config.EnablePlayerManagement and (GetGameTimer() - GUI.Time) > 150 then + OpenMobileTaxiActionsMenu() + GUI.Time = GetGameTimer() + end + + if IsControlPressed(0, Keys['DELETE']) and (GetGameTimer() - GUI.Time) > 150 then + + if OnJob then + StopTaxiJob() + else + + if PlayerData.job ~= nil and PlayerData.job.name == 'taxi' then + + local playerPed = GetPlayerPed(-1) + + if IsPedInAnyVehicle(playerPed, false) then + + local vehicle = GetVehiclePedIsIn(playerPed, false) + + if PlayerData.job.grade >= 3 then + StartTaxiJob() + else + if GetEntityModel(vehicle) == GetHashKey('taxi') then + StartTaxiJob() + else + ESX.ShowNotification('Vous devez être dans un taxi pour commencer la mission') + end + end + + else + + if PlayerData.job.grade >= 3 then + ESX.ShowNotification('Vous devez être dans un véhicule pour commencer la mission') + else + ESX.ShowNotification('Vous devez être dans un taxi pour commencer la mission') + end + + end + + end + + end + + GUI.Time = GetGameTimer() + + end + + end +end) \ No newline at end of file diff --git a/config.lua b/config.lua new file mode 100644 index 00000000..2f19dd8b --- /dev/null +++ b/config.lua @@ -0,0 +1,124 @@ +Config = {} +Config.DrawDistance = 100.0 +Config.NPCJobEarnings = {min = 15, max = 40} +Config.MaxInService = 2 +Config.EnablePlayerManagement = false + +Config.Zones = { + + TaxiActions = { + Pos = {x = 915.039, y = -162.187, z = 73.684}, + Size = {x = 1.5, y = 1.5, z = 1.0}, + Color = {r = 204, g = 204, b = 0}, + Type = 1 + }, + + VehicleSpawnPoint = { + Pos = {x = 911.108, y = -177.867, z = 74.283}, + Size = {x = 1.5, y = 1.5, z = 1.0}, + Type = -1 + }, + + VehicleDeleter = { + Pos = {x = 908.317, y = -183.070, z = 73.201}, + Size = {x = 3.0, y = 3.0, z = 1.0}, + Color = {r = 204, g = 204, b = 0}, + Type = 1 + } + +} + +Config.JobLocations = { + {x = 293.476, y = -590.163, z = 42.7371}, + {x = 253.404, y = -375.86, z = 44.0819}, + {x = 120.808, y = -300.416, z = 45.1399}, + {x = -38.4132, y = -381.576, z = 38.3456}, + {x = -107.442, y = -614.377, z = 35.6703}, + {x = -252.292, y = -856.474, z = 30.5626}, + {x = -236.138, y = -988.382, z = 28.7749}, + {x = -276.989, y = -1061.18, z = 25.6853}, + {x = -576.451, y = -998.989, z = 21.785}, + {x = -602.798, y = -952.63, z = 21.6353}, + {x = -790.653, y = -961.855, z = 14.8932}, + {x = -912.588, y = -864.756, z = 15.0057}, + {x = -1069.77, y = -792.513, z = 18.8075}, + {x = -1306.94, y = -854.085, z = 15.0959}, + {x = -1468.51, y = -681.363, z = 26.178}, + {x = -1380.89, y = -452.7, z = 34.0843}, + {x = -1326.35, y = -394.81, z = 36.0632}, + {x = -1383.68, y = -269.985, z = 42.4878}, + {x = -1679.61, y = -457.339, z = 39.4048}, + {x = -1812.45, y = -416.917, z = 43.6734}, + {x = -2043.64, y = -268.291, z = 22.9927}, + {x = -2186.45, y = -421.595, z = 12.6776}, + {x = -1862.08, y = -586.528, z = 11.1747}, + {x = -1859.5, y = -617.563, z = 10.8788}, + {x = -1634.95, y = -988.302, z = 12.6241}, + {x = -1283.99, y = -1154.16, z = 5.30998}, + {x = -1126.47, y = -1338.08, z = 4.63434}, + {x = -867.907, y = -1159.67, z = 5.00795}, + {x = -847.55, y = -1141.38, z = 6.27591}, + {x = -722.625, y = -1144.6, z = 10.2176}, + {x = -575.503, y = -318.446, z = 34.5273}, + {x = -592.309, y = -224.853, z = 36.1209}, + {x = -559.594, y = -162.873, z = 37.7547}, + {x = -534.992, y = -65.6695, z = 40.634}, + {x = -758.234, y = -36.6906, z = 37.2911}, + {x = -1375.88, y = 20.9516, z = 53.2255}, + {x = -1320.25, y = -128.018, z = 48.097}, + {x = -1285.71, y = 294.287, z = 64.4619}, + {x = -1245.67, y = 386.533, z = 75.0908}, + {x = -760.355, y = 285.015, z = 85.0667}, + {x = -626.786, y = 254.146, z = 81.0964}, + {x = -563.609, y = 267.962, z = 82.5116}, + {x = -486.806, y = 271.977, z = 82.8187}, + {x = 88.295, y = 250.867, z = 108.188}, + {x = 234.087, y = 344.678, z = 105.018}, + {x = 434.963, y = 96.707, z = 99.1713}, + {x = 482.617, y = -142.533, z = 58.1936}, + {x = 762.651, y = -786.55, z = 25.8915}, + {x = 809.06, y = -1290.8, z = 25.7946}, + {x = 490.819, y = -1751.37, z = 28.0987}, + {x = 432.351, y = -1856.11, z = 27.0352}, + {x = 164.348, y = -1734.54, z = 28.8982}, + {x = -57.6909, y = -1501.4, z = 31.1084}, + {x = 52.2241, y = -1566.65, z = 29.006}, + {x = 310.222, y = -1376.76, z = 31.4442}, + {x = 181.967, y = -1332.79, z = 28.8773}, + {x = -74.6091, y = -1100.64, z = 25.738}, + {x = -887.045, y = -2187.46, z = 8.13248}, + {x = -749.584, y = -2296.59, z = 12.4627}, + {x = -1064.83, y = -2560.66, z = 19.6811}, + {x = -1033.44, y = -2730.24, z = 19.6868}, + {x = -1018.67, y = -2732, z = 13.2687}, + {x = 797.354, y = -174.423, z = 72.708}, + {x = 508.156, y = -117.908, z = 60.78}, + {x = 159.458, y = -27.555, z = 67.38}, + {x = -36.382, y = -106.912, z = 56.982}, + {x = -355.801, y = -270.404, z = 33.011}, + {x = -831.196, y = -76.871, z = 37.323}, + {x = -1038.707, y = -214.593, z = 37}, + {x = 1918.448, y = 3691.41, z = 32.261}, + {x = 1820.217, y = 3697.115, z = 33.493}, + {x = 1619.323, y = 3827.162, z = 34.482}, + {x = 1418.628, y = 3602.243, z = 34.511}, + {x = 1944.858, y = 3856.252, z = 31.741}, + {x = 2285.278, y = 3839.444, z = 34.023}, + {x = 2760.945, y = 3387.813, z = 55.659}, + {x = 1952.819, y = 2627.731, z = 45.368}, + {x = 1051.414, y = 474.833, z = 93.653}, + {x = 866.393, y = 17.635, z = 78.654}, + {x = 318.985, y = 167.41, z = 103.335}, + {x = 88.836, y = 254.054, z = 108.236}, + {x = -44.852, y = 70.414, z = 72.437}, + {x = -115.496, y = 84.333, z = 70.792}, + {x = -384.806, y = 226.868, z = 83.548}, + {x = -578.669, y = 139.085, z = 61.337}, + {x = -651.334, y = -584.879, z = 34.116}, + {x = -571.847, y = -1195.648, z = 17.869}, + {x = -1513.271, y = -670.039, z = 28.362}, + {x = -1297.484, y = -654.913, z = 26.123}, + {x = -1645.546, y = 144.571, z = 61.664}, + {x = -1160.618, y = 744.418, z = 154.571}, + {x = -798.09, y = 831.699, z = 204.351}, +} \ No newline at end of file diff --git a/esx_taxijob_full.sql b/esx_taxijob_full.sql new file mode 100644 index 00000000..4294b763 --- /dev/null +++ b/esx_taxijob_full.sql @@ -0,0 +1,15 @@ +INSERT INTO `addon_account` VALUES (name, label, shared) + ('society_taxi','Taxi',1) +; + +INSERT INTO `jobs` (name, label) VALUES + ('taxi','Taxi') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('taxi',0,'recrue','Recrue',12,'{}','{}'), + ('taxi',1,'novice','Novice',24,'{}','{}'), + ('taxi',2,'experimente','Experimente',36,'{}','{}'), + ('taxi',3,'uber','Uber',48,'{}','{}'), + ('taxi',4,'boss','Patron',0,'{}','{}') +; diff --git a/esx_taxijob_minimal.sql b/esx_taxijob_minimal.sql new file mode 100644 index 00000000..074330de --- /dev/null +++ b/esx_taxijob_minimal.sql @@ -0,0 +1,11 @@ +INSERT INTO `jobs` (name, label) VALUES + ('taxi','Taxi') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('taxi',0,'recrue','Recrue',12,'{}','{}'), + ('taxi',1,'novice','Novice',24,'{}','{}'), + ('taxi',2,'experimente','Experimente',36,'{}','{}'), + ('taxi',3,'uber','Uber',48,'{}','{}'), + ('taxi',4,'boss','Patron',0,'{}','{}') +; diff --git a/server/main.lua b/server/main.lua new file mode 100644 index 00000000..3d46a5f2 --- /dev/null +++ b/server/main.lua @@ -0,0 +1,57 @@ +ESX = nil + +TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) + +if Config.MaxInService ~= -1 then + TriggerEvent('esx_service:activateService', 'taxi', Config.MaxInService) +end + +RegisterServerEvent('esx_taxijob:success') +AddEventHandler('esx_taxijob:success', function() + + local xPlayer = ESX.GetPlayerFromId(source) + local total = math.random(Config.NPCJobEarnings.min, Config.NPCJobEarnings.max); + local societyAccount = nil + + if xPlayer.job.grade >= 3 then + total = total * 2 + end + + TriggerEvent('esx_addonaccount:getSharedAccount', 'society_taxi', function(account) + societyAccount = account + end) + + if societyAccount ~= nil then + + local playerMoney = math.floor(total / 100 * 30) + local societyMoney = math.floor(total / 100 * 70) + + xPlayer.addMoney(playerMoney) + societyAccount.addMoney(societyMoney) + + TriggerClientEvent('esx:showNotification', xPlayer.source, 'Vous avez gagné ~g~$'.. playerMoney) + TriggerClientEvent('esx:showNotification', xPlayer.source, 'Votre société a gagné ~g~$'.. societyMoney) + + else + + xPlayer.addMoney(total) + TriggerClientEvent('esx:showNotification', xPlayer.source, 'Vous avez gagné ~g~$'.. total) + + end + +end) + +TriggerEvent('esx_phone:registerCallback', function(source, phoneNumber, message, anon) + + local xPlayer = ESX.GetPlayerFromId(source) + local xPlayers = ESX.GetPlayers() + + if phoneNumber == 'taxi' then + for k, v in pairs(xPlayers) do + if v.job.name == 'taxi' then + TriggerClientEvent('esx_phone:onMessage', v.source, xPlayer.get('phoneNumber'), message, xPlayer.get('coords'), anon, 'Appel Taxi') + end + end + end + +end) \ No newline at end of file From 7eff2640c6ef61be02aaf45f9b0691cfc6508aec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Fri, 4 Aug 2017 14:46:25 +0200 Subject: [PATCH 07/93] Add job check for taxi menu --- client/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/main.lua b/client/main.lua index d2cfdb00..5d5df427 100644 --- a/client/main.lua +++ b/client/main.lua @@ -705,7 +705,7 @@ Citizen.CreateThread(function() end - if IsControlPressed(0, Keys['F6']) and Config.EnablePlayerManagement and (GetGameTimer() - GUI.Time) > 150 then + if IsControlPressed(0, Keys['F6']) and Config.EnablePlayerManagement and PlayerData.job ~= nil and PlayerData.job.name == 'taxi' and (GetGameTimer() - GUI.Time) > 150 then OpenMobileTaxiActionsMenu() GUI.Time = GetGameTimer() end From f54fd1b7ffa7b2728c4f08cc143e9ed7503bd5a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Fri, 4 Aug 2017 16:32:31 +0200 Subject: [PATCH 08/93] Update esx_taxijob_full.sql --- esx_taxijob_full.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esx_taxijob_full.sql b/esx_taxijob_full.sql index 4294b763..2d3c1eec 100644 --- a/esx_taxijob_full.sql +++ b/esx_taxijob_full.sql @@ -1,4 +1,4 @@ -INSERT INTO `addon_account` VALUES (name, label, shared) +INSERT INTO `addon_account` (name, label, shared) VALUES ('society_taxi','Taxi',1) ; From 922b7e2434180483210670d94a5fbe9a20690633 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Sat, 5 Aug 2017 13:00:13 +0200 Subject: [PATCH 09/93] Add dispatch --- server/main.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/main.lua b/server/main.lua index 3d46a5f2..335362cc 100644 --- a/server/main.lua +++ b/server/main.lua @@ -49,7 +49,9 @@ TriggerEvent('esx_phone:registerCallback', function(source, phoneNumber, message if phoneNumber == 'taxi' then for k, v in pairs(xPlayers) do if v.job.name == 'taxi' then - TriggerClientEvent('esx_phone:onMessage', v.source, xPlayer.get('phoneNumber'), message, xPlayer.get('coords'), anon, 'Appel Taxi') + TriggerEvent('esx_phone:getDistpatchRequestId', function(requestId) + TriggerClientEvent('esx_phone:onMessage', v.source, xPlayer.get('phoneNumber'), message, xPlayer.get('coords'), anon, 'Appel Taxi', requestId) + end) end end end From ede43a0fa5288d151cdf8de252c5e82b4dad8843 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Mon, 7 Aug 2017 12:18:24 +0200 Subject: [PATCH 10/93] Update esx_taxijob_full.sql --- esx_taxijob_full.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/esx_taxijob_full.sql b/esx_taxijob_full.sql index 2d3c1eec..1faa40d0 100644 --- a/esx_taxijob_full.sql +++ b/esx_taxijob_full.sql @@ -1,3 +1,5 @@ +USE `essentialmode`; + INSERT INTO `addon_account` (name, label, shared) VALUES ('society_taxi','Taxi',1) ; From c886d83322fca6ef0ceea5b7e9caaf8dc08a5341 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Mon, 7 Aug 2017 12:18:37 +0200 Subject: [PATCH 11/93] Update esx_taxijob_minimal.sql --- esx_taxijob_minimal.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/esx_taxijob_minimal.sql b/esx_taxijob_minimal.sql index 074330de..9dd20e82 100644 --- a/esx_taxijob_minimal.sql +++ b/esx_taxijob_minimal.sql @@ -1,3 +1,5 @@ +USE `essentialmode`; + INSERT INTO `jobs` (name, label) VALUES ('taxi','Taxi') ; From d258d1c5b96402d32aac8729fd185b4ac7f32694 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Wed, 9 Aug 2017 14:15:52 +0200 Subject: [PATCH 12/93] Add LICENSE.txt --- LICENSE.txt | 674 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 674 insertions(+) create mode 100644 LICENSE.txt diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 00000000..30ace6a8 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + {one line to give the program's name and a brief idea of what it does.} + Copyright (C) {year} {name of author} + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + {project} Copyright (C) {year} {fullname} + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. \ No newline at end of file From bd4559667fe5c1ea9d51b3dc9d873623f7683ffe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Sun, 13 Aug 2017 21:17:07 +0200 Subject: [PATCH 13/93] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 577f6681..f29d2432 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,8 @@ FXServer ESX Taxi Job [REQUIREMENTS] * Auto mode - * No need to download another resource - + * esx_service => https://github.com/FXServer-ESX/fxserver-esx_service + * Player management (billing and boss actions) * esx_society => https://github.com/FXServer-ESX/fxserver-esx_society * esx_billing => https://github.com/FXServer-ESX/fxserver-esx_billing From 4201f4a7359baed13d1ee3e3c18a4279e66e54bd Mon Sep 17 00:00:00 2001 From: nearbyplayer Date: Tue, 15 Aug 2017 22:39:52 -0400 Subject: [PATCH 14/93] Multi-language support --- __resource.lua | 8 +++- client/main.lua | 104 ++++++++++++++++++++++++------------------------ config.lua | 3 +- locales/en.lua | 32 +++++++++++++++ locales/fr.lua | 32 +++++++++++++++ server/main.lua | 16 ++++---- 6 files changed, 133 insertions(+), 62 deletions(-) create mode 100644 locales/en.lua create mode 100644 locales/fr.lua diff --git a/__resource.lua b/__resource.lua index d8e5a59d..83660fa5 100644 --- a/__resource.lua +++ b/__resource.lua @@ -3,11 +3,17 @@ resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' description 'ESX Taxi Job' client_scripts { + '@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' -} \ No newline at end of file +} diff --git a/client/main.lua b/client/main.lua index 5d5df427..13944ad3 100644 --- a/client/main.lua +++ b/client/main.lua @@ -1,10 +1,10 @@ local Keys = { - ["ESC"] = 322, ["F1"] = 288, ["F2"] = 289, ["F3"] = 170, ["F5"] = 166, ["F6"] = 167, ["F7"] = 168, ["F8"] = 169, ["F9"] = 56, ["F10"] = 57, - ["~"] = 243, ["1"] = 157, ["2"] = 158, ["3"] = 160, ["4"] = 164, ["5"] = 165, ["6"] = 159, ["7"] = 161, ["8"] = 162, ["9"] = 163, ["-"] = 84, ["="] = 83, ["BACKSPACE"] = 177, + ["ESC"] = 322, ["F1"] = 288, ["F2"] = 289, ["F3"] = 170, ["F5"] = 166, ["F6"] = 167, ["F7"] = 168, ["F8"] = 169, ["F9"] = 56, ["F10"] = 57, + ["~"] = 243, ["1"] = 157, ["2"] = 158, ["3"] = 160, ["4"] = 164, ["5"] = 165, ["6"] = 159, ["7"] = 161, ["8"] = 162, ["9"] = 163, ["-"] = 84, ["="] = 83, ["BACKSPACE"] = 177, ["TAB"] = 37, ["Q"] = 44, ["W"] = 32, ["E"] = 38, ["R"] = 45, ["T"] = 245, ["Y"] = 246, ["U"] = 303, ["P"] = 199, ["["] = 39, ["]"] = 40, ["ENTER"] = 18, ["CAPS"] = 137, ["A"] = 34, ["S"] = 8, ["D"] = 9, ["F"] = 23, ["G"] = 47, ["H"] = 74, ["K"] = 311, ["L"] = 182, ["LEFTSHIFT"] = 21, ["Z"] = 20, ["X"] = 73, ["C"] = 26, ["V"] = 0, ["B"] = 29, ["N"] = 249, ["M"] = 244, [","] = 82, ["."] = 81, - ["LEFTCTRL"] = 36, ["LEFTALT"] = 19, ["SPACE"] = 22, ["RIGHTCTRL"] = 70, + ["LEFTCTRL"] = 36, ["LEFTALT"] = 19, ["SPACE"] = 22, ["RIGHTCTRL"] = 70, ["HOME"] = 213, ["PAGEUP"] = 10, ["PAGEDOWN"] = 11, ["DELETE"] = 178, ["LEFT"] = 174, ["RIGHT"] = 175, ["TOP"] = 27, ["DOWN"] = 173, ["NENTER"] = 201, ["N4"] = 108, ["N5"] = 60, ["N6"] = 107, ["N+"] = 96, ["N-"] = 97, ["N7"] = 117, ["N8"] = 61, ["N9"] = 118 @@ -93,8 +93,8 @@ function ClearCurrentMission() end function StartTaxiJob() - - ShowLoadingPromt('Prise de service : Taxi/Uber', 5000, 3) + + ShowLoadingPromt(_U('taking_service') .. 'Taxi/Uber', 5000, 3) ClearCurrentMission() OnJob = true @@ -102,7 +102,7 @@ function StartTaxiJob() end function StopTaxiJob() - + local playerPed = GetPlayerPed(-1) if IsPedInAnyVehicle(playerPed, false) and CurrentCustomer ~= nil then @@ -126,13 +126,13 @@ end function OpenTaxiActionsMenu() local elements = { - {label = 'Sortir Véhicule', value = 'spawn_vehicle'} + {label = _U('spawn_veh'), value = 'spawn_vehicle'} } if Config.EnablePlayerManagement and PlayerData.job ~= nil and PlayerData.job.grade_name == 'boss' then - table.insert(elements, {label = 'Retirer argent société', value = 'withdraw_society_money'}) - table.insert(elements, {label = 'Déposer argent ', value = 'deposit_money'}) - table.insert(elements, {label = 'Blanchir argent', value = 'wash_money'}) + table.insert(elements, {label = _U('remove_comp_money'), value = 'withdraw_society_money'}) + table.insert(elements, {label = _U('deposit_money'), value = 'deposit_money'}) + table.insert(elements, {label = _U('launder_money'), value = 'wash_money'}) end ESX.UI.Menu.CloseAll() @@ -173,7 +173,7 @@ function OpenTaxiActionsMenu() else - ESX.ShowNotification('Service complet : ' .. inServiceCount .. '/' .. maxInService) + ESX.ShowNotification(_U('full_service') .. inServiceCount .. '/' .. maxInService) end @@ -188,14 +188,14 @@ function OpenTaxiActionsMenu() ESX.UI.Menu.Open( 'dialog', GetCurrentResourceName(), 'withdraw_society_money_amount', { - title = 'Montant du retrait' + title = _U('withdraw_amount') }, function(data, menu) local amount = tonumber(data.value) if amount == nil then - ESX.ShowNotification('Montant invalide') + ESX.ShowNotification(_U('amount_invalid')) else menu.close() TriggerServerEvent('esx_society:withdrawMoney', 'taxi', amount) @@ -214,14 +214,14 @@ function OpenTaxiActionsMenu() ESX.UI.Menu.Open( 'dialog', GetCurrentResourceName(), 'deposit_money_amount', { - title = 'Montant du dépôt' + title = _U('deposit_amount') }, function(data, menu) local amount = tonumber(data.value) if amount == nil then - ESX.ShowNotification('Montant invalide') + ESX.ShowNotification(_U('amount_invalid')) else menu.close() TriggerServerEvent('esx_society:depositMoney', 'taxi', amount) @@ -240,14 +240,14 @@ function OpenTaxiActionsMenu() ESX.UI.Menu.Open( 'dialog', GetCurrentResourceName(), 'wash_money_amount', { - title = 'Montant à blanchir' + title = _U('launder_amount') }, function(data, menu) local amount = tonumber(data.value) if amount == nil then - ESX.ShowNotification('Montant invalide') + ESX.ShowNotification(_U('amount_invalid')) else menu.close() TriggerServerEvent('esx_society:washMoney', 'taxi', amount) @@ -267,7 +267,7 @@ function OpenTaxiActionsMenu() menu.close() CurrentAction = 'taxi_actions_menu' - CurrentActionMsg = 'Appuez sur ~INPUT_CONTEXT~ pour accéder au menu' + CurrentActionMsg = _U('press_to_open') CurrentActionData = {} end @@ -284,7 +284,7 @@ function OpenMobileTaxiActionsMenu() { title = 'Taxi', elements = { - {label = 'Facuration', value = 'billing'} + {label = _U('billing'), value = 'billing'} } }, function(data, menu) @@ -294,22 +294,22 @@ function OpenMobileTaxiActionsMenu() ESX.UI.Menu.Open( 'dialog', GetCurrentResourceName(), 'billing', { - title = 'Montant de la facture' + title = _U('invoice_amount') }, function(data, menu) local amount = tonumber(data.value) if amount == nil then - ESX.ShowNotification('Montant invalide') + ESX.ShowNotification(_U('amount_invalid')) else - + menu.close() - + local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer() if closestPlayer == -1 or closestDistance > 3.0 then - ESX.ShowNotification('Aucun joueur à proximité') + ESX.ShowNotification(_U('no_players_near')) else TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(closestPlayer), 'society_taxi', 'Taxi', amount) end @@ -346,7 +346,7 @@ AddEventHandler('esx_taxijob:hasEnteredMarker', function(zone) if zone == 'TaxiActions' then CurrentAction = 'taxi_actions_menu' - CurrentActionMsg = 'Appuez sur ~INPUT_CONTEXT~ pour accéder au menu' + CurrentActionMsg = _U('press_to_open') CurrentActionData = {} end @@ -356,7 +356,7 @@ AddEventHandler('esx_taxijob:hasEnteredMarker', function(zone) if IsPedInAnyVehicle(playerPed, false) then CurrentAction = 'delete_vehicle' - CurrentActionMsg = 'Appuez sur ~INPUT_CONTEXT~ pour ranger le véhicule' + CurrentActionMsg = _U('store_veh') CurrentActionData = {} end @@ -383,7 +383,7 @@ end) -- Create Blips Citizen.CreateThread(function() - + local blip = AddBlipForCoord(Config.Zones.TaxiActions.Pos.x, Config.Zones.TaxiActions.Pos.y, Config.Zones.TaxiActions.Pos.z) SetBlipSprite (blip, 198) @@ -401,13 +401,13 @@ end) -- Display markers Citizen.CreateThread(function() while true do - + Wait(0) - + if PlayerData.job ~= nil and PlayerData.job.name == 'taxi' then 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) @@ -422,9 +422,9 @@ end) -- Enter / Exit marker events Citizen.CreateThread(function() while true do - + Wait(0) - + if PlayerData.job ~= nil and PlayerData.job.name == 'taxi' then local coords = GetEntityCoords(GetPlayerPed(-1)) @@ -467,12 +467,12 @@ Citizen.CreateThread(function() if CurrentCustomer == nil then - DrawSub('Conduisez à la recherche de ~y~passagers', 5000) + DrawSub(_U('drive_search_pass'), 5000) if IsPedInAnyVehicle(playerPed, false) and GetEntitySpeed(playerPed) > 0 then local waitUntil = GetGameTimer() + GetRandomIntInRange(1000, 120000) - + while OnJob and waitUntil > GetGameTimer() do Citizen.Wait(0) end @@ -504,7 +504,7 @@ Citizen.CreateThread(function() TaskStandStill(CurrentCustomer, standTime) - ESX.ShowNotification('Vous avez ~g~trouvé~s~ un client, conduisez jusqu\'à ce dernier') + ESX.ShowNotification(_U('customer_found')) end @@ -514,7 +514,7 @@ Citizen.CreateThread(function() if IsPedFatallyInjured(CurrentCustomer) then - ESX.ShowNotification('Votre client est ~r~inconscient~w~. Cherchez-en un autre.') + ESX.ShowNotification(_U('client_unconcious')) if DoesBlipExist(CurrentCustomerBlip) then RemoveBlip(CurrentCustomerBlip) @@ -542,7 +542,7 @@ Citizen.CreateThread(function() local playerCoords = GetEntityCoords(playerPed) local customerCoords = GetEntityCoords(CurrentCustomer) local customerDistance = GetDistanceBetweenCoords(playerCoords.x, playerCoords.y, playerCoords.z, customerCoords.x, customerCoords.y, customerCoords.z) - + if IsPedSittingInVehicle(CurrentCustomer, vehicle) then if CustomerEnteredVehicle then @@ -553,7 +553,7 @@ Citizen.CreateThread(function() TaskLeaveVehicle(CurrentCustomer, vehicle, 0) - ESX.ShowNotification('Vous êtes ~g~arrivé~s~ à destination') + ESX.ShowNotification(_U('arrive_dest')) TaskGoStraightToCoord(CurrentCustomer, TargetCoords.x, TargetCoords.y, TargetCoords.z, 1.0, -1, 0.0, 0.0) SetEntityAsMissionEntity(CurrentCustomer, false) @@ -586,9 +586,9 @@ Citizen.CreateThread(function() local msg = nil if street[2] ~= 0 and street[2] ~= nil then - msg = string.format("~w~Emmenez-moi à~y~ %s~w~, près de~y~ %s", GetStreetNameFromHashKey(street[1]),GetStreetNameFromHashKey(street[2])) + msg = string.format(_U('take_me_to_near'), GetStreetNameFromHashKey(street[1]),GetStreetNameFromHashKey(street[2])) else - msg = string.format("~w~Emmenez-moi à~y~ %s", GetStreetNameFromHashKey(street[1])) + msg = string.format(_U('take_me_to'), GetStreetNameFromHashKey(street[1])) end ESX.ShowNotification(msg) @@ -616,7 +616,7 @@ Citizen.CreateThread(function() if customerDistance <= 30.0 then if not IsNearCustomer then - ESX.ShowNotification('Vous êtes à proximité du client, approchez-vous de lui') + ESX.ShowNotification(_U('close_to_client')) IsNearCustomer = true end @@ -625,7 +625,7 @@ Citizen.CreateThread(function() if customerDistance <= 10.0 then if not CustomerIsEnteringVehicle then - + ClearPedTasksImmediately(CurrentCustomer) local seat = 0 @@ -638,7 +638,7 @@ Citizen.CreateThread(function() end TaskEnterVehicle(CurrentCustomer, vehicle, -1, seat, 2.0, 1) - + CustomerIsEnteringVehicle = true end @@ -651,7 +651,7 @@ Citizen.CreateThread(function() else - DrawSub('Veuillez remonter dans votre véhicule pour continuer la mission', 5000) + DrawSub(_U('return_to_veh'), 5000) end @@ -675,7 +675,7 @@ Citizen.CreateThread(function() DisplayHelpTextFromStringLabel(0, 0, 1, -1) if IsControlPressed(0, Keys['E']) and PlayerData.job ~= nil and PlayerData.job.name == 'taxi' and (GetGameTimer() - GUI.Time) > 300 then - + if CurrentAction == 'taxi_actions_menu' then OpenTaxiActionsMenu() end @@ -690,17 +690,17 @@ Citizen.CreateThread(function() if Config.MaxInService ~= -1 then TriggerServerEvent('esx_service:disableService', 'taxi') end - + DeleteVehicle(vehicle) else - ESX.ShowNotification('Vous ne pouvez ranger que les taxi') + ESX.ShowNotification(_U('only_taxi')) end end CurrentAction = nil GUI.Time = GetGameTimer() - + end end @@ -730,16 +730,16 @@ Citizen.CreateThread(function() if GetEntityModel(vehicle) == GetHashKey('taxi') then StartTaxiJob() else - ESX.ShowNotification('Vous devez être dans un taxi pour commencer la mission') + ESX.ShowNotification(_U('must_in_taxi')) end end else if PlayerData.job.grade >= 3 then - ESX.ShowNotification('Vous devez être dans un véhicule pour commencer la mission') + ESX.ShowNotification(_U('must_in_vehicle')) else - ESX.ShowNotification('Vous devez être dans un taxi pour commencer la mission') + ESX.ShowNotification(_U('must_in_taxi')) end end @@ -753,4 +753,4 @@ Citizen.CreateThread(function() end end -end) \ No newline at end of file +end) diff --git a/config.lua b/config.lua index 2f19dd8b..343775de 100644 --- a/config.lua +++ b/config.lua @@ -3,6 +3,7 @@ Config.DrawDistance = 100.0 Config.NPCJobEarnings = {min = 15, max = 40} Config.MaxInService = 2 Config.EnablePlayerManagement = false +Config.Locale = 'fr' Config.Zones = { @@ -121,4 +122,4 @@ Config.JobLocations = { {x = -1645.546, y = 144.571, z = 61.664}, {x = -1160.618, y = 744.418, z = 154.571}, {x = -798.09, y = 831.699, z = 204.351}, -} \ No newline at end of file +} diff --git a/locales/en.lua b/locales/en.lua new file mode 100644 index 00000000..3e1d049f --- /dev/null +++ b/locales/en.lua @@ -0,0 +1,32 @@ +Locales['en'] = { + + ['taking_service'] = 'taking service: ', + ['spawn_veh'] = 'spawn vehicle', + ['remove_comp_money'] = 'remove company money', + ['deposit_money'] = 'deposit money', + ['launder_money'] = 'launder money', + ['full_service'] = 'full service: ', + ['withdraw_amount'] = 'amount of withdrawal', + ['amount_invalid'] = 'amount invalid', + ['deposit_amount'] = 'amount to deposit', + ['launder_amount'] = 'amount to launder', + ['press_to_open'] = 'press ~INPUT_CONTEXT~ to access the menu' + ['billing'] = 'billing', + ['invoice_amount'] = 'invoice amount', + ['no_players_near'] = 'no players nearby', + ['store_veh'] = 'press ~INPUT_CONTEXT~ to store the vehicle', + ['drive_search_pass'] = 'driving in search of ~y~passengers', + ['customer_found'] = 'you have ~g~found~s~ a customer, drive until last', + ['client_unconcious'] = 'your client is ~r~unconscious~w~. Look for another one.', + ['arrive_dest'] = 'you have ~g~arrived~s~ at your destination', + ['take_me_to_near'] = '~w~Take me to~y~ %s~w~, near~y~ %s', + ['take_me_to'] = '~w~Take me to~y~ %s', + ['close_to_client'] = 'you are close to the client, get close to them', + ['return_to_veh'] = 'please return to your vehicle to continue the mission', + ['only_taxi'] = 'you can only storee taxis.', + ['must_in_taxi'] = 'you must be in a taxi to start the mission', + ['must_in_vehicle'] = 'you must be in a vehicle to begin the mission', + ['have_earned'] = 'you have earned ~g~$', + ['comp_earned'] = 'your company has earned ~g~$', + +} diff --git a/locales/fr.lua b/locales/fr.lua new file mode 100644 index 00000000..18347d4f --- /dev/null +++ b/locales/fr.lua @@ -0,0 +1,32 @@ +Locales['fr'] = { + + ['taking_service'] = 'prise de service : ', + ['spawn_veh'] = 'vortir véhicule', + ['remove_comp_money'] = 'retirer argent société', + ['deposit_money'] = 'déposer argent', + ['launder_money'] = 'blanchir argent', + ['full_service'] = 'service complet : ', + ['withdraw_amount'] = 'montant du retrait', + ['amount_invalid'] = 'montant invalide', + ['deposit_amount'] = 'montant du dépôt', + ['launder_amount'] = 'montant à blanchir', + ['press_to_open'] = 'appuyez sur ~INPUT_CONTEXT~ pour accéder au menu', + ['billing'] = 'facuration', + ['invoice_amount'] = 'montant de la facture', + ['no_players_near'] = 'aucun joueur à proximité', + ['store_veh'] = 'appuyez sur ~INPUT_CONTEXT~ pour ranger le véhicule', + ['drive_search_pass'] = 'conduisez à la recherche de ~y~passagers', + ['customer_found'] = 'vous avez ~g~trouvé~s~ un client, conduisez jusqu\'à ce dernier', + ['client_unconcious'] = 'votre client est ~r~inconscient~w~. Cherchez-en un autre.', + ['arrive_dest'] = 'vous êtes ~g~arrivé~s~ à destination', + ['take_me_to_near'] = '~w~Emmenez-moi à~y~ %s~w~, près de~y~ %s', + ['take_me_to'] = '~w~Emmenez-moi à~y~ %s', + ['close_to_client'] = 'vous êtes à proximité du client, approchez-vous de lui', + ['return_to_veh'] = 'veuillez remonter dans votre véhicule pour continuer la mission', + ['only_taxi'] = 'vous ne pouvez ranger que les taxi', + ['must_in_taxi'] = 'vous devez être dans un taxi pour commencer la mission', + ['must_in_vehicle'] = 'vous devez être dans un véhicule pour commencer la mission', + ['have_earned'] = 'vous avez gagné ~g~$', + ['comp_earned'] = 'votre société a gagné ~g~$', + +} diff --git a/server/main.lua b/server/main.lua index 335362cc..e92e5745 100644 --- a/server/main.lua +++ b/server/main.lua @@ -8,7 +8,7 @@ end RegisterServerEvent('esx_taxijob:success') AddEventHandler('esx_taxijob:success', function() - + local xPlayer = ESX.GetPlayerFromId(source) local total = math.random(Config.NPCJobEarnings.min, Config.NPCJobEarnings.max); local societyAccount = nil @@ -29,16 +29,16 @@ AddEventHandler('esx_taxijob:success', function() xPlayer.addMoney(playerMoney) societyAccount.addMoney(societyMoney) - TriggerClientEvent('esx:showNotification', xPlayer.source, 'Vous avez gagné ~g~$'.. playerMoney) - TriggerClientEvent('esx:showNotification', xPlayer.source, 'Votre société a gagné ~g~$'.. societyMoney) + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('have_earned') .. playerMoney) + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('comp_earned') .. societyMoney) else xPlayer.addMoney(total) - TriggerClientEvent('esx:showNotification', xPlayer.source, 'Vous avez gagné ~g~$'.. total) - + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('have_earned') .. total) + end - + end) TriggerEvent('esx_phone:registerCallback', function(source, phoneNumber, message, anon) @@ -55,5 +55,5 @@ TriggerEvent('esx_phone:registerCallback', function(source, phoneNumber, message end end end - -end) \ No newline at end of file + +end) From 2ff5d6f680099f6501073f9ae3fa8531efb6cc48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Wed, 16 Aug 2017 11:16:01 +0200 Subject: [PATCH 15/93] Fix locale file --- locales/en.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locales/en.lua b/locales/en.lua index 3e1d049f..754bf8af 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -10,7 +10,7 @@ Locales['en'] = { ['amount_invalid'] = 'amount invalid', ['deposit_amount'] = 'amount to deposit', ['launder_amount'] = 'amount to launder', - ['press_to_open'] = 'press ~INPUT_CONTEXT~ to access the menu' + ['press_to_open'] = 'press ~INPUT_CONTEXT~ to access the menu', ['billing'] = 'billing', ['invoice_amount'] = 'invoice amount', ['no_players_near'] = 'no players nearby', From d68812a929bd962accf0a2aeafedf2068e037de2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Wed, 16 Aug 2017 15:58:55 +0200 Subject: [PATCH 16/93] Close menus when exiting markers --- client/main.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/client/main.lua b/client/main.lua index 13944ad3..9669386e 100644 --- a/client/main.lua +++ b/client/main.lua @@ -365,6 +365,7 @@ AddEventHandler('esx_taxijob:hasEnteredMarker', function(zone) end) AddEventHandler('esx_taxijob:hasExitedMarker', function(zone) + ESX.UI.Menu.CloseAll() CurrentAction = nil end) From 0677f16990cbd8419a6c2a74007ac06d65adbd1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Wed, 16 Aug 2017 16:39:51 +0200 Subject: [PATCH 17/93] Fix wrong arguments --- client/main.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/main.lua b/client/main.lua index 9669386e..867c067b 100644 --- a/client/main.lua +++ b/client/main.lua @@ -472,7 +472,7 @@ Citizen.CreateThread(function() if IsPedInAnyVehicle(playerPed, false) and GetEntitySpeed(playerPed) > 0 then - local waitUntil = GetGameTimer() + GetRandomIntInRange(1000, 120000) + local waitUntil = GetGameTimer() + GetRandomIntInRange(1000, 30000) while OnJob and waitUntil > GetGameTimer() do Citizen.Wait(0) @@ -587,9 +587,9 @@ Citizen.CreateThread(function() local msg = nil if street[2] ~= 0 and street[2] ~= nil then - msg = string.format(_U('take_me_to_near'), GetStreetNameFromHashKey(street[1]),GetStreetNameFromHashKey(street[2])) + msg = string.format(_U('take_me_to_near', GetStreetNameFromHashKey(street[1]),GetStreetNameFromHashKey(street[2]))) else - msg = string.format(_U('take_me_to'), GetStreetNameFromHashKey(street[1])) + msg = string.format(_U('take_me_to', GetStreetNameFromHashKey(street[1]))) end ESX.ShowNotification(msg) From 9f73945dc6e94aff57c0ee35f3f131b289848d60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Wed, 16 Aug 2017 16:48:00 +0200 Subject: [PATCH 18/93] Fix local type --- locales/fr.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locales/fr.lua b/locales/fr.lua index 18347d4f..cad6a5ff 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -1,7 +1,7 @@ Locales['fr'] = { ['taking_service'] = 'prise de service : ', - ['spawn_veh'] = 'vortir véhicule', + ['spawn_veh'] = 'sortir véhicule', ['remove_comp_money'] = 'retirer argent société', ['deposit_money'] = 'déposer argent', ['launder_money'] = 'blanchir argent', From 8015a0620cf1b960350e7ffdce3837b3fef9a12f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Thu, 17 Aug 2017 09:43:41 +0200 Subject: [PATCH 19/93] Fix taxi mission crash --- client/main.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/main.lua b/client/main.lua index 867c067b..3ad129c7 100644 --- a/client/main.lua +++ b/client/main.lua @@ -573,7 +573,9 @@ Citizen.CreateThread(function() end - DrawMarker(1, TargetCoords.x, TargetCoords.y, TargetCoords.z - 1.0, 0, 0, 0, 0, 0, 0, 4.0, 4.0, 2.0, 178, 236, 93, 155, 0, 0, 2, 0, 0, 0, 0) + if TargetCoords ~= nil then + DrawMarker(1, TargetCoords.x, TargetCoords.y, TargetCoords.z - 1.0, 0, 0, 0, 0, 0, 0, 4.0, 4.0, 2.0, 178, 236, 93, 155, 0, 0, 2, 0, 0, 0, 0) + end else From e5391453cefb0a7f02c79838ef03c4c04b9b4bf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Thu, 17 Aug 2017 10:23:37 +0200 Subject: [PATCH 20/93] Add math.randomseed --- server/main.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/main.lua b/server/main.lua index e92e5745..4a33fc76 100644 --- a/server/main.lua +++ b/server/main.lua @@ -9,6 +9,8 @@ end RegisterServerEvent('esx_taxijob:success') AddEventHandler('esx_taxijob:success', function() + math.randomseed(os.time()) + local xPlayer = ESX.GetPlayerFromId(source) local total = math.random(Config.NPCJobEarnings.min, Config.NPCJobEarnings.max); local societyAccount = nil From 67ac40adfb4ac44bf151c6c98295db77263f25f1 Mon Sep 17 00:00:00 2001 From: TakumiBR <31086346+TakumiBR@users.noreply.github.com> Date: Thu, 17 Aug 2017 08:17:45 -0700 Subject: [PATCH 21/93] Add files via upload --- __resource.lua | 2 ++ locales/br.lua | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 locales/br.lua diff --git a/__resource.lua b/__resource.lua index 83660fa5..2f98bcc3 100644 --- a/__resource.lua +++ b/__resource.lua @@ -4,6 +4,7 @@ description 'ESX Taxi Job' client_scripts { '@es_extended/locale.lua', + 'locales/br.lua', 'locales/en.lua', 'locales/fr.lua', 'config.lua', @@ -12,6 +13,7 @@ client_scripts { server_scripts { '@es_extended/locale.lua', + 'locales/br.lua', 'locales/en.lua', 'locales/fr.lua', 'config.lua', diff --git a/locales/br.lua b/locales/br.lua new file mode 100644 index 00000000..bcd578e0 --- /dev/null +++ b/locales/br.lua @@ -0,0 +1,32 @@ +Locales['br'] = { + + ['taking_service'] = 'Pegando serviço: ', + ['spawn_veh'] = 'pegar veículo', + ['remove_comp_money'] = 'Remover dinheiro da empresa', + ['deposit_money'] = 'Depositar dinheiro', + ['launder_money'] = 'Lavar dinheiro', + ['full_service'] = 'Serviço completo: ', + ['withdraw_amount'] = 'Valor do saque', + ['amount_invalid'] = 'Valor inválido', + ['deposit_amount'] = 'Valor para deposito', + ['launder_amount'] = 'Valor para lavagem', + ['press_to_open'] = 'Pressione ~INPUT_CONTEXT~ para acessar o menu', + ['billing'] = 'Faturamento', + ['invoice_amount'] = 'Valor da fatura', + ['no_players_near'] = 'Nenhum jogador nas proximidades', + ['store_veh'] = 'Pressione ~INPUT_CONTEXT~ para guardar o veículo', + ['drive_search_pass'] = 'Dirigindo em busca de ~y~passageiros', + ['customer_found'] = 'Você ~g~encontrou~s~ um passageiro, dirija até o destino', + ['client_unconcious'] = 'Seu passageiro está ~r~insconsciente~w~. Procure por outro.', + ['arrive_dest'] = 'Você ~g~chegou~s~ ao seu destino', + ['take_me_to_near'] = '~w~Leve me para~y~ %s~w~, perto~y~ %s', + ['take_me_to'] = '~w~Leve me para~y~ %s', + ['close_to_client'] = 'Você está perto do passageiro, aproximisse dele', + ['return_to_veh'] = 'Volte para o seu veículo para continuar a missão', + ['only_taxi'] = 'Você só pode guardar taxis.', + ['must_in_taxi'] = 'Você deve estar em um táxi para começar a missão', + ['must_in_vehicle'] = 'Você deve estar em um veículo para começar a missão', + ['have_earned'] = 'Você ganhou ~g~$', + ['comp_earned'] = 'Sua empresa ganhou ~g~$', + +} From 5a54dd83cf4b8f559c252ea376d6d1c3bd4909aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Fri, 18 Aug 2017 10:20:54 +0200 Subject: [PATCH 22/93] Fix find ped --- client/main.lua | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/client/main.lua b/client/main.lua index 3ad129c7..d7409c27 100644 --- a/client/main.lua +++ b/client/main.lua @@ -484,28 +484,32 @@ Citizen.CreateThread(function() local ped = GetRandomPed() - if IsPedHuman(ped) and IsPedWalking(ped) then + if DoesEntityExist(ped) IsPedHuman(ped) and IsPedWalking(ped) and not IsPedAPlayer(ped) then CurrentCustomer = ped end end - CurrentCustomerBlip = AddBlipForEntity(CurrentCustomer) + if DoesEntityExist(ped) then - SetBlipAsFriendly(CurrentCustomerBlip, 1) - SetBlipColour(CurrentCustomerBlip, 2) - SetBlipCategory(CurrentCustomerBlip, 3) - SetBlipRoute(CurrentCustomerBlip, true) + CurrentCustomerBlip = AddBlipForEntity(CurrentCustomer) - SetEntityAsMissionEntity(CurrentCustomer, true) - ClearPedTasksImmediately(CurrentCustomer) - SetBlockingOfNonTemporaryEvents(CurrentCustomer, 1) + SetBlipAsFriendly(CurrentCustomerBlip, 1) + SetBlipColour(CurrentCustomerBlip, 2) + SetBlipCategory(CurrentCustomerBlip, 3) + SetBlipRoute(CurrentCustomerBlip, true) - local standTime = GetRandomIntInRange(60000, 180000) + SetEntityAsMissionEntity(CurrentCustomer, true, false) + ClearPedTasksImmediately(CurrentCustomer) + SetBlockingOfNonTemporaryEvents(CurrentCustomer, 1) - TaskStandStill(CurrentCustomer, standTime) + local standTime = GetRandomIntInRange(60000, 180000) - ESX.ShowNotification(_U('customer_found')) + TaskStandStill(CurrentCustomer, standTime) + + ESX.ShowNotification(_U('customer_found')) + + end end @@ -525,7 +529,7 @@ Citizen.CreateThread(function() RemoveBlip(DestinationBlip) end - SetEntityAsMissionEntity(CurrentCustomer, false) + SetEntityAsMissionEntity(CurrentCustomer, false, true) CurrentCustomer = nil CurrentCustomerBlip = nil @@ -557,7 +561,7 @@ Citizen.CreateThread(function() ESX.ShowNotification(_U('arrive_dest')) TaskGoStraightToCoord(CurrentCustomer, TargetCoords.x, TargetCoords.y, TargetCoords.z, 1.0, -1, 0.0, 0.0) - SetEntityAsMissionEntity(CurrentCustomer, false) + SetEntityAsMissionEntity(CurrentCustomer, false, true) TriggerServerEvent('esx_taxijob:success') From cea123213c1bf78ce8ea1ba2b90c7dbcda07eb27 Mon Sep 17 00:00:00 2001 From: ultratm Date: Fri, 18 Aug 2017 11:09:03 +0200 Subject: [PATCH 23/93] Add German language --- __resource.lua | 2 ++ locales/de.lua | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 locales/de.lua diff --git a/__resource.lua b/__resource.lua index 2f98bcc3..9a4b5b29 100644 --- a/__resource.lua +++ b/__resource.lua @@ -4,6 +4,7 @@ description 'ESX Taxi Job' client_scripts { '@es_extended/locale.lua', + 'locales/de.lua', 'locales/br.lua', 'locales/en.lua', 'locales/fr.lua', @@ -13,6 +14,7 @@ client_scripts { server_scripts { '@es_extended/locale.lua', + 'locales/de.lua', 'locales/br.lua', 'locales/en.lua', 'locales/fr.lua', diff --git a/locales/de.lua b/locales/de.lua new file mode 100644 index 00000000..dbf231cd --- /dev/null +++ b/locales/de.lua @@ -0,0 +1,32 @@ +Locales['de'] = { + + ['taking_service'] = 'Service annehmen: ', + ['spawn_veh'] = 'Fahrzeug spawnen', + ['remove_comp_money'] = 'Firmengeld abheben', + ['deposit_money'] = 'Geld einzahlen', + ['launder_money'] = 'Geld waschen', + ['full_service'] = 'Voller Service: ', + ['withdraw_amount'] = 'Betrag zum abheben', + ['amount_invalid'] = 'Betrag ungültig', + ['deposit_amount'] = 'Betrag zum einzahlen', + ['launder_amount'] = 'Betrag zum waschen', + ['press_to_open'] = 'Drücke ~INPUT_CONTEXT~ um das Menü zu öffnen', + ['billing'] = 'Rechnung', + ['invoice_amount'] = 'Rechnugsbetrag', + ['no_players_near'] = 'Kein Spieler in der Nähe', + ['store_veh'] = 'Drücke ~INPUT_CONTEXT~ um das Fahrzeug zu parken', + ['drive_search_pass'] = 'Auf der Suche nach ~y~Passagieren', + ['customer_found'] = 'du hast einen Passagier ~g~gefunden~s~ , Fahre in zum Ziel', + ['client_unconcious'] = 'dein Passagier ist ~r~bewusstlos~w~. Suche nach einem anderen.', + ['arrive_dest'] = 'du bist an deinem Ziel ~g~angekommen~s~', + ['take_me_to_near'] = '~w~Bring mich nach~y~ %s~w~, in der Nähe von~y~ %s', + ['take_me_to'] = '~w~Bring mich nach~y~ %s', + ['close_to_client'] = 'du bist nahe an dem Passagier, du musst noch näher ran', + ['return_to_veh'] = 'bitte kehre zu deinem Fahezeug zurück umd die Mission fortzuführen', + ['only_taxi'] = 'Du kannst nur Taxis parken.', + ['must_in_taxi'] = 'Du musst in einem Taxis sein umd die Mission starten zu können', + ['must_in_vehicle'] = 'Du musst in einem Fahrzeug sein um die Mission starten zu können', + ['have_earned'] = 'verdient ~g~$', + ['comp_earned'] = 'Die Firma verdient ~g~$', + +} From 2055280cc357d35f9a5859099b0d393c236c4a34 Mon Sep 17 00:00:00 2001 From: ultratm Date: Fri, 18 Aug 2017 11:35:02 +0200 Subject: [PATCH 24/93] add sql and config --- de_config.lua | 125 +++++++++++++++++++++++++++++++++++++ de_esx_taxijob_full.sql | 17 +++++ de_esx_taxijob_minimal.sql | 13 ++++ 3 files changed, 155 insertions(+) create mode 100644 de_config.lua create mode 100644 de_esx_taxijob_full.sql create mode 100644 de_esx_taxijob_minimal.sql diff --git a/de_config.lua b/de_config.lua new file mode 100644 index 00000000..eb2f05ce --- /dev/null +++ b/de_config.lua @@ -0,0 +1,125 @@ +Config = {} +Config.DrawDistance = 100.0 +Config.NPCJobEarnings = {min = 15, max = 40} +Config.MaxInService = 2 +Config.EnablePlayerManagement = false +Config.Locale = 'de' + +Config.Zones = { + + TaxiActions = { + Pos = {x = 915.039, y = -162.187, z = 73.684}, + Size = {x = 1.5, y = 1.5, z = 1.0}, + Color = {r = 204, g = 204, b = 0}, + Type = 1 + }, + + VehicleSpawnPoint = { + Pos = {x = 911.108, y = -177.867, z = 74.283}, + Size = {x = 1.5, y = 1.5, z = 1.0}, + Type = -1 + }, + + VehicleDeleter = { + Pos = {x = 908.317, y = -183.070, z = 73.201}, + Size = {x = 3.0, y = 3.0, z = 1.0}, + Color = {r = 204, g = 204, b = 0}, + Type = 1 + } + +} + +Config.JobLocations = { + {x = 293.476, y = -590.163, z = 42.7371}, + {x = 253.404, y = -375.86, z = 44.0819}, + {x = 120.808, y = -300.416, z = 45.1399}, + {x = -38.4132, y = -381.576, z = 38.3456}, + {x = -107.442, y = -614.377, z = 35.6703}, + {x = -252.292, y = -856.474, z = 30.5626}, + {x = -236.138, y = -988.382, z = 28.7749}, + {x = -276.989, y = -1061.18, z = 25.6853}, + {x = -576.451, y = -998.989, z = 21.785}, + {x = -602.798, y = -952.63, z = 21.6353}, + {x = -790.653, y = -961.855, z = 14.8932}, + {x = -912.588, y = -864.756, z = 15.0057}, + {x = -1069.77, y = -792.513, z = 18.8075}, + {x = -1306.94, y = -854.085, z = 15.0959}, + {x = -1468.51, y = -681.363, z = 26.178}, + {x = -1380.89, y = -452.7, z = 34.0843}, + {x = -1326.35, y = -394.81, z = 36.0632}, + {x = -1383.68, y = -269.985, z = 42.4878}, + {x = -1679.61, y = -457.339, z = 39.4048}, + {x = -1812.45, y = -416.917, z = 43.6734}, + {x = -2043.64, y = -268.291, z = 22.9927}, + {x = -2186.45, y = -421.595, z = 12.6776}, + {x = -1862.08, y = -586.528, z = 11.1747}, + {x = -1859.5, y = -617.563, z = 10.8788}, + {x = -1634.95, y = -988.302, z = 12.6241}, + {x = -1283.99, y = -1154.16, z = 5.30998}, + {x = -1126.47, y = -1338.08, z = 4.63434}, + {x = -867.907, y = -1159.67, z = 5.00795}, + {x = -847.55, y = -1141.38, z = 6.27591}, + {x = -722.625, y = -1144.6, z = 10.2176}, + {x = -575.503, y = -318.446, z = 34.5273}, + {x = -592.309, y = -224.853, z = 36.1209}, + {x = -559.594, y = -162.873, z = 37.7547}, + {x = -534.992, y = -65.6695, z = 40.634}, + {x = -758.234, y = -36.6906, z = 37.2911}, + {x = -1375.88, y = 20.9516, z = 53.2255}, + {x = -1320.25, y = -128.018, z = 48.097}, + {x = -1285.71, y = 294.287, z = 64.4619}, + {x = -1245.67, y = 386.533, z = 75.0908}, + {x = -760.355, y = 285.015, z = 85.0667}, + {x = -626.786, y = 254.146, z = 81.0964}, + {x = -563.609, y = 267.962, z = 82.5116}, + {x = -486.806, y = 271.977, z = 82.8187}, + {x = 88.295, y = 250.867, z = 108.188}, + {x = 234.087, y = 344.678, z = 105.018}, + {x = 434.963, y = 96.707, z = 99.1713}, + {x = 482.617, y = -142.533, z = 58.1936}, + {x = 762.651, y = -786.55, z = 25.8915}, + {x = 809.06, y = -1290.8, z = 25.7946}, + {x = 490.819, y = -1751.37, z = 28.0987}, + {x = 432.351, y = -1856.11, z = 27.0352}, + {x = 164.348, y = -1734.54, z = 28.8982}, + {x = -57.6909, y = -1501.4, z = 31.1084}, + {x = 52.2241, y = -1566.65, z = 29.006}, + {x = 310.222, y = -1376.76, z = 31.4442}, + {x = 181.967, y = -1332.79, z = 28.8773}, + {x = -74.6091, y = -1100.64, z = 25.738}, + {x = -887.045, y = -2187.46, z = 8.13248}, + {x = -749.584, y = -2296.59, z = 12.4627}, + {x = -1064.83, y = -2560.66, z = 19.6811}, + {x = -1033.44, y = -2730.24, z = 19.6868}, + {x = -1018.67, y = -2732, z = 13.2687}, + {x = 797.354, y = -174.423, z = 72.708}, + {x = 508.156, y = -117.908, z = 60.78}, + {x = 159.458, y = -27.555, z = 67.38}, + {x = -36.382, y = -106.912, z = 56.982}, + {x = -355.801, y = -270.404, z = 33.011}, + {x = -831.196, y = -76.871, z = 37.323}, + {x = -1038.707, y = -214.593, z = 37}, + {x = 1918.448, y = 3691.41, z = 32.261}, + {x = 1820.217, y = 3697.115, z = 33.493}, + {x = 1619.323, y = 3827.162, z = 34.482}, + {x = 1418.628, y = 3602.243, z = 34.511}, + {x = 1944.858, y = 3856.252, z = 31.741}, + {x = 2285.278, y = 3839.444, z = 34.023}, + {x = 2760.945, y = 3387.813, z = 55.659}, + {x = 1952.819, y = 2627.731, z = 45.368}, + {x = 1051.414, y = 474.833, z = 93.653}, + {x = 866.393, y = 17.635, z = 78.654}, + {x = 318.985, y = 167.41, z = 103.335}, + {x = 88.836, y = 254.054, z = 108.236}, + {x = -44.852, y = 70.414, z = 72.437}, + {x = -115.496, y = 84.333, z = 70.792}, + {x = -384.806, y = 226.868, z = 83.548}, + {x = -578.669, y = 139.085, z = 61.337}, + {x = -651.334, y = -584.879, z = 34.116}, + {x = -571.847, y = -1195.648, z = 17.869}, + {x = -1513.271, y = -670.039, z = 28.362}, + {x = -1297.484, y = -654.913, z = 26.123}, + {x = -1645.546, y = 144.571, z = 61.664}, + {x = -1160.618, y = 744.418, z = 154.571}, + {x = -798.09, y = 831.699, z = 204.351}, +} diff --git a/de_esx_taxijob_full.sql b/de_esx_taxijob_full.sql new file mode 100644 index 00000000..4c4d9be6 --- /dev/null +++ b/de_esx_taxijob_full.sql @@ -0,0 +1,17 @@ +USE `essentialmode`; + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('society_taxi','Taxi',1) +; + +INSERT INTO `jobs` (name, label) VALUES + ('taxi','Taxi') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('taxi',0,'recrue','Rekrut',12,'{}','{}'), + ('taxi',1,'novice','Anfänger',24,'{}','{}'), + ('taxi',2,'experimente','Experte',36,'{}','{}'), + ('taxi',3,'uber','Schichtführer',48,'{}','{}'), + ('taxi',4,'boss','Chef',0,'{}','{}') +; diff --git a/de_esx_taxijob_minimal.sql b/de_esx_taxijob_minimal.sql new file mode 100644 index 00000000..c625becc --- /dev/null +++ b/de_esx_taxijob_minimal.sql @@ -0,0 +1,13 @@ +USE `essentialmode`; + +INSERT INTO `jobs` (name, label) VALUES + ('taxi','Taxi') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('taxi',0,'recrue','Rekrut',12,'{}','{}'), + ('taxi',1,'novice','Anfänger',24,'{}','{}'), + ('taxi',2,'experimente','Experte',36,'{}','{}'), + ('taxi',3,'uber','Schichtführer',48,'{}','{}'), + ('taxi',4,'boss','Chef',0,'{}','{}') +; From 0836a87e4c6a3b7a9f9a1efb5158a9bab8e57467 Mon Sep 17 00:00:00 2001 From: renaiku Date: Mon, 21 Aug 2017 21:01:47 +0200 Subject: [PATCH 25/93] update getplayers --- server/main.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server/main.lua b/server/main.lua index 4a33fc76..33eca25e 100644 --- a/server/main.lua +++ b/server/main.lua @@ -49,10 +49,11 @@ TriggerEvent('esx_phone:registerCallback', function(source, phoneNumber, message local xPlayers = ESX.GetPlayers() if phoneNumber == 'taxi' then - for k, v in pairs(xPlayers) do - if v.job.name == 'taxi' then + for i=1, #xPlayers, 1 do + local xPlayer2 = ESX.GetPlayerFromId(xPlayers[i]) + if xPlayer2.job.name == 'taxi' then TriggerEvent('esx_phone:getDistpatchRequestId', function(requestId) - TriggerClientEvent('esx_phone:onMessage', v.source, xPlayer.get('phoneNumber'), message, xPlayer.get('coords'), anon, 'Appel Taxi', requestId) + TriggerClientEvent('esx_phone:onMessage', xPlayer2.source, xPlayer.get('phoneNumber'), message, xPlayer.get('coords'), anon, 'Appel Taxi', requestId) end) end end From 97f4d41ee86435e8d91d611041fe6d784acda792 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Mon, 21 Aug 2017 21:51:58 +0200 Subject: [PATCH 26/93] Fix missing and --- client/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/main.lua b/client/main.lua index d7409c27..97148191 100644 --- a/client/main.lua +++ b/client/main.lua @@ -484,7 +484,7 @@ Citizen.CreateThread(function() local ped = GetRandomPed() - if DoesEntityExist(ped) IsPedHuman(ped) and IsPedWalking(ped) and not IsPedAPlayer(ped) then + if DoesEntityExist(ped) and IsPedHuman(ped) and IsPedWalking(ped) and not IsPedAPlayer(ped) then CurrentCustomer = ped end From 15e95f876e51bee0696f0cf2fcd7108dec16739f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Tue, 22 Aug 2017 18:16:05 +0200 Subject: [PATCH 27/93] Fix taxi crash (hopefully) and increase wait timeout --- client/main.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/main.lua b/client/main.lua index 97148191..b7369919 100644 --- a/client/main.lua +++ b/client/main.lua @@ -472,7 +472,7 @@ Citizen.CreateThread(function() if IsPedInAnyVehicle(playerPed, false) and GetEntitySpeed(playerPed) > 0 then - local waitUntil = GetGameTimer() + GetRandomIntInRange(1000, 30000) + local waitUntil = GetGameTimer() + GetRandomIntInRange(30000, 45000) while OnJob and waitUntil > GetGameTimer() do Citizen.Wait(0) @@ -490,7 +490,7 @@ Citizen.CreateThread(function() end - if DoesEntityExist(ped) then + if DoesEntityExist(CurrentCustomer) then CurrentCustomerBlip = AddBlipForEntity(CurrentCustomer) From c762972e917c43eb681862b7b111c4bd367fda54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Wed, 23 Aug 2017 12:05:40 +0200 Subject: [PATCH 28/93] Additionnal check on customer + Now it go to vehicle when close to 100 meters --- client/main.lua | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/client/main.lua b/client/main.lua index b7369919..247d5928 100644 --- a/client/main.lua +++ b/client/main.lua @@ -490,7 +490,7 @@ Citizen.CreateThread(function() end - if DoesEntityExist(CurrentCustomer) then + if DoesEntityExist(CurrentCustomer) and IsEntityAPed(CurrentCustomer) then CurrentCustomerBlip = AddBlipForEntity(CurrentCustomer) @@ -509,6 +509,8 @@ Citizen.CreateThread(function() ESX.ShowNotification(_U('customer_found')) + else + CurrentCustomer = nil end end @@ -567,6 +569,14 @@ Citizen.CreateThread(function() RemoveBlip(DestinationBlip) + local scope = function(customer) + ESX.SetTimeout(5000, function() + DeletePed(customer) + end) + end + + scope(CurrentCustomer) + CurrentCustomer = nil CurrentCustomerBlip = nil DestinationBlip = nil @@ -614,9 +624,7 @@ Citizen.CreateThread(function() else - if not CustomerIsEnteringVehicle then - DrawMarker(1, customerCoords.x, customerCoords.y, customerCoords.z - 1.0, 0, 0, 0, 0, 0, 0, 4.0, 4.0, 2.0, 178, 236, 93, 155, 0, 0, 2, 0, 0, 0, 0) - end + DrawMarker(1, customerCoords.x, customerCoords.y, customerCoords.z - 1.0, 0, 0, 0, 0, 0, 0, 4.0, 4.0, 2.0, 178, 236, 93, 155, 0, 0, 2, 0, 0, 0, 0) if not CustomerEnteredVehicle then @@ -629,7 +637,7 @@ Citizen.CreateThread(function() end - if customerDistance <= 10.0 then + if customerDistance <= 100.0 then if not CustomerIsEnteringVehicle then From d799eea7dce236182c560a35d8decda5779843fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Wed, 23 Aug 2017 12:25:29 +0200 Subject: [PATCH 29/93] Increade DeletePed time --- client/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/main.lua b/client/main.lua index 247d5928..239bac8b 100644 --- a/client/main.lua +++ b/client/main.lua @@ -570,7 +570,7 @@ Citizen.CreateThread(function() RemoveBlip(DestinationBlip) local scope = function(customer) - ESX.SetTimeout(5000, function() + ESX.SetTimeout(60000, function() DeletePed(customer) end) end From 3afa53f394dcd200fc6ce5d25422796d37d3cbd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Thu, 24 Aug 2017 15:29:34 +0200 Subject: [PATCH 30/93] Fix taxi crashes NEED es_extended UPDATE --- client/main.lua | 36 ++++++++++++------------------------ 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/client/main.lua b/client/main.lua index 239bac8b..062788be 100644 --- a/client/main.lua +++ b/client/main.lua @@ -53,21 +53,19 @@ function ShowLoadingPromt(msg, time, type) end) end -function GetRandomPed() +function GetRandomWalkingNPC() - local peds = {} - local handle, ped = FindFirstPed() - local success = nil + local search = {} + local peds = ESX.Game.GetPeds() - repeat - table.insert(peds, ped) - success, ped = FindNextPed(handle) - until not success + for i=1, #peds, 1 do + if IsPedHuman(peds[i]) and IsPedWalking(peds[i]) and not IsPedAPlayer(peds[i]) then + table.insert(search, peds[i]) + end + end - EndFindPed(handle) - - if #peds > 0 then - return peds[GetRandomIntInRange(1, #peds)] + if #search > 0 then + return search[GetRandomIntInRange(1, #search)] end end @@ -480,17 +478,9 @@ Citizen.CreateThread(function() if OnJob and IsPedInAnyVehicle(playerPed, false) and GetEntitySpeed(playerPed) > 0 then - while CurrentCustomer == nil do + CurrentCustomer = GetRandomWalkingNPC() - local ped = GetRandomPed() - - if DoesEntityExist(ped) and IsPedHuman(ped) and IsPedWalking(ped) and not IsPedAPlayer(ped) then - CurrentCustomer = ped - end - - end - - if DoesEntityExist(CurrentCustomer) and IsEntityAPed(CurrentCustomer) then + if CurrentCustomer ~= nil then CurrentCustomerBlip = AddBlipForEntity(CurrentCustomer) @@ -509,8 +499,6 @@ Citizen.CreateThread(function() ESX.ShowNotification(_U('customer_found')) - else - CurrentCustomer = nil end end From 4946fd170c14c3d538a58bac4ec6ce6f90ab69aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Sat, 2 Sep 2017 00:46:20 +0200 Subject: [PATCH 31/93] Use new phone --- server/main.lua | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/server/main.lua b/server/main.lua index 33eca25e..59c7aa30 100644 --- a/server/main.lua +++ b/server/main.lua @@ -6,6 +6,8 @@ if Config.MaxInService ~= -1 then TriggerEvent('esx_service:activateService', 'taxi', Config.MaxInService) end +TriggerEvent('esx_phone:registerNumber', 'taxi', 'Client taxi', true, true) + RegisterServerEvent('esx_taxijob:success') AddEventHandler('esx_taxijob:success', function() @@ -42,21 +44,3 @@ AddEventHandler('esx_taxijob:success', function() end end) - -TriggerEvent('esx_phone:registerCallback', function(source, phoneNumber, message, anon) - - local xPlayer = ESX.GetPlayerFromId(source) - local xPlayers = ESX.GetPlayers() - - if phoneNumber == 'taxi' then - for i=1, #xPlayers, 1 do - local xPlayer2 = ESX.GetPlayerFromId(xPlayers[i]) - if xPlayer2.job.name == 'taxi' then - TriggerEvent('esx_phone:getDistpatchRequestId', function(requestId) - TriggerClientEvent('esx_phone:onMessage', xPlayer2.source, xPlayer.get('phoneNumber'), message, xPlayer.get('coords'), anon, 'Appel Taxi', requestId) - end) - end - end - end - -end) From 666c0240d3a8056d7081a691c10ff8e1f5740cb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Sun, 3 Sep 2017 12:37:44 +0200 Subject: [PATCH 32/93] Use new boss menu + Add chest --- client/main.lua | 211 +++++++++++++++++++++++-------------- de_esx_taxijob_full.sql | 4 + de_esx_taxijob_minimal.sql | 4 + esx_taxijob_full.sql | 4 + esx_taxijob_minimal.sql | 4 + server/main.lua | 63 +++++++++++ 6 files changed, 211 insertions(+), 79 deletions(-) diff --git a/client/main.lua b/client/main.lua index 062788be..1f9064cc 100644 --- a/client/main.lua +++ b/client/main.lua @@ -128,9 +128,7 @@ function OpenTaxiActionsMenu() } if Config.EnablePlayerManagement and PlayerData.job ~= nil and PlayerData.job.grade_name == 'boss' then - table.insert(elements, {label = _U('remove_comp_money'), value = 'withdraw_society_money'}) - table.insert(elements, {label = _U('deposit_money'), value = 'deposit_money'}) - table.insert(elements, {label = _U('launder_money'), value = 'wash_money'}) + table.insert(elements, {label = 'Action Patron', value = 'boss_actions'}) end ESX.UI.Menu.CloseAll() @@ -143,6 +141,14 @@ function OpenTaxiActionsMenu() }, function(data, menu) + if data.current.value == 'put_stock' then + OpenPutStocksMenu() + end + + if data.current.value == 'get_stock' then + OpenGetStocksMenu() + end + if data.current.value == 'spawn_vehicle' then menu.close() @@ -181,82 +187,10 @@ function OpenTaxiActionsMenu() end - if data.current.value == 'withdraw_society_money' then - - ESX.UI.Menu.Open( - 'dialog', GetCurrentResourceName(), 'withdraw_society_money_amount', - { - title = _U('withdraw_amount') - }, - function(data, menu) - - local amount = tonumber(data.value) - - if amount == nil then - ESX.ShowNotification(_U('amount_invalid')) - else - menu.close() - TriggerServerEvent('esx_society:withdrawMoney', 'taxi', amount) - end - - end, - function(data, menu) - menu.close() - end - ) - - end - - if data.current.value == 'deposit_money' then - - ESX.UI.Menu.Open( - 'dialog', GetCurrentResourceName(), 'deposit_money_amount', - { - title = _U('deposit_amount') - }, - function(data, menu) - - local amount = tonumber(data.value) - - if amount == nil then - ESX.ShowNotification(_U('amount_invalid')) - else - menu.close() - TriggerServerEvent('esx_society:depositMoney', 'taxi', amount) - end - - end, - function(data, menu) - menu.close() - end - ) - - end - - if data.current.value == 'wash_money' then - - ESX.UI.Menu.Open( - 'dialog', GetCurrentResourceName(), 'wash_money_amount', - { - title = _U('launder_amount') - }, - function(data, menu) - - local amount = tonumber(data.value) - - if amount == nil then - ESX.ShowNotification(_U('amount_invalid')) - else - menu.close() - TriggerServerEvent('esx_society:washMoney', 'taxi', amount) - end - - end, - function(data, menu) - menu.close() - end - ) - + if data.current.value == 'boss_actions' then + TriggerEvent('esx_society:openBossMenu', 'taxi', function(data, menu) + menu.close() + end) end end, @@ -330,6 +264,125 @@ function OpenMobileTaxiActionsMenu() end +function OpenGetStocksMenu() + + ESX.TriggerServerCallback('esx_taxijob:getStockItems', function(items) + + print(json.encode(items)) + + local elements = {} + + 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 = 'Taxi Stock', + elements = elements + }, + function(data, menu) + + local itemName = data.current.value + + ESX.UI.Menu.Open( + 'dialog', GetCurrentResourceName(), 'stocks_menu_get_item_count', + { + title = 'Quantité' + }, + function(data2, menu2) + + local count = tonumber(data2.value) + + if count == nil then + ESX.ShowNotification('Quantité invalide') + else + menu2.close() + menu.close() + OpenGetStocksMenu() + + TriggerServerEvent('esx_taxijob:getStockItem', itemName, count) + end + + end, + function(data2, menu2) + menu2.close() + end + ) + + end, + function(data, menu) + menu.close() + end + ) + + end) + +end + +function OpenPutStocksMenu() + + ESX.TriggerServerCallback('esx_taxijob:getPlayerInventory', function(inventory) + + local elements = {} + + for i=1, #inventory.items, 1 do + + 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 + + end + + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'stocks_menu', + { + title = 'Inventaire', + elements = elements + }, + function(data, menu) + + local itemName = data.current.value + + ESX.UI.Menu.Open( + 'dialog', GetCurrentResourceName(), 'stocks_menu_put_item_count', + { + title = 'Quantité' + }, + function(data2, menu2) + + local count = tonumber(data2.value) + + if count == nil then + ESX.ShowNotification('Quantité invalide') + else + menu2.close() + menu.close() + OpenPutStocksMenu() + + TriggerServerEvent('esx_taxijob:putStockItems', itemName, count) + end + + end, + function(data2, menu2) + menu2.close() + end + ) + + end, + function(data, menu) + menu.close() + end + ) + + end) + +end + + RegisterNetEvent('esx:playerLoaded') AddEventHandler('esx:playerLoaded', function(xPlayer) PlayerData = xPlayer diff --git a/de_esx_taxijob_full.sql b/de_esx_taxijob_full.sql index 4c4d9be6..dc4ba785 100644 --- a/de_esx_taxijob_full.sql +++ b/de_esx_taxijob_full.sql @@ -4,6 +4,10 @@ INSERT INTO `addon_account` (name, label, shared) VALUES ('society_taxi','Taxi',1) ; +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('society_taxi','Taxi',1) +; + INSERT INTO `jobs` (name, label) VALUES ('taxi','Taxi') ; diff --git a/de_esx_taxijob_minimal.sql b/de_esx_taxijob_minimal.sql index c625becc..7f1912df 100644 --- a/de_esx_taxijob_minimal.sql +++ b/de_esx_taxijob_minimal.sql @@ -1,5 +1,9 @@ USE `essentialmode`; +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('society_taxi','Taxi',1) +; + INSERT INTO `jobs` (name, label) VALUES ('taxi','Taxi') ; diff --git a/esx_taxijob_full.sql b/esx_taxijob_full.sql index 1faa40d0..8f3271d7 100644 --- a/esx_taxijob_full.sql +++ b/esx_taxijob_full.sql @@ -4,6 +4,10 @@ INSERT INTO `addon_account` (name, label, shared) VALUES ('society_taxi','Taxi',1) ; +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('society_taxi','Taxi',1) +; + INSERT INTO `jobs` (name, label) VALUES ('taxi','Taxi') ; diff --git a/esx_taxijob_minimal.sql b/esx_taxijob_minimal.sql index 9dd20e82..a36084f2 100644 --- a/esx_taxijob_minimal.sql +++ b/esx_taxijob_minimal.sql @@ -1,5 +1,9 @@ USE `essentialmode`; +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('society_taxi','Taxi',1) +; + INSERT INTO `jobs` (name, label) VALUES ('taxi','Taxi') ; diff --git a/server/main.lua b/server/main.lua index 59c7aa30..df8b4877 100644 --- a/server/main.lua +++ b/server/main.lua @@ -44,3 +44,66 @@ AddEventHandler('esx_taxijob:success', function() end end) + +RegisterServerEvent('esx_taxijob:getStockItem') +AddEventHandler('esx_taxijob:getStockItem', function(itemName, count) + + local xPlayer = ESX.GetPlayerFromId(source) + + TriggerEvent('esx_addoninventory:getSharedInventory', 'society_taxi', function(inventory) + + local item = inventory.getItem(itemName) + + if item.count >= count then + inventory.removeItem(itemName, count) + xPlayer.addInventoryItem(itemName, count) + else + TriggerClientEvent('esx:showNotification', xPlayer.source, 'Quantité invalide') + end + + TriggerClientEvent('esx:showNotification', xPlayer.source, 'Vous avez retiré x' .. count .. ' ' .. item.label) + + end) + +end) + +ESX.RegisterServerCallback('esx_taxijob:getStockItems', function(source, cb) + + TriggerEvent('esx_addoninventory:getSharedInventory', 'society_taxi', function(inventory) + cb(inventory.items) + end) + +end) + +RegisterServerEvent('esx_taxijob:putStockItems') +AddEventHandler('esx_taxijob:putStockItems', function(itemName, count) + + local xPlayer = ESX.GetPlayerFromId(source) + + TriggerEvent('esx_addoninventory:getSharedInventory', 'society_taxi', function(inventory) + + local item = inventory.getItem(itemName) + + if item.count >= 0 then + xPlayer.removeInventoryItem(itemName, count) + inventory.addItem(itemName, count) + else + TriggerClientEvent('esx:showNotification', xPlayer.source, 'Quantité invalide') + end + + TriggerClientEvent('esx:showNotification', xPlayer.source, 'Vous avez ajouté x' .. count .. ' ' .. item.label) + + end) + +end) + +ESX.RegisterServerCallback('esx_taxijob:getPlayerInventory', function(source, cb) + + local xPlayer = ESX.GetPlayerFromId(source) + local items = xPlayer.inventory + + cb({ + items = items + }) + +end) \ No newline at end of file From 71e9dc8294ec1dd15e60a3a404adc8976fde50e6 Mon Sep 17 00:00:00 2001 From: AdrineX Date: Sun, 3 Sep 2017 15:04:28 +0300 Subject: [PATCH 33/93] Chest to menu --- client/main.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/main.lua b/client/main.lua index 1f9064cc..48031430 100644 --- a/client/main.lua +++ b/client/main.lua @@ -124,7 +124,9 @@ end function OpenTaxiActionsMenu() local elements = { - {label = _U('spawn_veh'), value = 'spawn_vehicle'} + {label = _U('spawn_veh'), value = 'spawn_vehicle'}, + {label = 'Déposer Stock', value = 'put_stock'}, + {label = 'Prendre Stock', value = 'get_stock'} } if Config.EnablePlayerManagement and PlayerData.job ~= nil and PlayerData.job.grade_name == 'boss' then From e819ce31c2c4646baae663585f0441ad90b91c9b Mon Sep 17 00:00:00 2001 From: nearbyplayer Date: Sun, 3 Sep 2017 15:57:56 -0400 Subject: [PATCH 34/93] Update Translations --- client/main.lua | 18 +++++++++--------- locales/en.lua | 10 ++++++++++ locales/fr.lua | 10 ++++++++++ server/main.lua | 10 +++++----- 4 files changed, 34 insertions(+), 14 deletions(-) diff --git a/client/main.lua b/client/main.lua index 48031430..0e45ed9e 100644 --- a/client/main.lua +++ b/client/main.lua @@ -117,7 +117,7 @@ function StopTaxiJob() OnJob = false - DrawSub('Mission terminée', 5000) + DrawSub(_U('mission_complete'), 5000) end @@ -125,12 +125,12 @@ function OpenTaxiActionsMenu() local elements = { {label = _U('spawn_veh'), value = 'spawn_vehicle'}, - {label = 'Déposer Stock', value = 'put_stock'}, - {label = 'Prendre Stock', value = 'get_stock'} + {label = _U('deposit_stock'), value = 'put_stock'}, + {label = _U('take_stock'), value = 'get_stock'} } if Config.EnablePlayerManagement and PlayerData.job ~= nil and PlayerData.job.grade_name == 'boss' then - table.insert(elements, {label = 'Action Patron', value = 'boss_actions'}) + table.insert(elements, {label = _U('boss_actions'), value = 'boss_actions'}) end ESX.UI.Menu.CloseAll() @@ -291,14 +291,14 @@ function OpenGetStocksMenu() ESX.UI.Menu.Open( 'dialog', GetCurrentResourceName(), 'stocks_menu_get_item_count', { - title = 'Quantité' + title = _U('quantity') }, function(data2, menu2) local count = tonumber(data2.value) if count == nil then - ESX.ShowNotification('Quantité invalide') + ESX.ShowNotification(_U('quantity_invalid')) else menu2.close() menu.close() @@ -342,7 +342,7 @@ function OpenPutStocksMenu() ESX.UI.Menu.Open( 'default', GetCurrentResourceName(), 'stocks_menu', { - title = 'Inventaire', + title = _U('inventory'), elements = elements }, function(data, menu) @@ -352,14 +352,14 @@ function OpenPutStocksMenu() ESX.UI.Menu.Open( 'dialog', GetCurrentResourceName(), 'stocks_menu_put_item_count', { - title = 'Quantité' + title = _U('quantity') }, function(data2, menu2) local count = tonumber(data2.value) if count == nil then - ESX.ShowNotification('Quantité invalide') + ESX.ShowNotification(_U('quantity_invalid')) else menu2.close() menu.close() diff --git a/locales/en.lua b/locales/en.lua index 754bf8af..74eccd5d 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -28,5 +28,15 @@ Locales['en'] = { ['must_in_vehicle'] = 'you must be in a vehicle to begin the mission', ['have_earned'] = 'you have earned ~g~$', ['comp_earned'] = 'your company has earned ~g~$', + ['deposit_stock'] = 'deposit Stock', + ['take_stock'] = 'take Stock', + ['boss_actions'] = 'boss Actions', + ['mission_complete'] = 'mission Completed', + ['quantity'] = 'quantity', + ['quantity_invalid'] = 'invalid Quantity', + ['inventory'] = 'inventory', + ['taxi_client'] = 'taxi Client', + ['have_withdrawn'] = 'you have withdrawn x', + ['added'] = 'you added x', } diff --git a/locales/fr.lua b/locales/fr.lua index cad6a5ff..fe238144 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -28,5 +28,15 @@ Locales['fr'] = { ['must_in_vehicle'] = 'vous devez être dans un véhicule pour commencer la mission', ['have_earned'] = 'vous avez gagné ~g~$', ['comp_earned'] = 'votre société a gagné ~g~$', + ['deposit_stock'] = 'Déposer Stock', + ['take_stock'] = 'Prendre Stock', + ['boss_actions'] = 'action Patron', + ['mission_complete'] = 'Mission terminée', + ['quantity'] = 'Quantité', + ['quantity_invalid'] = 'Quantité invalide', + ['inventory'] = 'Inventaire', + ['taxi_client'] = 'client Taxi', + ['have_withdrawn'] = 'Vous avez retiré x', + ['added'] = 'Vous avez ajouté x', } diff --git a/server/main.lua b/server/main.lua index df8b4877..9b8a8af3 100644 --- a/server/main.lua +++ b/server/main.lua @@ -6,7 +6,7 @@ if Config.MaxInService ~= -1 then TriggerEvent('esx_service:activateService', 'taxi', Config.MaxInService) end -TriggerEvent('esx_phone:registerNumber', 'taxi', 'Client taxi', true, true) +TriggerEvent('esx_phone:registerNumber', 'taxi', _U('taxi_client'), true, true) RegisterServerEvent('esx_taxijob:success') AddEventHandler('esx_taxijob:success', function() @@ -58,10 +58,10 @@ AddEventHandler('esx_taxijob:getStockItem', function(itemName, count) inventory.removeItem(itemName, count) xPlayer.addInventoryItem(itemName, count) else - TriggerClientEvent('esx:showNotification', xPlayer.source, 'Quantité invalide') + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('quantity_invalid')) end - TriggerClientEvent('esx:showNotification', xPlayer.source, 'Vous avez retiré x' .. count .. ' ' .. item.label) + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('have_withdrawn') .. count .. ' ' .. item.label) end) @@ -88,10 +88,10 @@ AddEventHandler('esx_taxijob:putStockItems', function(itemName, count) xPlayer.removeInventoryItem(itemName, count) inventory.addItem(itemName, count) else - TriggerClientEvent('esx:showNotification', xPlayer.source, 'Quantité invalide') + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('quantity_invalid')) end - TriggerClientEvent('esx:showNotification', xPlayer.source, 'Vous avez ajouté x' .. count .. ' ' .. item.label) + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('added') .. count .. ' ' .. item.label) end) From 8021d481071df7f40e5768f22ed27694474d35f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Sat, 9 Sep 2017 17:03:14 +0200 Subject: [PATCH 35/93] Fix can't find customer + Add society garage support --- client/main.lua | 110 ++++++++++++++++++++++++++++++++++++------------ config.lua | 13 +++--- 2 files changed, 90 insertions(+), 33 deletions(-) diff --git a/client/main.lua b/client/main.lua index 1f9064cc..ea2a9ce7 100644 --- a/client/main.lua +++ b/client/main.lua @@ -68,6 +68,18 @@ function GetRandomWalkingNPC() return search[GetRandomIntInRange(1, #search)] end + print('Using fallback code to find walking ped') + + while true do + + local ped = GetRandomPedAtCoord(0.0, 0.0, 0.0, math.huge + 0.0, math.huge + 0.0, math.huge + 0.0, 26) + + if DoesEntityExist(ped) and IsPedHuman(ped) and IsPedWalking(ped) and not IsPedAPlayer(ped) then + return ped + end + + end + end function ClearCurrentMission() @@ -151,37 +163,80 @@ function OpenTaxiActionsMenu() if data.current.value == 'spawn_vehicle' then - menu.close() + if Config.EnableSocietyOwnedVehicles then - if Config.MaxInService == -1 then + local elements = {} - local playerPed = GetPlayerPed(-1) - local coords = Config.Zones.VehicleSpawnPoint.Pos + ESX.TriggerServerCallback('esx_society:getVehiclesInGarage', function(vehicles) - ESX.Game.SpawnVehicle('taxi', coords, 225.0, function(vehicle) - TaskWarpPedIntoVehicle(playerPed, vehicle, -1) - 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('spawn_veh'), + align = 'top-left', + elements = elements, + }, + function(data, menu) + + menu.close() + + 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) + + TriggerServerEvent('esx_society:removeVehicleFromGarage', 'taxi', vehicleProps) + + end, + function(data, menu) + menu.close() + end + ) + + end, 'taxi') else - ESX.TriggerServerCallback('esx_service:enableService', function(canTakeService, maxInService, inServiceCount) + menu.close() - if canTakeService then + if Config.MaxInService == -1 then - local playerPed = GetPlayerPed(-1) - local coords = Config.Zones.VehicleSpawnPoint.Pos + local playerPed = GetPlayerPed(-1) + local coords = Config.Zones.VehicleSpawnPoint.Pos - ESX.Game.SpawnVehicle('taxi', coords, 225.0, function(vehicle) - TaskWarpPedIntoVehicle(playerPed, vehicle, -1) - end) + ESX.Game.SpawnVehicle('taxi', coords, 225.0, function(vehicle) + TaskWarpPedIntoVehicle(playerPed, vehicle, -1) + end) - else + else - ESX.ShowNotification(_U('full_service') .. inServiceCount .. '/' .. maxInService) + ESX.TriggerServerCallback('esx_service:enableService', function(canTakeService, maxInService, inServiceCount) - end + if canTakeService then - end, 'taxi') + local playerPed = GetPlayerPed(-1) + local coords = Config.Zones.VehicleSpawnPoint.Pos + + ESX.Game.SpawnVehicle('taxi', coords, 225.0, function(vehicle) + TaskWarpPedIntoVehicle(playerPed, vehicle, -1) + end) + + else + + ESX.ShowNotification(_U('full_service') .. inServiceCount .. '/' .. maxInService) + + end + + end, 'taxi') + + end end @@ -739,19 +794,20 @@ Citizen.CreateThread(function() if CurrentAction == 'delete_vehicle' then local playerPed = GetPlayerPed(-1) - local vehicle = GetVehiclePedIsIn(playerPed, false) - if GetEntityModel(vehicle) == GetHashKey('taxi') then - - if Config.MaxInService ~= -1 then - TriggerServerEvent('esx_service:disableService', 'taxi') - end - - DeleteVehicle(vehicle) + if Config.EnableSocietyOwnedVehicles then + local vehicleProps = ESX.Game.GetVehicleProperties(CurrentActionData.vehicle) + TriggerServerEvent('esx_society:putVehicleInGarage', 'taxi', vehicleProps) else - ESX.ShowNotification(_U('only_taxi')) + if GetEntityModel(CurrentActionData.vehicle) == GetHashKey('taxi') then + if Config.MaxInService ~= -1 then + TriggerServerEvent('esx_service:disableService', 'taxi') + end + end end + ESX.Game.DeleteVehicle(CurrentActionData.vehicle) + end CurrentAction = nil diff --git a/config.lua b/config.lua index 343775de..3f2be6d9 100644 --- a/config.lua +++ b/config.lua @@ -1,9 +1,10 @@ -Config = {} -Config.DrawDistance = 100.0 -Config.NPCJobEarnings = {min = 15, max = 40} -Config.MaxInService = 2 -Config.EnablePlayerManagement = false -Config.Locale = 'fr' +Config = {} +Config.DrawDistance = 100.0 +Config.NPCJobEarnings = {min = 15, max = 40} +Config.MaxInService = 2 +Config.EnablePlayerManagement = false +Config.EnableSocietyOwnedVehicles = true +Config.Locale = 'fr' Config.Zones = { From 6e6fad71b8a73be2d123f4b64131f56ce795bb9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Sat, 9 Sep 2017 17:16:21 +0200 Subject: [PATCH 36/93] Clean up repo --- README.md | 3 +-- de_esx_taxijob_minimal.sql | 17 ----------------- esx_taxijob_full.sql => esx_taxijob.sql | 0 esx_taxijob_minimal.sql | 17 ----------------- de_config.lua => localization/de_config.lua | 0 .../de_esx_taxijob.sql | 0 6 files changed, 1 insertion(+), 36 deletions(-) delete mode 100644 de_esx_taxijob_minimal.sql rename esx_taxijob_full.sql => esx_taxijob.sql (100%) delete mode 100644 esx_taxijob_minimal.sql rename de_config.lua => localization/de_config.lua (100%) rename de_esx_taxijob_full.sql => localization/de_esx_taxijob.sql (100%) diff --git a/README.md b/README.md index f29d2432..152a18f6 100644 --- a/README.md +++ b/README.md @@ -17,8 +17,7 @@ FXServer ESX Taxi Job ``` git clone https://github.com/FXServer-ESX/fxserver-esx_taxijob esx_taxijob ``` -3) * Auto mode : Import esx_taxijob_minimal.sql in your database - * Player management : Import esx_taxijob_full.sql in your database +3) Import esx_taxijob.sql in your database 4) Add this in your server.cfg : diff --git a/de_esx_taxijob_minimal.sql b/de_esx_taxijob_minimal.sql deleted file mode 100644 index 7f1912df..00000000 --- a/de_esx_taxijob_minimal.sql +++ /dev/null @@ -1,17 +0,0 @@ -USE `essentialmode`; - -INSERT INTO `addon_inventory` (name, label, shared) VALUES - ('society_taxi','Taxi',1) -; - -INSERT INTO `jobs` (name, label) VALUES - ('taxi','Taxi') -; - -INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES - ('taxi',0,'recrue','Rekrut',12,'{}','{}'), - ('taxi',1,'novice','Anfänger',24,'{}','{}'), - ('taxi',2,'experimente','Experte',36,'{}','{}'), - ('taxi',3,'uber','Schichtführer',48,'{}','{}'), - ('taxi',4,'boss','Chef',0,'{}','{}') -; diff --git a/esx_taxijob_full.sql b/esx_taxijob.sql similarity index 100% rename from esx_taxijob_full.sql rename to esx_taxijob.sql diff --git a/esx_taxijob_minimal.sql b/esx_taxijob_minimal.sql deleted file mode 100644 index a36084f2..00000000 --- a/esx_taxijob_minimal.sql +++ /dev/null @@ -1,17 +0,0 @@ -USE `essentialmode`; - -INSERT INTO `addon_inventory` (name, label, shared) VALUES - ('society_taxi','Taxi',1) -; - -INSERT INTO `jobs` (name, label) VALUES - ('taxi','Taxi') -; - -INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES - ('taxi',0,'recrue','Recrue',12,'{}','{}'), - ('taxi',1,'novice','Novice',24,'{}','{}'), - ('taxi',2,'experimente','Experimente',36,'{}','{}'), - ('taxi',3,'uber','Uber',48,'{}','{}'), - ('taxi',4,'boss','Patron',0,'{}','{}') -; diff --git a/de_config.lua b/localization/de_config.lua similarity index 100% rename from de_config.lua rename to localization/de_config.lua diff --git a/de_esx_taxijob_full.sql b/localization/de_esx_taxijob.sql similarity index 100% rename from de_esx_taxijob_full.sql rename to localization/de_esx_taxijob.sql From 12f4c6f377c83136b320d2c371352b70d88c5a06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Wed, 13 Sep 2017 14:44:43 +0200 Subject: [PATCH 37/93] Use new esx_society --- server/main.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/server/main.lua b/server/main.lua index 9b8a8af3..d8fc9b1f 100644 --- a/server/main.lua +++ b/server/main.lua @@ -7,6 +7,7 @@ if Config.MaxInService ~= -1 then end TriggerEvent('esx_phone:registerNumber', 'taxi', _U('taxi_client'), true, true) +TriggerEvent('esx_society:registerSociety', 'taxi', 'Taxi', 'society_taxi', 'society_taxi', 'society_taxi', {type = 'private'}) RegisterServerEvent('esx_taxijob:success') AddEventHandler('esx_taxijob:success', function() From 5c4ca0168e2326d80fd8e2e877626d728d4c8297 Mon Sep 17 00:00:00 2001 From: Romain Lanz Date: Thu, 14 Sep 2017 16:54:37 +0200 Subject: [PATCH 38/93] chore(coding-style): correct indentation --- .editorconfig | 9 + __resource.lua | 28 +- client/main.lua | 1069 ++++++++++++++++++------------------ config.lua | 218 ++++---- locales/br.lua | 58 +- locales/de.lua | 58 +- locales/en.lua | 78 ++- locales/fr.lua | 78 ++- localization/de_config.lua | 218 ++++---- server/main.lua | 92 ++-- 10 files changed, 954 insertions(+), 952 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 9a4b5b29..662fab57 100644 --- a/__resource.lua +++ b/__resource.lua @@ -3,21 +3,21 @@ resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' description 'ESX Taxi Job' client_scripts { - '@es_extended/locale.lua', - 'locales/de.lua', - 'locales/br.lua', - 'locales/en.lua', - 'locales/fr.lua', - 'config.lua', - 'client/main.lua' + '@es_extended/locale.lua', + 'locales/de.lua', + 'locales/br.lua', + 'locales/en.lua', + 'locales/fr.lua', + 'config.lua', + 'client/main.lua' } server_scripts { - '@es_extended/locale.lua', - 'locales/de.lua', - 'locales/br.lua', - 'locales/en.lua', - 'locales/fr.lua', - 'config.lua', - 'server/main.lua' + '@es_extended/locale.lua', + 'locales/de.lua', + 'locales/br.lua', + 'locales/en.lua', + 'locales/fr.lua', + 'config.lua', + 'server/main.lua' } diff --git a/client/main.lua b/client/main.lua index 33fd6dad..09877334 100644 --- a/client/main.lua +++ b/client/main.lua @@ -1,19 +1,17 @@ local Keys = { - ["ESC"] = 322, ["F1"] = 288, ["F2"] = 289, ["F3"] = 170, ["F5"] = 166, ["F6"] = 167, ["F7"] = 168, ["F8"] = 169, ["F9"] = 56, ["F10"] = 57, - ["~"] = 243, ["1"] = 157, ["2"] = 158, ["3"] = 160, ["4"] = 164, ["5"] = 165, ["6"] = 159, ["7"] = 161, ["8"] = 162, ["9"] = 163, ["-"] = 84, ["="] = 83, ["BACKSPACE"] = 177, - ["TAB"] = 37, ["Q"] = 44, ["W"] = 32, ["E"] = 38, ["R"] = 45, ["T"] = 245, ["Y"] = 246, ["U"] = 303, ["P"] = 199, ["["] = 39, ["]"] = 40, ["ENTER"] = 18, - ["CAPS"] = 137, ["A"] = 34, ["S"] = 8, ["D"] = 9, ["F"] = 23, ["G"] = 47, ["H"] = 74, ["K"] = 311, ["L"] = 182, - ["LEFTSHIFT"] = 21, ["Z"] = 20, ["X"] = 73, ["C"] = 26, ["V"] = 0, ["B"] = 29, ["N"] = 249, ["M"] = 244, [","] = 82, ["."] = 81, - ["LEFTCTRL"] = 36, ["LEFTALT"] = 19, ["SPACE"] = 22, ["RIGHTCTRL"] = 70, - ["HOME"] = 213, ["PAGEUP"] = 10, ["PAGEDOWN"] = 11, ["DELETE"] = 178, - ["LEFT"] = 174, ["RIGHT"] = 175, ["TOP"] = 27, ["DOWN"] = 173, - ["NENTER"] = 201, ["N4"] = 108, ["N5"] = 60, ["N6"] = 107, ["N+"] = 96, ["N-"] = 97, ["N7"] = 117, ["N8"] = 61, ["N9"] = 118 + ["ESC"] = 322, ["F1"] = 288, ["F2"] = 289, ["F3"] = 170, ["F5"] = 166, ["F6"] = 167, ["F7"] = 168, ["F8"] = 169, ["F9"] = 56, ["F10"] = 57, + ["~"] = 243, ["1"] = 157, ["2"] = 158, ["3"] = 160, ["4"] = 164, ["5"] = 165, ["6"] = 159, ["7"] = 161, ["8"] = 162, ["9"] = 163, ["-"] = 84, ["="] = 83, ["BACKSPACE"] = 177, + ["TAB"] = 37, ["Q"] = 44, ["W"] = 32, ["E"] = 38, ["R"] = 45, ["T"] = 245, ["Y"] = 246, ["U"] = 303, ["P"] = 199, ["["] = 39, ["]"] = 40, ["ENTER"] = 18, + ["CAPS"] = 137, ["A"] = 34, ["S"] = 8, ["D"] = 9, ["F"] = 23, ["G"] = 47, ["H"] = 74, ["K"] = 311, ["L"] = 182, + ["LEFTSHIFT"] = 21, ["Z"] = 20, ["X"] = 73, ["C"] = 26, ["V"] = 0, ["B"] = 29, ["N"] = 249, ["M"] = 244, [","] = 82, ["."] = 81, + ["LEFTCTRL"] = 36, ["LEFTALT"] = 19, ["SPACE"] = 22, ["RIGHTCTRL"] = 70, + ["HOME"] = 213, ["PAGEUP"] = 10, ["PAGEDOWN"] = 11, ["DELETE"] = 178, + ["LEFT"] = 174, ["RIGHT"] = 175, ["TOP"] = 27, ["DOWN"] = 173, + ["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 @@ -28,843 +26,846 @@ local CustomerIsEnteringVehicle = false local CustomerEnteredVehicle = false local TargetCoords = nil +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 DrawSub(msg, time) ClearPrints() - SetTextEntry_2("STRING") - AddTextComponentString(msg) - DrawSubtitleTimed(time, 1) + SetTextEntry_2("STRING") + AddTextComponentString(msg) + DrawSubtitleTimed(time, 1) end function ShowLoadingPromt(msg, time, type) - Citizen.CreateThread(function() - Citizen.Wait(0) - N_0xaba17d7ce615adbf("STRING") - AddTextComponentString(msg) - N_0xbd12f8228410d9b4(type) - Citizen.Wait(time) - N_0x10d373323e5b9c0d() - end) + Citizen.CreateThread(function() + Citizen.Wait(0) + N_0xaba17d7ce615adbf("STRING") + AddTextComponentString(msg) + N_0xbd12f8228410d9b4(type) + Citizen.Wait(time) + N_0x10d373323e5b9c0d() + end) end function GetRandomWalkingNPC() - local search = {} - local peds = ESX.Game.GetPeds() + local search = {} + local peds = ESX.Game.GetPeds() - for i=1, #peds, 1 do - if IsPedHuman(peds[i]) and IsPedWalking(peds[i]) and not IsPedAPlayer(peds[i]) then - table.insert(search, peds[i]) - end - end + for i=1, #peds, 1 do + if IsPedHuman(peds[i]) and IsPedWalking(peds[i]) and not IsPedAPlayer(peds[i]) then + table.insert(search, peds[i]) + end + end - if #search > 0 then - return search[GetRandomIntInRange(1, #search)] - end + if #search > 0 then + return search[GetRandomIntInRange(1, #search)] + end - print('Using fallback code to find walking ped') + print('Using fallback code to find walking ped') - while true do + while true do - local ped = GetRandomPedAtCoord(0.0, 0.0, 0.0, math.huge + 0.0, math.huge + 0.0, math.huge + 0.0, 26) + local ped = GetRandomPedAtCoord(0.0, 0.0, 0.0, math.huge + 0.0, math.huge + 0.0, math.huge + 0.0, 26) - if DoesEntityExist(ped) and IsPedHuman(ped) and IsPedWalking(ped) and not IsPedAPlayer(ped) then - return ped - end + if DoesEntityExist(ped) and IsPedHuman(ped) and IsPedWalking(ped) and not IsPedAPlayer(ped) then + return ped + end - end + end end function ClearCurrentMission() - if DoesBlipExist(CurrentCustomerBlip) then - RemoveBlip(CurrentCustomerBlip) - end + if DoesBlipExist(CurrentCustomerBlip) then + RemoveBlip(CurrentCustomerBlip) + end - if DoesBlipExist(DestinationBlip) then - RemoveBlip(DestinationBlip) - end + if DoesBlipExist(DestinationBlip) then + RemoveBlip(DestinationBlip) + end - CurrentCustomer = nil - CurrentCustomerBlip = nil - DestinationBlip = nil - IsNearCustomer = false - CustomerIsEnteringVehicle = false - CustomerEnteredVehicle = false - TargetCoords = nil + CurrentCustomer = nil + CurrentCustomerBlip = nil + DestinationBlip = nil + IsNearCustomer = false + CustomerIsEnteringVehicle = false + CustomerEnteredVehicle = false + TargetCoords = nil end function StartTaxiJob() - ShowLoadingPromt(_U('taking_service') .. 'Taxi/Uber', 5000, 3) - ClearCurrentMission() + ShowLoadingPromt(_U('taking_service') .. 'Taxi/Uber', 5000, 3) + ClearCurrentMission() - OnJob = true + OnJob = true end function StopTaxiJob() - local playerPed = GetPlayerPed(-1) + local playerPed = GetPlayerPed(-1) - if IsPedInAnyVehicle(playerPed, false) and CurrentCustomer ~= nil then - local vehicle = GetVehiclePedIsIn(playerPed, false) - TaskLeaveVehicle(CurrentCustomer, vehicle, 0) + if IsPedInAnyVehicle(playerPed, false) and CurrentCustomer ~= nil then + local vehicle = GetVehiclePedIsIn(playerPed, false) + TaskLeaveVehicle(CurrentCustomer, vehicle, 0) - if CustomerEnteredVehicle then - TaskGoStraightToCoord(CurrentCustomer, TargetCoords.x, TargetCoords.y, TargetCoords.z, 1.0, -1, 0.0, 0.0) - end + if CustomerEnteredVehicle then + TaskGoStraightToCoord(CurrentCustomer, TargetCoords.x, TargetCoords.y, TargetCoords.z, 1.0, -1, 0.0, 0.0) + end - end + end - ClearCurrentMission() + ClearCurrentMission() - OnJob = false + OnJob = false - DrawSub(_U('mission_complete'), 5000) + DrawSub(_U('mission_complete'), 5000) end function OpenTaxiActionsMenu() - local elements = { - {label = _U('spawn_veh'), value = 'spawn_vehicle'}, - {label = _U('deposit_stock'), value = 'put_stock'}, - {label = _U('take_stock'), value = 'get_stock'} - } + local elements = { + {label = _U('spawn_veh'), value = 'spawn_vehicle'}, + {label = _U('deposit_stock'), value = 'put_stock'}, + {label = _U('take_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 + 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(), 'taxi_actions', - { - title = 'Taxi', - elements = elements - }, - function(data, menu) + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'taxi_actions', + { + title = 'Taxi', + elements = elements + }, + function(data, menu) - 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 == 'spawn_vehicle' then + if data.current.value == 'spawn_vehicle' 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('spawn_veh'), - align = 'top-left', - elements = elements, - }, - function(data, menu) + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'vehicle_spawner', + { + title = _U('spawn_veh'), + 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', 'taxi', vehicleProps) + TriggerServerEvent('esx_society:removeVehicleFromGarage', 'taxi', vehicleProps) - end, - function(data, menu) - menu.close() - end - ) + end, + function(data, menu) + menu.close() + end + ) - end, 'taxi') + end, 'taxi') - else + else - menu.close() + menu.close() - if Config.MaxInService == -1 then + if Config.MaxInService == -1 then - local playerPed = GetPlayerPed(-1) - local coords = Config.Zones.VehicleSpawnPoint.Pos + local playerPed = GetPlayerPed(-1) + local coords = Config.Zones.VehicleSpawnPoint.Pos - ESX.Game.SpawnVehicle('taxi', coords, 225.0, function(vehicle) - TaskWarpPedIntoVehicle(playerPed, vehicle, -1) - end) + ESX.Game.SpawnVehicle('taxi', coords, 225.0, function(vehicle) + TaskWarpPedIntoVehicle(playerPed, vehicle, -1) + end) - else + else - ESX.TriggerServerCallback('esx_service:enableService', function(canTakeService, maxInService, inServiceCount) + ESX.TriggerServerCallback('esx_service:enableService', function(canTakeService, maxInService, inServiceCount) - if canTakeService then + if canTakeService then - local playerPed = GetPlayerPed(-1) - local coords = Config.Zones.VehicleSpawnPoint.Pos + local playerPed = GetPlayerPed(-1) + local coords = Config.Zones.VehicleSpawnPoint.Pos - ESX.Game.SpawnVehicle('taxi', coords, 225.0, function(vehicle) - TaskWarpPedIntoVehicle(playerPed, vehicle, -1) - end) + ESX.Game.SpawnVehicle('taxi', coords, 225.0, function(vehicle) + TaskWarpPedIntoVehicle(playerPed, vehicle, -1) + end) - else + else - ESX.ShowNotification(_U('full_service') .. inServiceCount .. '/' .. maxInService) + ESX.ShowNotification(_U('full_service') .. inServiceCount .. '/' .. maxInService) - end + end - end, 'taxi') + end, 'taxi') - end + end - end + end - end + end - if data.current.value == 'boss_actions' then - TriggerEvent('esx_society:openBossMenu', 'taxi', function(data, menu) - menu.close() - end) - end + if data.current.value == 'boss_actions' then + TriggerEvent('esx_society:openBossMenu', 'taxi', function(data, menu) + menu.close() + end) + end - end, - function(data, menu) + end, + function(data, menu) - menu.close() + menu.close() - CurrentAction = 'taxi_actions_menu' - CurrentActionMsg = _U('press_to_open') - CurrentActionData = {} + CurrentAction = 'taxi_actions_menu' + CurrentActionMsg = _U('press_to_open') + CurrentActionData = {} - end - ) + end + ) end function OpenMobileTaxiActionsMenu() - ESX.UI.Menu.CloseAll() + ESX.UI.Menu.CloseAll() - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'mobile_taxi_actions', - { - title = 'Taxi', - elements = { - {label = _U('billing'), value = 'billing'} - } - }, - function(data, menu) + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'mobile_taxi_actions', + { + title = 'Taxi', + elements = { + {label = _U('billing'), value = 'billing'} + } + }, + function(data, menu) - if data.current.value == 'billing' then + if data.current.value == 'billing' then - ESX.UI.Menu.Open( - 'dialog', GetCurrentResourceName(), 'billing', - { - title = _U('invoice_amount') - }, - function(data, menu) + ESX.UI.Menu.Open( + 'dialog', GetCurrentResourceName(), 'billing', + { + title = _U('invoice_amount') + }, + function(data, menu) - local amount = tonumber(data.value) + local amount = tonumber(data.value) - if amount == nil then - ESX.ShowNotification(_U('amount_invalid')) - else + if amount == nil then + ESX.ShowNotification(_U('amount_invalid')) + else - menu.close() + menu.close() - local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer() + local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer() - if closestPlayer == -1 or closestDistance > 3.0 then - ESX.ShowNotification(_U('no_players_near')) - else - TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(closestPlayer), 'society_taxi', 'Taxi', amount) - end + if closestPlayer == -1 or closestDistance > 3.0 then + ESX.ShowNotification(_U('no_players_near')) + else + TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(closestPlayer), 'society_taxi', 'Taxi', amount) + end - end + end - end, - function(data, menu) - menu.close() - end - ) + end, + function(data, menu) + menu.close() + end + ) - end + end - end, - function(data, menu) - menu.close() - end - ) + end, + function(data, menu) + menu.close() + end + ) end function OpenGetStocksMenu() - ESX.TriggerServerCallback('esx_taxijob:getStockItems', function(items) + ESX.TriggerServerCallback('esx_taxijob: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 = 'Taxi Stock', - elements = elements - }, - function(data, menu) + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'stocks_menu', + { + title = 'Taxi 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('quantity_invalid')) - else - menu2.close() - menu.close() - OpenGetStocksMenu() + if count == nil then + ESX.ShowNotification(_U('quantity_invalid')) + else + menu2.close() + menu.close() + OpenGetStocksMenu() - TriggerServerEvent('esx_taxijob:getStockItem', itemName, count) - end + TriggerServerEvent('esx_taxijob: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 function OpenPutStocksMenu() - ESX.TriggerServerCallback('esx_taxijob:getPlayerInventory', function(inventory) + ESX.TriggerServerCallback('esx_taxijob: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('quantity_invalid')) - else - menu2.close() - menu.close() - OpenPutStocksMenu() + if count == nil then + ESX.ShowNotification(_U('quantity_invalid')) + else + menu2.close() + menu.close() + OpenPutStocksMenu() - TriggerServerEvent('esx_taxijob:putStockItems', itemName, count) - end + TriggerServerEvent('esx_taxijob: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: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_taxijob:hasEnteredMarker', function(zone) - if zone == 'TaxiActions' then - CurrentAction = 'taxi_actions_menu' - CurrentActionMsg = _U('press_to_open') - CurrentActionData = {} - end + if zone == 'TaxiActions' then + CurrentAction = 'taxi_actions_menu' + CurrentActionMsg = _U('press_to_open') + CurrentActionData = {} + end - if zone == 'VehicleDeleter' then + if zone == 'VehicleDeleter' then - local playerPed = GetPlayerPed(-1) + local playerPed = GetPlayerPed(-1) - if IsPedInAnyVehicle(playerPed, false) then - CurrentAction = 'delete_vehicle' - CurrentActionMsg = _U('store_veh') - CurrentActionData = {} - end + if IsPedInAnyVehicle(playerPed, false) then + CurrentAction = 'delete_vehicle' + CurrentActionMsg = _U('store_veh') + CurrentActionData = {} + end - end + end end) AddEventHandler('esx_taxijob:hasExitedMarker', function(zone) - ESX.UI.Menu.CloseAll() - CurrentAction = nil + ESX.UI.Menu.CloseAll() + CurrentAction = nil end) RegisterNetEvent('esx_phone:loaded') AddEventHandler('esx_phone:loaded', function(phoneNumber, contacts) - local specialContact = { - name = 'Taxi', - number = 'taxi', - base64Icon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAGGElEQVR4XsWWW2gd1xWGv7Vn5pyRj47ut8iOYlmyWxw1KSZN4riOW6eFuCYldaBtIL1Ag4NNmt5ICORCaNKXlF6oCy0hpSoJKW4bp7Sk6YNb01RuLq4d0pQ0kWQrshVJ1uX46HJ0zpy5rCKfQYgjCUs4kA+GtTd786+ftW8jqsqHibB6TLZn2zeq09ZTWAIWCxACoTI1E+6v+eSpXwHRqkVZPcmqlBzCApLQ8dk3IWVKMQlYcHG81OODNmD6D7d9VQrTSbwsH73lFKePtvOxXSfn48U+Xpb58fl5gPmgl6DiR19PZN4+G7iODY4liIAACqiCHyp+AFvb7ML3uot1QP5yDUim292RtIqfU6Lr8wFVDVV8AsPKRDAxzYkKm2kj5sSFuUT3+v2FXkDXakD6f+7c1NGS7Ml0Pkah6jq8mhvwUy7Cyijg5Aoks6/hTp+k7vRjDJ73dmw8WHxlJRM2y5Nsb3GPDuzsZURbGMsUmRkoUPByCMrKCG7SobJiO01X7OKq6utoe3XX34BaoLDaCljj3faTcu3j3z3T+iADwzNYEmKIWcGAIAtqqkKAxZa2Sja/tY+59/7y48aveQ8A4Woq4Fa3bj7Q1/EgwWRAZ52NMTYCWAZEwIhBUEQgUiVQ8IpKvqj4kVJCyGRCRrb+hvap+gPAo0DuUhWQfx2q29u+t/vPmarbCLwII7qQTEQRLbUtBJ2PAkZARBADqkLBV/I+BGrhpoSN577FWz3P3XbTvRMvAlpuwC4crv5jwtK9RAFSu46+G8cRwESxQ+K2gESAgCiIASHuA8YCBdSUohdCKGCF0H6iGc3MgrEphvKi+6Wp24HABioSjuxFARGobyJ5OMXEiGHW6iLR0EmifhPJDddj3CoqtuwEZSkCc73/RAvTeEOvU5w8gz/Zj2TfoLFFibZvQrI5EOFiPqgAZmzApTINKKgPiW20ffkXtPXfA9Ysmf5/kHn/T0z8e5rpCS5JVQNUN1ayfn2a+qvT2JWboOOXMPg0ms6C2IAAWTc2ACPeupdbm5yb8XNQczOM90DOB0uoa01Ttz5FZ6IL3Ctg9DUIg7Lto2DZ0HIDFEbAz4AaiBRyxZJe9U7kQg84KYbH/JeJESANXPXwXdWffvzu1p+x5VE4/ST4EyAOoEAI6WsAhdx/AYulhJDqAgRm/hPPEVAfnAboeAB6v88jTw/f98SzU8eAwbgC5IGRg3vsW3E7YewYzJwF4wAhikJURGqvBO8ouAFIxBI0gqgPEp9B86+ASSAIEEHhbEnX7eTgnrFbn3iW5+K82EAA+M2V+d2EeRj9K/izIBYgJZGwCO4Gzm/uRQOwDEsI41PSfPZ+xJsBKwFo6dOwpJvezMU84Md5sSmRCM51uacGbUKvHWEjAKIelXaGJqePyopjzFTdx6Ef/gDbjo3FKEoQKN+8/yEqRt8jf67IaNDBnF9FZFwERRGspMM20+XC64nym9AMhSE1G7fjbb0bCQsISi6vFCdPMPzuUwR9AcmOKQ7cew+WZcq3IGEYMZeb4p13sjjmU4TX7Cfdtp0oDAFBbZfk/37N0MALAKbcAKaY4yPeuwy3t2J8MAKDIxDVd1Lz8Ts599vb8Wameen532GspRWIQmXPHV8k0BquvPP3TOSgsRmiCFRAHWh9420Gi7nl34JaBen7O7UWRMD740AQ7yEf8nW78TIeN+7+PCIsOYaqMJHxqKtpJ++D+DA5ARsawEmASqzv1Cz7FjRpbt951tUAOcAHdNEUC7C5NAJo7Dws03CAFMxlkdSRZmCMxaq8ejKuVwSqIJfzA61LmyIgBoxZfgmYmQazKLGumHitRso0ZVkD0aE/FI7UrYv2WUYXjo0ihNhEatA1GBEUIxEWAcKCHhHCVMG8AETlda0ENn3hrm+/6Zh47RBCtXn+mZ/sAXzWjnPHV77zkiXBgl6gFkee+em1wBlgdnEF8sCF5moLI7KwlSIMwABwgbVT21htMNjleheAfPkShEBh/PzQccexdxBT9IPjQAYYZ+3o2OjQ8cQiPb+kVwBCliENXA3sAm6Zj3E/zaq4fD07HmwEmuKYXsUFcDl6Hz7/B1RGfEbPim/bAAAAAElFTkSuQmCC', - } + local specialContact = { + name = 'Taxi', + number = 'taxi', + base64Icon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAGGElEQVR4XsWWW2gd1xWGv7Vn5pyRj47ut8iOYlmyWxw1KSZN4riOW6eFuCYldaBtIL1Ag4NNmt5ICORCaNKXlF6oCy0hpSoJKW4bp7Sk6YNb01RuLq4d0pQ0kWQrshVJ1uX46HJ0zpy5rCKfQYgjCUs4kA+GtTd786+ftW8jqsqHibB6TLZn2zeq09ZTWAIWCxACoTI1E+6v+eSpXwHRqkVZPcmqlBzCApLQ8dk3IWVKMQlYcHG81OODNmD6D7d9VQrTSbwsH73lFKePtvOxXSfn48U+Xpb58fl5gPmgl6DiR19PZN4+G7iODY4liIAACqiCHyp+AFvb7ML3uot1QP5yDUim292RtIqfU6Lr8wFVDVV8AsPKRDAxzYkKm2kj5sSFuUT3+v2FXkDXakD6f+7c1NGS7Ml0Pkah6jq8mhvwUy7Cyijg5Aoks6/hTp+k7vRjDJ73dmw8WHxlJRM2y5Nsb3GPDuzsZURbGMsUmRkoUPByCMrKCG7SobJiO01X7OKq6utoe3XX34BaoLDaCljj3faTcu3j3z3T+iADwzNYEmKIWcGAIAtqqkKAxZa2Sja/tY+59/7y48aveQ8A4Woq4Fa3bj7Q1/EgwWRAZ52NMTYCWAZEwIhBUEQgUiVQ8IpKvqj4kVJCyGRCRrb+hvap+gPAo0DuUhWQfx2q29u+t/vPmarbCLwII7qQTEQRLbUtBJ2PAkZARBADqkLBV/I+BGrhpoSN577FWz3P3XbTvRMvAlpuwC4crv5jwtK9RAFSu46+G8cRwESxQ+K2gESAgCiIASHuA8YCBdSUohdCKGCF0H6iGc3MgrEphvKi+6Wp24HABioSjuxFARGobyJ5OMXEiGHW6iLR0EmifhPJDddj3CoqtuwEZSkCc73/RAvTeEOvU5w8gz/Zj2TfoLFFibZvQrI5EOFiPqgAZmzApTINKKgPiW20ffkXtPXfA9Ysmf5/kHn/T0z8e5rpCS5JVQNUN1ayfn2a+qvT2JWboOOXMPg0ms6C2IAAWTc2ACPeupdbm5yb8XNQczOM90DOB0uoa01Ttz5FZ6IL3Ctg9DUIg7Lto2DZ0HIDFEbAz4AaiBRyxZJe9U7kQg84KYbH/JeJESANXPXwXdWffvzu1p+x5VE4/ST4EyAOoEAI6WsAhdx/AYulhJDqAgRm/hPPEVAfnAboeAB6v88jTw/f98SzU8eAwbgC5IGRg3vsW3E7YewYzJwF4wAhikJURGqvBO8ouAFIxBI0gqgPEp9B86+ASSAIEEHhbEnX7eTgnrFbn3iW5+K82EAA+M2V+d2EeRj9K/izIBYgJZGwCO4Gzm/uRQOwDEsI41PSfPZ+xJsBKwFo6dOwpJvezMU84Md5sSmRCM51uacGbUKvHWEjAKIelXaGJqePyopjzFTdx6Ef/gDbjo3FKEoQKN+8/yEqRt8jf67IaNDBnF9FZFwERRGspMM20+XC64nym9AMhSE1G7fjbb0bCQsISi6vFCdPMPzuUwR9AcmOKQ7cew+WZcq3IGEYMZeb4p13sjjmU4TX7Cfdtp0oDAFBbZfk/37N0MALAKbcAKaY4yPeuwy3t2J8MAKDIxDVd1Lz8Ts599vb8Wameen532GspRWIQmXPHV8k0BquvPP3TOSgsRmiCFRAHWh9420Gi7nl34JaBen7O7UWRMD740AQ7yEf8nW78TIeN+7+PCIsOYaqMJHxqKtpJ++D+DA5ARsawEmASqzv1Cz7FjRpbt951tUAOcAHdNEUC7C5NAJo7Dws03CAFMxlkdSRZmCMxaq8ejKuVwSqIJfzA61LmyIgBoxZfgmYmQazKLGumHitRso0ZVkD0aE/FI7UrYv2WUYXjo0ihNhEatA1GBEUIxEWAcKCHhHCVMG8AETlda0ENn3hrm+/6Zh47RBCtXn+mZ/sAXzWjnPHV77zkiXBgl6gFkee+em1wBlgdnEF8sCF5moLI7KwlSIMwABwgbVT21htMNjleheAfPkShEBh/PzQccexdxBT9IPjQAYYZ+3o2OjQ8cQiPb+kVwBCliENXA3sAm6Zj3E/zaq4fD07HmwEmuKYXsUFcDl6Hz7/B1RGfEbPim/bAAAAAElFTkSuQmCC', + } - TriggerEvent('esx_phone:addSpecialContact', specialContact.name, specialContact.number, specialContact.base64Icon) + TriggerEvent('esx_phone:addSpecialContact', specialContact.name, specialContact.number, specialContact.base64Icon) end) -- Create Blips Citizen.CreateThread(function() - local blip = AddBlipForCoord(Config.Zones.TaxiActions.Pos.x, Config.Zones.TaxiActions.Pos.y, Config.Zones.TaxiActions.Pos.z) + local blip = AddBlipForCoord(Config.Zones.TaxiActions.Pos.x, Config.Zones.TaxiActions.Pos.y, Config.Zones.TaxiActions.Pos.z) - SetBlipSprite (blip, 198) - SetBlipDisplay(blip, 4) - SetBlipScale (blip, 1.0) - SetBlipColour (blip, 5) - SetBlipAsShortRange(blip, true) + SetBlipSprite (blip, 198) + SetBlipDisplay(blip, 4) + SetBlipScale (blip, 1.0) + SetBlipColour (blip, 5) + SetBlipAsShortRange(blip, true) - BeginTextCommandSetBlipName("STRING") - AddTextComponentString("Taxi") - EndTextCommandSetBlipName(blip) + BeginTextCommandSetBlipName("STRING") + AddTextComponentString("Taxi") + EndTextCommandSetBlipName(blip) end) -- Display markers Citizen.CreateThread(function() - while true do + while true do - Wait(0) + Wait(0) - if PlayerData.job ~= nil and PlayerData.job.name == 'taxi' then + if PlayerData.job ~= nil and PlayerData.job.name == 'taxi' 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 + 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 + end end) -- Enter / Exit marker events Citizen.CreateThread(function() - while true do + while true do - Wait(0) + Wait(0) - if PlayerData.job ~= nil and PlayerData.job.name == 'taxi' then + if PlayerData.job ~= nil and PlayerData.job.name == 'taxi' then - local coords = GetEntityCoords(GetPlayerPed(-1)) - local isInMarker = false - local currentZone = nil + 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 + 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_taxijob:hasEnteredMarker', currentZone) - end + if (isInMarker and not HasAlreadyEnteredMarker) or (isInMarker and LastZone ~= currentZone) then + HasAlreadyEnteredMarker = true + LastZone = currentZone + TriggerEvent('esx_taxijob:hasEnteredMarker', currentZone) + end - if not isInMarker and HasAlreadyEnteredMarker then - HasAlreadyEnteredMarker = false - TriggerEvent('esx_taxijob:hasExitedMarker', LastZone) - end + if not isInMarker and HasAlreadyEnteredMarker then + HasAlreadyEnteredMarker = false + TriggerEvent('esx_taxijob:hasExitedMarker', LastZone) + end - end + end - end + end end) -- Taxi Job Citizen.CreateThread(function() - while true do + while true do - Citizen.Wait(0) + Citizen.Wait(0) - local playerPed = GetPlayerPed(-1) + local playerPed = GetPlayerPed(-1) - if OnJob then + if OnJob then - if CurrentCustomer == nil then + if CurrentCustomer == nil then - DrawSub(_U('drive_search_pass'), 5000) + DrawSub(_U('drive_search_pass'), 5000) - if IsPedInAnyVehicle(playerPed, false) and GetEntitySpeed(playerPed) > 0 then + if IsPedInAnyVehicle(playerPed, false) and GetEntitySpeed(playerPed) > 0 then - local waitUntil = GetGameTimer() + GetRandomIntInRange(30000, 45000) + local waitUntil = GetGameTimer() + GetRandomIntInRange(30000, 45000) - while OnJob and waitUntil > GetGameTimer() do - Citizen.Wait(0) - end + while OnJob and waitUntil > GetGameTimer() do + Citizen.Wait(0) + end - if OnJob and IsPedInAnyVehicle(playerPed, false) and GetEntitySpeed(playerPed) > 0 then + if OnJob and IsPedInAnyVehicle(playerPed, false) and GetEntitySpeed(playerPed) > 0 then - CurrentCustomer = GetRandomWalkingNPC() + CurrentCustomer = GetRandomWalkingNPC() - if CurrentCustomer ~= nil then + if CurrentCustomer ~= nil then - CurrentCustomerBlip = AddBlipForEntity(CurrentCustomer) + CurrentCustomerBlip = AddBlipForEntity(CurrentCustomer) - SetBlipAsFriendly(CurrentCustomerBlip, 1) - SetBlipColour(CurrentCustomerBlip, 2) - SetBlipCategory(CurrentCustomerBlip, 3) - SetBlipRoute(CurrentCustomerBlip, true) + SetBlipAsFriendly(CurrentCustomerBlip, 1) + SetBlipColour(CurrentCustomerBlip, 2) + SetBlipCategory(CurrentCustomerBlip, 3) + SetBlipRoute(CurrentCustomerBlip, true) - SetEntityAsMissionEntity(CurrentCustomer, true, false) - ClearPedTasksImmediately(CurrentCustomer) - SetBlockingOfNonTemporaryEvents(CurrentCustomer, 1) + SetEntityAsMissionEntity(CurrentCustomer, true, false) + ClearPedTasksImmediately(CurrentCustomer) + SetBlockingOfNonTemporaryEvents(CurrentCustomer, 1) - local standTime = GetRandomIntInRange(60000, 180000) + local standTime = GetRandomIntInRange(60000, 180000) - TaskStandStill(CurrentCustomer, standTime) + TaskStandStill(CurrentCustomer, standTime) - ESX.ShowNotification(_U('customer_found')) + ESX.ShowNotification(_U('customer_found')) - end + end - end + end - end + end - else + else - if IsPedFatallyInjured(CurrentCustomer) then + if IsPedFatallyInjured(CurrentCustomer) then - ESX.ShowNotification(_U('client_unconcious')) + ESX.ShowNotification(_U('client_unconcious')) - if DoesBlipExist(CurrentCustomerBlip) then - RemoveBlip(CurrentCustomerBlip) - end + if DoesBlipExist(CurrentCustomerBlip) then + RemoveBlip(CurrentCustomerBlip) + end - if DoesBlipExist(DestinationBlip) then - RemoveBlip(DestinationBlip) - end + if DoesBlipExist(DestinationBlip) then + RemoveBlip(DestinationBlip) + end - SetEntityAsMissionEntity(CurrentCustomer, false, true) + SetEntityAsMissionEntity(CurrentCustomer, false, true) - CurrentCustomer = nil - CurrentCustomerBlip = nil - DestinationBlip = nil - IsNearCustomer = false - CustomerIsEnteringVehicle = false - CustomerEnteredVehicle = false - TargetCoords = nil + CurrentCustomer = nil + CurrentCustomerBlip = nil + DestinationBlip = nil + IsNearCustomer = false + CustomerIsEnteringVehicle = false + CustomerEnteredVehicle = false + TargetCoords = nil - end + end - if IsPedInAnyVehicle(playerPed, false) then + if IsPedInAnyVehicle(playerPed, false) then - local vehicle = GetVehiclePedIsIn(playerPed, false) - local playerCoords = GetEntityCoords(playerPed) - local customerCoords = GetEntityCoords(CurrentCustomer) - local customerDistance = GetDistanceBetweenCoords(playerCoords.x, playerCoords.y, playerCoords.z, customerCoords.x, customerCoords.y, customerCoords.z) + local vehicle = GetVehiclePedIsIn(playerPed, false) + local playerCoords = GetEntityCoords(playerPed) + local customerCoords = GetEntityCoords(CurrentCustomer) + local customerDistance = GetDistanceBetweenCoords(playerCoords.x, playerCoords.y, playerCoords.z, customerCoords.x, customerCoords.y, customerCoords.z) - if IsPedSittingInVehicle(CurrentCustomer, vehicle) then + if IsPedSittingInVehicle(CurrentCustomer, vehicle) then - if CustomerEnteredVehicle then + if CustomerEnteredVehicle then - local targetDistance = GetDistanceBetweenCoords(playerCoords.x, playerCoords.y, playerCoords.z, TargetCoords.x, TargetCoords.y, TargetCoords.z) + local targetDistance = GetDistanceBetweenCoords(playerCoords.x, playerCoords.y, playerCoords.z, TargetCoords.x, TargetCoords.y, TargetCoords.z) - if targetDistance <= 10.0 then + if targetDistance <= 10.0 then - TaskLeaveVehicle(CurrentCustomer, vehicle, 0) + TaskLeaveVehicle(CurrentCustomer, vehicle, 0) - ESX.ShowNotification(_U('arrive_dest')) + ESX.ShowNotification(_U('arrive_dest')) - TaskGoStraightToCoord(CurrentCustomer, TargetCoords.x, TargetCoords.y, TargetCoords.z, 1.0, -1, 0.0, 0.0) - SetEntityAsMissionEntity(CurrentCustomer, false, true) + TaskGoStraightToCoord(CurrentCustomer, TargetCoords.x, TargetCoords.y, TargetCoords.z, 1.0, -1, 0.0, 0.0) + SetEntityAsMissionEntity(CurrentCustomer, false, true) - TriggerServerEvent('esx_taxijob:success') + TriggerServerEvent('esx_taxijob:success') - RemoveBlip(DestinationBlip) + RemoveBlip(DestinationBlip) - local scope = function(customer) - ESX.SetTimeout(60000, function() - DeletePed(customer) - end) - end + local scope = function(customer) + ESX.SetTimeout(60000, function() + DeletePed(customer) + end) + end - scope(CurrentCustomer) + scope(CurrentCustomer) - CurrentCustomer = nil - CurrentCustomerBlip = nil - DestinationBlip = nil - IsNearCustomer = false - CustomerIsEnteringVehicle = false - CustomerEnteredVehicle = false - TargetCoords = nil + CurrentCustomer = nil + CurrentCustomerBlip = nil + DestinationBlip = nil + IsNearCustomer = false + CustomerIsEnteringVehicle = false + CustomerEnteredVehicle = false + TargetCoords = nil - end + end - if TargetCoords ~= nil then - DrawMarker(1, TargetCoords.x, TargetCoords.y, TargetCoords.z - 1.0, 0, 0, 0, 0, 0, 0, 4.0, 4.0, 2.0, 178, 236, 93, 155, 0, 0, 2, 0, 0, 0, 0) - end + if TargetCoords ~= nil then + DrawMarker(1, TargetCoords.x, TargetCoords.y, TargetCoords.z - 1.0, 0, 0, 0, 0, 0, 0, 4.0, 4.0, 2.0, 178, 236, 93, 155, 0, 0, 2, 0, 0, 0, 0) + end - else + else - RemoveBlip(CurrentCustomerBlip) + RemoveBlip(CurrentCustomerBlip) - CurrentCustomerBlip = nil + CurrentCustomerBlip = nil - TargetCoords = Config.JobLocations[GetRandomIntInRange(1, #Config.JobLocations)] + TargetCoords = Config.JobLocations[GetRandomIntInRange(1, #Config.JobLocations)] - local street = table.pack(GetStreetNameAtCoord(TargetCoords.x, TargetCoords.y, TargetCoords.z)) - local msg = nil + local street = table.pack(GetStreetNameAtCoord(TargetCoords.x, TargetCoords.y, TargetCoords.z)) + local msg = nil - if street[2] ~= 0 and street[2] ~= nil then - msg = string.format(_U('take_me_to_near', GetStreetNameFromHashKey(street[1]),GetStreetNameFromHashKey(street[2]))) - else - msg = string.format(_U('take_me_to', GetStreetNameFromHashKey(street[1]))) - end + if street[2] ~= 0 and street[2] ~= nil then + msg = string.format(_U('take_me_to_near', GetStreetNameFromHashKey(street[1]),GetStreetNameFromHashKey(street[2]))) + else + msg = string.format(_U('take_me_to', GetStreetNameFromHashKey(street[1]))) + end - ESX.ShowNotification(msg) + ESX.ShowNotification(msg) - DestinationBlip = AddBlipForCoord(TargetCoords.x, TargetCoords.y, TargetCoords.z) + DestinationBlip = AddBlipForCoord(TargetCoords.x, TargetCoords.y, TargetCoords.z) - BeginTextCommandSetBlipName("STRING") - AddTextComponentString("Destination") - EndTextCommandSetBlipName(blip) + BeginTextCommandSetBlipName("STRING") + AddTextComponentString("Destination") + EndTextCommandSetBlipName(blip) - SetBlipRoute(DestinationBlip, true) + SetBlipRoute(DestinationBlip, true) - CustomerEnteredVehicle = true + CustomerEnteredVehicle = true - end + end - else + else - DrawMarker(1, customerCoords.x, customerCoords.y, customerCoords.z - 1.0, 0, 0, 0, 0, 0, 0, 4.0, 4.0, 2.0, 178, 236, 93, 155, 0, 0, 2, 0, 0, 0, 0) + DrawMarker(1, customerCoords.x, customerCoords.y, customerCoords.z - 1.0, 0, 0, 0, 0, 0, 0, 4.0, 4.0, 2.0, 178, 236, 93, 155, 0, 0, 2, 0, 0, 0, 0) - if not CustomerEnteredVehicle then + if not CustomerEnteredVehicle then - if customerDistance <= 30.0 then + if customerDistance <= 30.0 then - if not IsNearCustomer then - ESX.ShowNotification(_U('close_to_client')) - IsNearCustomer = true - end + if not IsNearCustomer then + ESX.ShowNotification(_U('close_to_client')) + IsNearCustomer = true + end - end + end - if customerDistance <= 100.0 then + if customerDistance <= 100.0 then - if not CustomerIsEnteringVehicle then + if not CustomerIsEnteringVehicle then - ClearPedTasksImmediately(CurrentCustomer) + ClearPedTasksImmediately(CurrentCustomer) - local seat = 0 + local seat = 0 - for i=4, 0, 1 do - if IsVehicleSeatFree(vehicle, seat) then - seat = i - break - end - end + for i=4, 0, 1 do + if IsVehicleSeatFree(vehicle, seat) then + seat = i + break + end + end - TaskEnterVehicle(CurrentCustomer, vehicle, -1, seat, 2.0, 1) + TaskEnterVehicle(CurrentCustomer, vehicle, -1, seat, 2.0, 1) - CustomerIsEnteringVehicle = true + CustomerIsEnteringVehicle = true - end + end - end + end - end + end - end + end - else + else - DrawSub(_U('return_to_veh'), 5000) + DrawSub(_U('return_to_veh'), 5000) - end + end - end + end - end + end - end + end end) -- Key Controls Citizen.CreateThread(function() - while true do + while true do - Citizen.Wait(0) + Citizen.Wait(0) - if CurrentAction ~= nil then + if CurrentAction ~= nil then - SetTextComponentFormat('STRING') - AddTextComponentString(CurrentActionMsg) - DisplayHelpTextFromStringLabel(0, 0, 1, -1) + SetTextComponentFormat('STRING') + AddTextComponentString(CurrentActionMsg) + DisplayHelpTextFromStringLabel(0, 0, 1, -1) - if IsControlPressed(0, Keys['E']) and PlayerData.job ~= nil and PlayerData.job.name == 'taxi' and (GetGameTimer() - GUI.Time) > 300 then + if IsControlPressed(0, Keys['E']) and PlayerData.job ~= nil and PlayerData.job.name == 'taxi' and (GetGameTimer() - GUI.Time) > 300 then - if CurrentAction == 'taxi_actions_menu' then - OpenTaxiActionsMenu() - end + if CurrentAction == 'taxi_actions_menu' then + OpenTaxiActionsMenu() + end - if CurrentAction == 'delete_vehicle' then + if CurrentAction == 'delete_vehicle' then - local playerPed = GetPlayerPed(-1) + local playerPed = GetPlayerPed(-1) - if Config.EnableSocietyOwnedVehicles then - local vehicleProps = ESX.Game.GetVehicleProperties(CurrentActionData.vehicle) - TriggerServerEvent('esx_society:putVehicleInGarage', 'taxi', vehicleProps) - else - if GetEntityModel(CurrentActionData.vehicle) == GetHashKey('taxi') then - if Config.MaxInService ~= -1 then - TriggerServerEvent('esx_service:disableService', 'taxi') - end - end - end + if Config.EnableSocietyOwnedVehicles then + local vehicleProps = ESX.Game.GetVehicleProperties(CurrentActionData.vehicle) + TriggerServerEvent('esx_society:putVehicleInGarage', 'taxi', vehicleProps) + else + if GetEntityModel(CurrentActionData.vehicle) == GetHashKey('taxi') then + if Config.MaxInService ~= -1 then + TriggerServerEvent('esx_service:disableService', 'taxi') + end + end + end - ESX.Game.DeleteVehicle(CurrentActionData.vehicle) + ESX.Game.DeleteVehicle(CurrentActionData.vehicle) - end + end - CurrentAction = nil - GUI.Time = GetGameTimer() + CurrentAction = nil + GUI.Time = GetGameTimer() - end + end - end + end - if IsControlPressed(0, Keys['F6']) and Config.EnablePlayerManagement and PlayerData.job ~= nil and PlayerData.job.name == 'taxi' and (GetGameTimer() - GUI.Time) > 150 then - OpenMobileTaxiActionsMenu() - GUI.Time = GetGameTimer() - end + if IsControlPressed(0, Keys['F6']) and Config.EnablePlayerManagement and PlayerData.job ~= nil and PlayerData.job.name == 'taxi' and (GetGameTimer() - GUI.Time) > 150 then + OpenMobileTaxiActionsMenu() + GUI.Time = GetGameTimer() + end - if IsControlPressed(0, Keys['DELETE']) and (GetGameTimer() - GUI.Time) > 150 then + if IsControlPressed(0, Keys['DELETE']) and (GetGameTimer() - GUI.Time) > 150 then - if OnJob then - StopTaxiJob() - else + if OnJob then + StopTaxiJob() + else - if PlayerData.job ~= nil and PlayerData.job.name == 'taxi' then + if PlayerData.job ~= nil and PlayerData.job.name == 'taxi' 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) - if PlayerData.job.grade >= 3 then - StartTaxiJob() - else - if GetEntityModel(vehicle) == GetHashKey('taxi') then - StartTaxiJob() - else - ESX.ShowNotification(_U('must_in_taxi')) - end - end + if PlayerData.job.grade >= 3 then + StartTaxiJob() + else + if GetEntityModel(vehicle) == GetHashKey('taxi') then + StartTaxiJob() + else + ESX.ShowNotification(_U('must_in_taxi')) + end + end - else + else - if PlayerData.job.grade >= 3 then - ESX.ShowNotification(_U('must_in_vehicle')) - else - ESX.ShowNotification(_U('must_in_taxi')) - end + if PlayerData.job.grade >= 3 then + ESX.ShowNotification(_U('must_in_vehicle')) + else + ESX.ShowNotification(_U('must_in_taxi')) + end - end + end - end + end - end + end - GUI.Time = GetGameTimer() + GUI.Time = GetGameTimer() - end + end - end + end end) diff --git a/config.lua b/config.lua index 3f2be6d9..3757e4df 100644 --- a/config.lua +++ b/config.lua @@ -8,119 +8,119 @@ Config.Locale = 'fr' Config.Zones = { - TaxiActions = { - Pos = {x = 915.039, y = -162.187, z = 73.684}, - Size = {x = 1.5, y = 1.5, z = 1.0}, - Color = {r = 204, g = 204, b = 0}, - Type = 1 - }, + TaxiActions = { + Pos = {x = 915.039, y = -162.187, z = 73.684}, + Size = {x = 1.5, y = 1.5, z = 1.0}, + Color = {r = 204, g = 204, b = 0}, + Type = 1 + }, - VehicleSpawnPoint = { - Pos = {x = 911.108, y = -177.867, z = 74.283}, - Size = {x = 1.5, y = 1.5, z = 1.0}, - Type = -1 - }, + VehicleSpawnPoint = { + Pos = {x = 911.108, y = -177.867, z = 74.283}, + Size = {x = 1.5, y = 1.5, z = 1.0}, + Type = -1 + }, - VehicleDeleter = { - Pos = {x = 908.317, y = -183.070, z = 73.201}, - Size = {x = 3.0, y = 3.0, z = 1.0}, - Color = {r = 204, g = 204, b = 0}, - Type = 1 - } + VehicleDeleter = { + Pos = {x = 908.317, y = -183.070, z = 73.201}, + Size = {x = 3.0, y = 3.0, z = 1.0}, + Color = {r = 204, g = 204, b = 0}, + Type = 1 + } } Config.JobLocations = { - {x = 293.476, y = -590.163, z = 42.7371}, - {x = 253.404, y = -375.86, z = 44.0819}, - {x = 120.808, y = -300.416, z = 45.1399}, - {x = -38.4132, y = -381.576, z = 38.3456}, - {x = -107.442, y = -614.377, z = 35.6703}, - {x = -252.292, y = -856.474, z = 30.5626}, - {x = -236.138, y = -988.382, z = 28.7749}, - {x = -276.989, y = -1061.18, z = 25.6853}, - {x = -576.451, y = -998.989, z = 21.785}, - {x = -602.798, y = -952.63, z = 21.6353}, - {x = -790.653, y = -961.855, z = 14.8932}, - {x = -912.588, y = -864.756, z = 15.0057}, - {x = -1069.77, y = -792.513, z = 18.8075}, - {x = -1306.94, y = -854.085, z = 15.0959}, - {x = -1468.51, y = -681.363, z = 26.178}, - {x = -1380.89, y = -452.7, z = 34.0843}, - {x = -1326.35, y = -394.81, z = 36.0632}, - {x = -1383.68, y = -269.985, z = 42.4878}, - {x = -1679.61, y = -457.339, z = 39.4048}, - {x = -1812.45, y = -416.917, z = 43.6734}, - {x = -2043.64, y = -268.291, z = 22.9927}, - {x = -2186.45, y = -421.595, z = 12.6776}, - {x = -1862.08, y = -586.528, z = 11.1747}, - {x = -1859.5, y = -617.563, z = 10.8788}, - {x = -1634.95, y = -988.302, z = 12.6241}, - {x = -1283.99, y = -1154.16, z = 5.30998}, - {x = -1126.47, y = -1338.08, z = 4.63434}, - {x = -867.907, y = -1159.67, z = 5.00795}, - {x = -847.55, y = -1141.38, z = 6.27591}, - {x = -722.625, y = -1144.6, z = 10.2176}, - {x = -575.503, y = -318.446, z = 34.5273}, - {x = -592.309, y = -224.853, z = 36.1209}, - {x = -559.594, y = -162.873, z = 37.7547}, - {x = -534.992, y = -65.6695, z = 40.634}, - {x = -758.234, y = -36.6906, z = 37.2911}, - {x = -1375.88, y = 20.9516, z = 53.2255}, - {x = -1320.25, y = -128.018, z = 48.097}, - {x = -1285.71, y = 294.287, z = 64.4619}, - {x = -1245.67, y = 386.533, z = 75.0908}, - {x = -760.355, y = 285.015, z = 85.0667}, - {x = -626.786, y = 254.146, z = 81.0964}, - {x = -563.609, y = 267.962, z = 82.5116}, - {x = -486.806, y = 271.977, z = 82.8187}, - {x = 88.295, y = 250.867, z = 108.188}, - {x = 234.087, y = 344.678, z = 105.018}, - {x = 434.963, y = 96.707, z = 99.1713}, - {x = 482.617, y = -142.533, z = 58.1936}, - {x = 762.651, y = -786.55, z = 25.8915}, - {x = 809.06, y = -1290.8, z = 25.7946}, - {x = 490.819, y = -1751.37, z = 28.0987}, - {x = 432.351, y = -1856.11, z = 27.0352}, - {x = 164.348, y = -1734.54, z = 28.8982}, - {x = -57.6909, y = -1501.4, z = 31.1084}, - {x = 52.2241, y = -1566.65, z = 29.006}, - {x = 310.222, y = -1376.76, z = 31.4442}, - {x = 181.967, y = -1332.79, z = 28.8773}, - {x = -74.6091, y = -1100.64, z = 25.738}, - {x = -887.045, y = -2187.46, z = 8.13248}, - {x = -749.584, y = -2296.59, z = 12.4627}, - {x = -1064.83, y = -2560.66, z = 19.6811}, - {x = -1033.44, y = -2730.24, z = 19.6868}, - {x = -1018.67, y = -2732, z = 13.2687}, - {x = 797.354, y = -174.423, z = 72.708}, - {x = 508.156, y = -117.908, z = 60.78}, - {x = 159.458, y = -27.555, z = 67.38}, - {x = -36.382, y = -106.912, z = 56.982}, - {x = -355.801, y = -270.404, z = 33.011}, - {x = -831.196, y = -76.871, z = 37.323}, - {x = -1038.707, y = -214.593, z = 37}, - {x = 1918.448, y = 3691.41, z = 32.261}, - {x = 1820.217, y = 3697.115, z = 33.493}, - {x = 1619.323, y = 3827.162, z = 34.482}, - {x = 1418.628, y = 3602.243, z = 34.511}, - {x = 1944.858, y = 3856.252, z = 31.741}, - {x = 2285.278, y = 3839.444, z = 34.023}, - {x = 2760.945, y = 3387.813, z = 55.659}, - {x = 1952.819, y = 2627.731, z = 45.368}, - {x = 1051.414, y = 474.833, z = 93.653}, - {x = 866.393, y = 17.635, z = 78.654}, - {x = 318.985, y = 167.41, z = 103.335}, - {x = 88.836, y = 254.054, z = 108.236}, - {x = -44.852, y = 70.414, z = 72.437}, - {x = -115.496, y = 84.333, z = 70.792}, - {x = -384.806, y = 226.868, z = 83.548}, - {x = -578.669, y = 139.085, z = 61.337}, - {x = -651.334, y = -584.879, z = 34.116}, - {x = -571.847, y = -1195.648, z = 17.869}, - {x = -1513.271, y = -670.039, z = 28.362}, - {x = -1297.484, y = -654.913, z = 26.123}, - {x = -1645.546, y = 144.571, z = 61.664}, - {x = -1160.618, y = 744.418, z = 154.571}, - {x = -798.09, y = 831.699, z = 204.351}, + {x = 293.476, y = -590.163, z = 42.7371}, + {x = 253.404, y = -375.86, z = 44.0819}, + {x = 120.808, y = -300.416, z = 45.1399}, + {x = -38.4132, y = -381.576, z = 38.3456}, + {x = -107.442, y = -614.377, z = 35.6703}, + {x = -252.292, y = -856.474, z = 30.5626}, + {x = -236.138, y = -988.382, z = 28.7749}, + {x = -276.989, y = -1061.18, z = 25.6853}, + {x = -576.451, y = -998.989, z = 21.785}, + {x = -602.798, y = -952.63, z = 21.6353}, + {x = -790.653, y = -961.855, z = 14.8932}, + {x = -912.588, y = -864.756, z = 15.0057}, + {x = -1069.77, y = -792.513, z = 18.8075}, + {x = -1306.94, y = -854.085, z = 15.0959}, + {x = -1468.51, y = -681.363, z = 26.178}, + {x = -1380.89, y = -452.7, z = 34.0843}, + {x = -1326.35, y = -394.81, z = 36.0632}, + {x = -1383.68, y = -269.985, z = 42.4878}, + {x = -1679.61, y = -457.339, z = 39.4048}, + {x = -1812.45, y = -416.917, z = 43.6734}, + {x = -2043.64, y = -268.291, z = 22.9927}, + {x = -2186.45, y = -421.595, z = 12.6776}, + {x = -1862.08, y = -586.528, z = 11.1747}, + {x = -1859.5, y = -617.563, z = 10.8788}, + {x = -1634.95, y = -988.302, z = 12.6241}, + {x = -1283.99, y = -1154.16, z = 5.30998}, + {x = -1126.47, y = -1338.08, z = 4.63434}, + {x = -867.907, y = -1159.67, z = 5.00795}, + {x = -847.55, y = -1141.38, z = 6.27591}, + {x = -722.625, y = -1144.6, z = 10.2176}, + {x = -575.503, y = -318.446, z = 34.5273}, + {x = -592.309, y = -224.853, z = 36.1209}, + {x = -559.594, y = -162.873, z = 37.7547}, + {x = -534.992, y = -65.6695, z = 40.634}, + {x = -758.234, y = -36.6906, z = 37.2911}, + {x = -1375.88, y = 20.9516, z = 53.2255}, + {x = -1320.25, y = -128.018, z = 48.097}, + {x = -1285.71, y = 294.287, z = 64.4619}, + {x = -1245.67, y = 386.533, z = 75.0908}, + {x = -760.355, y = 285.015, z = 85.0667}, + {x = -626.786, y = 254.146, z = 81.0964}, + {x = -563.609, y = 267.962, z = 82.5116}, + {x = -486.806, y = 271.977, z = 82.8187}, + {x = 88.295, y = 250.867, z = 108.188}, + {x = 234.087, y = 344.678, z = 105.018}, + {x = 434.963, y = 96.707, z = 99.1713}, + {x = 482.617, y = -142.533, z = 58.1936}, + {x = 762.651, y = -786.55, z = 25.8915}, + {x = 809.06, y = -1290.8, z = 25.7946}, + {x = 490.819, y = -1751.37, z = 28.0987}, + {x = 432.351, y = -1856.11, z = 27.0352}, + {x = 164.348, y = -1734.54, z = 28.8982}, + {x = -57.6909, y = -1501.4, z = 31.1084}, + {x = 52.2241, y = -1566.65, z = 29.006}, + {x = 310.222, y = -1376.76, z = 31.4442}, + {x = 181.967, y = -1332.79, z = 28.8773}, + {x = -74.6091, y = -1100.64, z = 25.738}, + {x = -887.045, y = -2187.46, z = 8.13248}, + {x = -749.584, y = -2296.59, z = 12.4627}, + {x = -1064.83, y = -2560.66, z = 19.6811}, + {x = -1033.44, y = -2730.24, z = 19.6868}, + {x = -1018.67, y = -2732, z = 13.2687}, + {x = 797.354, y = -174.423, z = 72.708}, + {x = 508.156, y = -117.908, z = 60.78}, + {x = 159.458, y = -27.555, z = 67.38}, + {x = -36.382, y = -106.912, z = 56.982}, + {x = -355.801, y = -270.404, z = 33.011}, + {x = -831.196, y = -76.871, z = 37.323}, + {x = -1038.707, y = -214.593, z = 37}, + {x = 1918.448, y = 3691.41, z = 32.261}, + {x = 1820.217, y = 3697.115, z = 33.493}, + {x = 1619.323, y = 3827.162, z = 34.482}, + {x = 1418.628, y = 3602.243, z = 34.511}, + {x = 1944.858, y = 3856.252, z = 31.741}, + {x = 2285.278, y = 3839.444, z = 34.023}, + {x = 2760.945, y = 3387.813, z = 55.659}, + {x = 1952.819, y = 2627.731, z = 45.368}, + {x = 1051.414, y = 474.833, z = 93.653}, + {x = 866.393, y = 17.635, z = 78.654}, + {x = 318.985, y = 167.41, z = 103.335}, + {x = 88.836, y = 254.054, z = 108.236}, + {x = -44.852, y = 70.414, z = 72.437}, + {x = -115.496, y = 84.333, z = 70.792}, + {x = -384.806, y = 226.868, z = 83.548}, + {x = -578.669, y = 139.085, z = 61.337}, + {x = -651.334, y = -584.879, z = 34.116}, + {x = -571.847, y = -1195.648, z = 17.869}, + {x = -1513.271, y = -670.039, z = 28.362}, + {x = -1297.484, y = -654.913, z = 26.123}, + {x = -1645.546, y = 144.571, z = 61.664}, + {x = -1160.618, y = 744.418, z = 154.571}, + {x = -798.09, y = 831.699, z = 204.351}, } diff --git a/locales/br.lua b/locales/br.lua index bcd578e0..41a539f3 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -1,32 +1,30 @@ Locales['br'] = { - - ['taking_service'] = 'Pegando serviço: ', - ['spawn_veh'] = 'pegar veículo', - ['remove_comp_money'] = 'Remover dinheiro da empresa', - ['deposit_money'] = 'Depositar dinheiro', - ['launder_money'] = 'Lavar dinheiro', - ['full_service'] = 'Serviço completo: ', - ['withdraw_amount'] = 'Valor do saque', - ['amount_invalid'] = 'Valor inválido', - ['deposit_amount'] = 'Valor para deposito', - ['launder_amount'] = 'Valor para lavagem', - ['press_to_open'] = 'Pressione ~INPUT_CONTEXT~ para acessar o menu', - ['billing'] = 'Faturamento', - ['invoice_amount'] = 'Valor da fatura', - ['no_players_near'] = 'Nenhum jogador nas proximidades', - ['store_veh'] = 'Pressione ~INPUT_CONTEXT~ para guardar o veículo', - ['drive_search_pass'] = 'Dirigindo em busca de ~y~passageiros', - ['customer_found'] = 'Você ~g~encontrou~s~ um passageiro, dirija até o destino', - ['client_unconcious'] = 'Seu passageiro está ~r~insconsciente~w~. Procure por outro.', - ['arrive_dest'] = 'Você ~g~chegou~s~ ao seu destino', - ['take_me_to_near'] = '~w~Leve me para~y~ %s~w~, perto~y~ %s', - ['take_me_to'] = '~w~Leve me para~y~ %s', - ['close_to_client'] = 'Você está perto do passageiro, aproximisse dele', - ['return_to_veh'] = 'Volte para o seu veículo para continuar a missão', - ['only_taxi'] = 'Você só pode guardar taxis.', - ['must_in_taxi'] = 'Você deve estar em um táxi para começar a missão', - ['must_in_vehicle'] = 'Você deve estar em um veículo para começar a missão', - ['have_earned'] = 'Você ganhou ~g~$', - ['comp_earned'] = 'Sua empresa ganhou ~g~$', - + ['taking_service'] = 'Pegando serviço: ', + ['spawn_veh'] = 'pegar veículo', + ['remove_comp_money'] = 'Remover dinheiro da empresa', + ['deposit_money'] = 'Depositar dinheiro', + ['launder_money'] = 'Lavar dinheiro', + ['full_service'] = 'Serviço completo: ', + ['withdraw_amount'] = 'Valor do saque', + ['amount_invalid'] = 'Valor inválido', + ['deposit_amount'] = 'Valor para deposito', + ['launder_amount'] = 'Valor para lavagem', + ['press_to_open'] = 'Pressione ~INPUT_CONTEXT~ para acessar o menu', + ['billing'] = 'Faturamento', + ['invoice_amount'] = 'Valor da fatura', + ['no_players_near'] = 'Nenhum jogador nas proximidades', + ['store_veh'] = 'Pressione ~INPUT_CONTEXT~ para guardar o veículo', + ['drive_search_pass'] = 'Dirigindo em busca de ~y~passageiros', + ['customer_found'] = 'Você ~g~encontrou~s~ um passageiro, dirija até o destino', + ['client_unconcious'] = 'Seu passageiro está ~r~insconsciente~w~. Procure por outro.', + ['arrive_dest'] = 'Você ~g~chegou~s~ ao seu destino', + ['take_me_to_near'] = '~w~Leve me para~y~ %s~w~, perto~y~ %s', + ['take_me_to'] = '~w~Leve me para~y~ %s', + ['close_to_client'] = 'Você está perto do passageiro, aproximisse dele', + ['return_to_veh'] = 'Volte para o seu veículo para continuar a missão', + ['only_taxi'] = 'Você só pode guardar taxis.', + ['must_in_taxi'] = 'Você deve estar em um táxi para começar a missão', + ['must_in_vehicle'] = 'Você deve estar em um veículo para começar a missão', + ['have_earned'] = 'Você ganhou ~g~$', + ['comp_earned'] = 'Sua empresa ganhou ~g~$', } diff --git a/locales/de.lua b/locales/de.lua index dbf231cd..7f9fd38e 100644 --- a/locales/de.lua +++ b/locales/de.lua @@ -1,32 +1,30 @@ Locales['de'] = { - - ['taking_service'] = 'Service annehmen: ', - ['spawn_veh'] = 'Fahrzeug spawnen', - ['remove_comp_money'] = 'Firmengeld abheben', - ['deposit_money'] = 'Geld einzahlen', - ['launder_money'] = 'Geld waschen', - ['full_service'] = 'Voller Service: ', - ['withdraw_amount'] = 'Betrag zum abheben', - ['amount_invalid'] = 'Betrag ungültig', - ['deposit_amount'] = 'Betrag zum einzahlen', - ['launder_amount'] = 'Betrag zum waschen', - ['press_to_open'] = 'Drücke ~INPUT_CONTEXT~ um das Menü zu öffnen', - ['billing'] = 'Rechnung', - ['invoice_amount'] = 'Rechnugsbetrag', - ['no_players_near'] = 'Kein Spieler in der Nähe', - ['store_veh'] = 'Drücke ~INPUT_CONTEXT~ um das Fahrzeug zu parken', - ['drive_search_pass'] = 'Auf der Suche nach ~y~Passagieren', - ['customer_found'] = 'du hast einen Passagier ~g~gefunden~s~ , Fahre in zum Ziel', - ['client_unconcious'] = 'dein Passagier ist ~r~bewusstlos~w~. Suche nach einem anderen.', - ['arrive_dest'] = 'du bist an deinem Ziel ~g~angekommen~s~', - ['take_me_to_near'] = '~w~Bring mich nach~y~ %s~w~, in der Nähe von~y~ %s', - ['take_me_to'] = '~w~Bring mich nach~y~ %s', - ['close_to_client'] = 'du bist nahe an dem Passagier, du musst noch näher ran', - ['return_to_veh'] = 'bitte kehre zu deinem Fahezeug zurück umd die Mission fortzuführen', - ['only_taxi'] = 'Du kannst nur Taxis parken.', - ['must_in_taxi'] = 'Du musst in einem Taxis sein umd die Mission starten zu können', - ['must_in_vehicle'] = 'Du musst in einem Fahrzeug sein um die Mission starten zu können', - ['have_earned'] = 'verdient ~g~$', - ['comp_earned'] = 'Die Firma verdient ~g~$', - + ['taking_service'] = 'Service annehmen: ', + ['spawn_veh'] = 'Fahrzeug spawnen', + ['remove_comp_money'] = 'Firmengeld abheben', + ['deposit_money'] = 'Geld einzahlen', + ['launder_money'] = 'Geld waschen', + ['full_service'] = 'Voller Service: ', + ['withdraw_amount'] = 'Betrag zum abheben', + ['amount_invalid'] = 'Betrag ungültig', + ['deposit_amount'] = 'Betrag zum einzahlen', + ['launder_amount'] = 'Betrag zum waschen', + ['press_to_open'] = 'Drücke ~INPUT_CONTEXT~ um das Menü zu öffnen', + ['billing'] = 'Rechnung', + ['invoice_amount'] = 'Rechnugsbetrag', + ['no_players_near'] = 'Kein Spieler in der Nähe', + ['store_veh'] = 'Drücke ~INPUT_CONTEXT~ um das Fahrzeug zu parken', + ['drive_search_pass'] = 'Auf der Suche nach ~y~Passagieren', + ['customer_found'] = 'du hast einen Passagier ~g~gefunden~s~ , Fahre in zum Ziel', + ['client_unconcious'] = 'dein Passagier ist ~r~bewusstlos~w~. Suche nach einem anderen.', + ['arrive_dest'] = 'du bist an deinem Ziel ~g~angekommen~s~', + ['take_me_to_near'] = '~w~Bring mich nach~y~ %s~w~, in der Nähe von~y~ %s', + ['take_me_to'] = '~w~Bring mich nach~y~ %s', + ['close_to_client'] = 'du bist nahe an dem Passagier, du musst noch näher ran', + ['return_to_veh'] = 'bitte kehre zu deinem Fahezeug zurück umd die Mission fortzuführen', + ['only_taxi'] = 'Du kannst nur Taxis parken.', + ['must_in_taxi'] = 'Du musst in einem Taxis sein umd die Mission starten zu können', + ['must_in_vehicle'] = 'Du musst in einem Fahrzeug sein um die Mission starten zu können', + ['have_earned'] = 'verdient ~g~$', + ['comp_earned'] = 'Die Firma verdient ~g~$', } diff --git a/locales/en.lua b/locales/en.lua index 74eccd5d..12d051cf 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -1,42 +1,40 @@ Locales['en'] = { - - ['taking_service'] = 'taking service: ', - ['spawn_veh'] = 'spawn vehicle', - ['remove_comp_money'] = 'remove company money', - ['deposit_money'] = 'deposit money', - ['launder_money'] = 'launder money', - ['full_service'] = 'full service: ', - ['withdraw_amount'] = 'amount of withdrawal', - ['amount_invalid'] = 'amount invalid', - ['deposit_amount'] = 'amount to deposit', - ['launder_amount'] = 'amount to launder', - ['press_to_open'] = 'press ~INPUT_CONTEXT~ to access the menu', - ['billing'] = 'billing', - ['invoice_amount'] = 'invoice amount', - ['no_players_near'] = 'no players nearby', - ['store_veh'] = 'press ~INPUT_CONTEXT~ to store the vehicle', - ['drive_search_pass'] = 'driving in search of ~y~passengers', - ['customer_found'] = 'you have ~g~found~s~ a customer, drive until last', - ['client_unconcious'] = 'your client is ~r~unconscious~w~. Look for another one.', - ['arrive_dest'] = 'you have ~g~arrived~s~ at your destination', - ['take_me_to_near'] = '~w~Take me to~y~ %s~w~, near~y~ %s', - ['take_me_to'] = '~w~Take me to~y~ %s', - ['close_to_client'] = 'you are close to the client, get close to them', - ['return_to_veh'] = 'please return to your vehicle to continue the mission', - ['only_taxi'] = 'you can only storee taxis.', - ['must_in_taxi'] = 'you must be in a taxi to start the mission', - ['must_in_vehicle'] = 'you must be in a vehicle to begin the mission', - ['have_earned'] = 'you have earned ~g~$', - ['comp_earned'] = 'your company has earned ~g~$', - ['deposit_stock'] = 'deposit Stock', - ['take_stock'] = 'take Stock', - ['boss_actions'] = 'boss Actions', - ['mission_complete'] = 'mission Completed', - ['quantity'] = 'quantity', - ['quantity_invalid'] = 'invalid Quantity', - ['inventory'] = 'inventory', - ['taxi_client'] = 'taxi Client', - ['have_withdrawn'] = 'you have withdrawn x', - ['added'] = 'you added x', - + ['taking_service'] = 'taking service: ', + ['spawn_veh'] = 'spawn vehicle', + ['remove_comp_money'] = 'remove company money', + ['deposit_money'] = 'deposit money', + ['launder_money'] = 'launder money', + ['full_service'] = 'full service: ', + ['withdraw_amount'] = 'amount of withdrawal', + ['amount_invalid'] = 'amount invalid', + ['deposit_amount'] = 'amount to deposit', + ['launder_amount'] = 'amount to launder', + ['press_to_open'] = 'press ~INPUT_CONTEXT~ to access the menu', + ['billing'] = 'billing', + ['invoice_amount'] = 'invoice amount', + ['no_players_near'] = 'no players nearby', + ['store_veh'] = 'press ~INPUT_CONTEXT~ to store the vehicle', + ['drive_search_pass'] = 'driving in search of ~y~passengers', + ['customer_found'] = 'you have ~g~found~s~ a customer, drive until last', + ['client_unconcious'] = 'your client is ~r~unconscious~w~. Look for another one.', + ['arrive_dest'] = 'you have ~g~arrived~s~ at your destination', + ['take_me_to_near'] = '~w~Take me to~y~ %s~w~, near~y~ %s', + ['take_me_to'] = '~w~Take me to~y~ %s', + ['close_to_client'] = 'you are close to the client, get close to them', + ['return_to_veh'] = 'please return to your vehicle to continue the mission', + ['only_taxi'] = 'you can only storee taxis.', + ['must_in_taxi'] = 'you must be in a taxi to start the mission', + ['must_in_vehicle'] = 'you must be in a vehicle to begin the mission', + ['have_earned'] = 'you have earned ~g~$', + ['comp_earned'] = 'your company has earned ~g~$', + ['deposit_stock'] = 'deposit Stock', + ['take_stock'] = 'take Stock', + ['boss_actions'] = 'boss Actions', + ['mission_complete'] = 'mission Completed', + ['quantity'] = 'quantity', + ['quantity_invalid'] = 'invalid Quantity', + ['inventory'] = 'inventory', + ['taxi_client'] = 'taxi Client', + ['have_withdrawn'] = 'you have withdrawn x', + ['added'] = 'you added x', } diff --git a/locales/fr.lua b/locales/fr.lua index fe238144..88f524df 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -1,42 +1,40 @@ Locales['fr'] = { - - ['taking_service'] = 'prise de service : ', - ['spawn_veh'] = 'sortir véhicule', - ['remove_comp_money'] = 'retirer argent société', - ['deposit_money'] = 'déposer argent', - ['launder_money'] = 'blanchir argent', - ['full_service'] = 'service complet : ', - ['withdraw_amount'] = 'montant du retrait', - ['amount_invalid'] = 'montant invalide', - ['deposit_amount'] = 'montant du dépôt', - ['launder_amount'] = 'montant à blanchir', - ['press_to_open'] = 'appuyez sur ~INPUT_CONTEXT~ pour accéder au menu', - ['billing'] = 'facuration', - ['invoice_amount'] = 'montant de la facture', - ['no_players_near'] = 'aucun joueur à proximité', - ['store_veh'] = 'appuyez sur ~INPUT_CONTEXT~ pour ranger le véhicule', - ['drive_search_pass'] = 'conduisez à la recherche de ~y~passagers', - ['customer_found'] = 'vous avez ~g~trouvé~s~ un client, conduisez jusqu\'à ce dernier', - ['client_unconcious'] = 'votre client est ~r~inconscient~w~. Cherchez-en un autre.', - ['arrive_dest'] = 'vous êtes ~g~arrivé~s~ à destination', - ['take_me_to_near'] = '~w~Emmenez-moi à~y~ %s~w~, près de~y~ %s', - ['take_me_to'] = '~w~Emmenez-moi à~y~ %s', - ['close_to_client'] = 'vous êtes à proximité du client, approchez-vous de lui', - ['return_to_veh'] = 'veuillez remonter dans votre véhicule pour continuer la mission', - ['only_taxi'] = 'vous ne pouvez ranger que les taxi', - ['must_in_taxi'] = 'vous devez être dans un taxi pour commencer la mission', - ['must_in_vehicle'] = 'vous devez être dans un véhicule pour commencer la mission', - ['have_earned'] = 'vous avez gagné ~g~$', - ['comp_earned'] = 'votre société a gagné ~g~$', - ['deposit_stock'] = 'Déposer Stock', - ['take_stock'] = 'Prendre Stock', - ['boss_actions'] = 'action Patron', - ['mission_complete'] = 'Mission terminée', - ['quantity'] = 'Quantité', - ['quantity_invalid'] = 'Quantité invalide', - ['inventory'] = 'Inventaire', - ['taxi_client'] = 'client Taxi', - ['have_withdrawn'] = 'Vous avez retiré x', - ['added'] = 'Vous avez ajouté x', - + ['taking_service'] = 'prise de service : ', + ['spawn_veh'] = 'sortir véhicule', + ['remove_comp_money'] = 'retirer argent société', + ['deposit_money'] = 'déposer argent', + ['launder_money'] = 'blanchir argent', + ['full_service'] = 'service complet : ', + ['withdraw_amount'] = 'montant du retrait', + ['amount_invalid'] = 'montant invalide', + ['deposit_amount'] = 'montant du dépôt', + ['launder_amount'] = 'montant à blanchir', + ['press_to_open'] = 'appuyez sur ~INPUT_CONTEXT~ pour accéder au menu', + ['billing'] = 'facuration', + ['invoice_amount'] = 'montant de la facture', + ['no_players_near'] = 'aucun joueur à proximité', + ['store_veh'] = 'appuyez sur ~INPUT_CONTEXT~ pour ranger le véhicule', + ['drive_search_pass'] = 'conduisez à la recherche de ~y~passagers', + ['customer_found'] = 'vous avez ~g~trouvé~s~ un client, conduisez jusqu\'à ce dernier', + ['client_unconcious'] = 'votre client est ~r~inconscient~w~. Cherchez-en un autre.', + ['arrive_dest'] = 'vous êtes ~g~arrivé~s~ à destination', + ['take_me_to_near'] = '~w~Emmenez-moi à~y~ %s~w~, près de~y~ %s', + ['take_me_to'] = '~w~Emmenez-moi à~y~ %s', + ['close_to_client'] = 'vous êtes à proximité du client, approchez-vous de lui', + ['return_to_veh'] = 'veuillez remonter dans votre véhicule pour continuer la mission', + ['only_taxi'] = 'vous ne pouvez ranger que les taxi', + ['must_in_taxi'] = 'vous devez être dans un taxi pour commencer la mission', + ['must_in_vehicle'] = 'vous devez être dans un véhicule pour commencer la mission', + ['have_earned'] = 'vous avez gagné ~g~$', + ['comp_earned'] = 'votre société a gagné ~g~$', + ['deposit_stock'] = 'Déposer Stock', + ['take_stock'] = 'Prendre Stock', + ['boss_actions'] = 'action Patron', + ['mission_complete'] = 'Mission terminée', + ['quantity'] = 'Quantité', + ['quantity_invalid'] = 'Quantité invalide', + ['inventory'] = 'Inventaire', + ['taxi_client'] = 'client Taxi', + ['have_withdrawn'] = 'Vous avez retiré x', + ['added'] = 'Vous avez ajouté x', } diff --git a/localization/de_config.lua b/localization/de_config.lua index eb2f05ce..3ceb4f63 100644 --- a/localization/de_config.lua +++ b/localization/de_config.lua @@ -7,119 +7,119 @@ Config.Locale = 'de' Config.Zones = { - TaxiActions = { - Pos = {x = 915.039, y = -162.187, z = 73.684}, - Size = {x = 1.5, y = 1.5, z = 1.0}, - Color = {r = 204, g = 204, b = 0}, - Type = 1 - }, + TaxiActions = { + Pos = {x = 915.039, y = -162.187, z = 73.684}, + Size = {x = 1.5, y = 1.5, z = 1.0}, + Color = {r = 204, g = 204, b = 0}, + Type = 1 + }, - VehicleSpawnPoint = { - Pos = {x = 911.108, y = -177.867, z = 74.283}, - Size = {x = 1.5, y = 1.5, z = 1.0}, - Type = -1 - }, + VehicleSpawnPoint = { + Pos = {x = 911.108, y = -177.867, z = 74.283}, + Size = {x = 1.5, y = 1.5, z = 1.0}, + Type = -1 + }, - VehicleDeleter = { - Pos = {x = 908.317, y = -183.070, z = 73.201}, - Size = {x = 3.0, y = 3.0, z = 1.0}, - Color = {r = 204, g = 204, b = 0}, - Type = 1 - } + VehicleDeleter = { + Pos = {x = 908.317, y = -183.070, z = 73.201}, + Size = {x = 3.0, y = 3.0, z = 1.0}, + Color = {r = 204, g = 204, b = 0}, + Type = 1 + } } Config.JobLocations = { - {x = 293.476, y = -590.163, z = 42.7371}, - {x = 253.404, y = -375.86, z = 44.0819}, - {x = 120.808, y = -300.416, z = 45.1399}, - {x = -38.4132, y = -381.576, z = 38.3456}, - {x = -107.442, y = -614.377, z = 35.6703}, - {x = -252.292, y = -856.474, z = 30.5626}, - {x = -236.138, y = -988.382, z = 28.7749}, - {x = -276.989, y = -1061.18, z = 25.6853}, - {x = -576.451, y = -998.989, z = 21.785}, - {x = -602.798, y = -952.63, z = 21.6353}, - {x = -790.653, y = -961.855, z = 14.8932}, - {x = -912.588, y = -864.756, z = 15.0057}, - {x = -1069.77, y = -792.513, z = 18.8075}, - {x = -1306.94, y = -854.085, z = 15.0959}, - {x = -1468.51, y = -681.363, z = 26.178}, - {x = -1380.89, y = -452.7, z = 34.0843}, - {x = -1326.35, y = -394.81, z = 36.0632}, - {x = -1383.68, y = -269.985, z = 42.4878}, - {x = -1679.61, y = -457.339, z = 39.4048}, - {x = -1812.45, y = -416.917, z = 43.6734}, - {x = -2043.64, y = -268.291, z = 22.9927}, - {x = -2186.45, y = -421.595, z = 12.6776}, - {x = -1862.08, y = -586.528, z = 11.1747}, - {x = -1859.5, y = -617.563, z = 10.8788}, - {x = -1634.95, y = -988.302, z = 12.6241}, - {x = -1283.99, y = -1154.16, z = 5.30998}, - {x = -1126.47, y = -1338.08, z = 4.63434}, - {x = -867.907, y = -1159.67, z = 5.00795}, - {x = -847.55, y = -1141.38, z = 6.27591}, - {x = -722.625, y = -1144.6, z = 10.2176}, - {x = -575.503, y = -318.446, z = 34.5273}, - {x = -592.309, y = -224.853, z = 36.1209}, - {x = -559.594, y = -162.873, z = 37.7547}, - {x = -534.992, y = -65.6695, z = 40.634}, - {x = -758.234, y = -36.6906, z = 37.2911}, - {x = -1375.88, y = 20.9516, z = 53.2255}, - {x = -1320.25, y = -128.018, z = 48.097}, - {x = -1285.71, y = 294.287, z = 64.4619}, - {x = -1245.67, y = 386.533, z = 75.0908}, - {x = -760.355, y = 285.015, z = 85.0667}, - {x = -626.786, y = 254.146, z = 81.0964}, - {x = -563.609, y = 267.962, z = 82.5116}, - {x = -486.806, y = 271.977, z = 82.8187}, - {x = 88.295, y = 250.867, z = 108.188}, - {x = 234.087, y = 344.678, z = 105.018}, - {x = 434.963, y = 96.707, z = 99.1713}, - {x = 482.617, y = -142.533, z = 58.1936}, - {x = 762.651, y = -786.55, z = 25.8915}, - {x = 809.06, y = -1290.8, z = 25.7946}, - {x = 490.819, y = -1751.37, z = 28.0987}, - {x = 432.351, y = -1856.11, z = 27.0352}, - {x = 164.348, y = -1734.54, z = 28.8982}, - {x = -57.6909, y = -1501.4, z = 31.1084}, - {x = 52.2241, y = -1566.65, z = 29.006}, - {x = 310.222, y = -1376.76, z = 31.4442}, - {x = 181.967, y = -1332.79, z = 28.8773}, - {x = -74.6091, y = -1100.64, z = 25.738}, - {x = -887.045, y = -2187.46, z = 8.13248}, - {x = -749.584, y = -2296.59, z = 12.4627}, - {x = -1064.83, y = -2560.66, z = 19.6811}, - {x = -1033.44, y = -2730.24, z = 19.6868}, - {x = -1018.67, y = -2732, z = 13.2687}, - {x = 797.354, y = -174.423, z = 72.708}, - {x = 508.156, y = -117.908, z = 60.78}, - {x = 159.458, y = -27.555, z = 67.38}, - {x = -36.382, y = -106.912, z = 56.982}, - {x = -355.801, y = -270.404, z = 33.011}, - {x = -831.196, y = -76.871, z = 37.323}, - {x = -1038.707, y = -214.593, z = 37}, - {x = 1918.448, y = 3691.41, z = 32.261}, - {x = 1820.217, y = 3697.115, z = 33.493}, - {x = 1619.323, y = 3827.162, z = 34.482}, - {x = 1418.628, y = 3602.243, z = 34.511}, - {x = 1944.858, y = 3856.252, z = 31.741}, - {x = 2285.278, y = 3839.444, z = 34.023}, - {x = 2760.945, y = 3387.813, z = 55.659}, - {x = 1952.819, y = 2627.731, z = 45.368}, - {x = 1051.414, y = 474.833, z = 93.653}, - {x = 866.393, y = 17.635, z = 78.654}, - {x = 318.985, y = 167.41, z = 103.335}, - {x = 88.836, y = 254.054, z = 108.236}, - {x = -44.852, y = 70.414, z = 72.437}, - {x = -115.496, y = 84.333, z = 70.792}, - {x = -384.806, y = 226.868, z = 83.548}, - {x = -578.669, y = 139.085, z = 61.337}, - {x = -651.334, y = -584.879, z = 34.116}, - {x = -571.847, y = -1195.648, z = 17.869}, - {x = -1513.271, y = -670.039, z = 28.362}, - {x = -1297.484, y = -654.913, z = 26.123}, - {x = -1645.546, y = 144.571, z = 61.664}, - {x = -1160.618, y = 744.418, z = 154.571}, - {x = -798.09, y = 831.699, z = 204.351}, + {x = 293.476, y = -590.163, z = 42.7371}, + {x = 253.404, y = -375.86, z = 44.0819}, + {x = 120.808, y = -300.416, z = 45.1399}, + {x = -38.4132, y = -381.576, z = 38.3456}, + {x = -107.442, y = -614.377, z = 35.6703}, + {x = -252.292, y = -856.474, z = 30.5626}, + {x = -236.138, y = -988.382, z = 28.7749}, + {x = -276.989, y = -1061.18, z = 25.6853}, + {x = -576.451, y = -998.989, z = 21.785}, + {x = -602.798, y = -952.63, z = 21.6353}, + {x = -790.653, y = -961.855, z = 14.8932}, + {x = -912.588, y = -864.756, z = 15.0057}, + {x = -1069.77, y = -792.513, z = 18.8075}, + {x = -1306.94, y = -854.085, z = 15.0959}, + {x = -1468.51, y = -681.363, z = 26.178}, + {x = -1380.89, y = -452.7, z = 34.0843}, + {x = -1326.35, y = -394.81, z = 36.0632}, + {x = -1383.68, y = -269.985, z = 42.4878}, + {x = -1679.61, y = -457.339, z = 39.4048}, + {x = -1812.45, y = -416.917, z = 43.6734}, + {x = -2043.64, y = -268.291, z = 22.9927}, + {x = -2186.45, y = -421.595, z = 12.6776}, + {x = -1862.08, y = -586.528, z = 11.1747}, + {x = -1859.5, y = -617.563, z = 10.8788}, + {x = -1634.95, y = -988.302, z = 12.6241}, + {x = -1283.99, y = -1154.16, z = 5.30998}, + {x = -1126.47, y = -1338.08, z = 4.63434}, + {x = -867.907, y = -1159.67, z = 5.00795}, + {x = -847.55, y = -1141.38, z = 6.27591}, + {x = -722.625, y = -1144.6, z = 10.2176}, + {x = -575.503, y = -318.446, z = 34.5273}, + {x = -592.309, y = -224.853, z = 36.1209}, + {x = -559.594, y = -162.873, z = 37.7547}, + {x = -534.992, y = -65.6695, z = 40.634}, + {x = -758.234, y = -36.6906, z = 37.2911}, + {x = -1375.88, y = 20.9516, z = 53.2255}, + {x = -1320.25, y = -128.018, z = 48.097}, + {x = -1285.71, y = 294.287, z = 64.4619}, + {x = -1245.67, y = 386.533, z = 75.0908}, + {x = -760.355, y = 285.015, z = 85.0667}, + {x = -626.786, y = 254.146, z = 81.0964}, + {x = -563.609, y = 267.962, z = 82.5116}, + {x = -486.806, y = 271.977, z = 82.8187}, + {x = 88.295, y = 250.867, z = 108.188}, + {x = 234.087, y = 344.678, z = 105.018}, + {x = 434.963, y = 96.707, z = 99.1713}, + {x = 482.617, y = -142.533, z = 58.1936}, + {x = 762.651, y = -786.55, z = 25.8915}, + {x = 809.06, y = -1290.8, z = 25.7946}, + {x = 490.819, y = -1751.37, z = 28.0987}, + {x = 432.351, y = -1856.11, z = 27.0352}, + {x = 164.348, y = -1734.54, z = 28.8982}, + {x = -57.6909, y = -1501.4, z = 31.1084}, + {x = 52.2241, y = -1566.65, z = 29.006}, + {x = 310.222, y = -1376.76, z = 31.4442}, + {x = 181.967, y = -1332.79, z = 28.8773}, + {x = -74.6091, y = -1100.64, z = 25.738}, + {x = -887.045, y = -2187.46, z = 8.13248}, + {x = -749.584, y = -2296.59, z = 12.4627}, + {x = -1064.83, y = -2560.66, z = 19.6811}, + {x = -1033.44, y = -2730.24, z = 19.6868}, + {x = -1018.67, y = -2732, z = 13.2687}, + {x = 797.354, y = -174.423, z = 72.708}, + {x = 508.156, y = -117.908, z = 60.78}, + {x = 159.458, y = -27.555, z = 67.38}, + {x = -36.382, y = -106.912, z = 56.982}, + {x = -355.801, y = -270.404, z = 33.011}, + {x = -831.196, y = -76.871, z = 37.323}, + {x = -1038.707, y = -214.593, z = 37}, + {x = 1918.448, y = 3691.41, z = 32.261}, + {x = 1820.217, y = 3697.115, z = 33.493}, + {x = 1619.323, y = 3827.162, z = 34.482}, + {x = 1418.628, y = 3602.243, z = 34.511}, + {x = 1944.858, y = 3856.252, z = 31.741}, + {x = 2285.278, y = 3839.444, z = 34.023}, + {x = 2760.945, y = 3387.813, z = 55.659}, + {x = 1952.819, y = 2627.731, z = 45.368}, + {x = 1051.414, y = 474.833, z = 93.653}, + {x = 866.393, y = 17.635, z = 78.654}, + {x = 318.985, y = 167.41, z = 103.335}, + {x = 88.836, y = 254.054, z = 108.236}, + {x = -44.852, y = 70.414, z = 72.437}, + {x = -115.496, y = 84.333, z = 70.792}, + {x = -384.806, y = 226.868, z = 83.548}, + {x = -578.669, y = 139.085, z = 61.337}, + {x = -651.334, y = -584.879, z = 34.116}, + {x = -571.847, y = -1195.648, z = 17.869}, + {x = -1513.271, y = -670.039, z = 28.362}, + {x = -1297.484, y = -654.913, z = 26.123}, + {x = -1645.546, y = 144.571, z = 61.664}, + {x = -1160.618, y = 744.418, z = 154.571}, + {x = -798.09, y = 831.699, z = 204.351}, } diff --git a/server/main.lua b/server/main.lua index d8fc9b1f..e8cd41b3 100644 --- a/server/main.lua +++ b/server/main.lua @@ -3,7 +3,7 @@ ESX = nil TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) if Config.MaxInService ~= -1 then - TriggerEvent('esx_service:activateService', 'taxi', Config.MaxInService) + TriggerEvent('esx_service:activateService', 'taxi', Config.MaxInService) end TriggerEvent('esx_phone:registerNumber', 'taxi', _U('taxi_client'), true, true) @@ -12,99 +12,99 @@ TriggerEvent('esx_society:registerSociety', 'taxi', 'Taxi', 'society_taxi', 'soc RegisterServerEvent('esx_taxijob:success') AddEventHandler('esx_taxijob:success', function() - math.randomseed(os.time()) + math.randomseed(os.time()) - local xPlayer = ESX.GetPlayerFromId(source) + local xPlayer = ESX.GetPlayerFromId(source) local total = math.random(Config.NPCJobEarnings.min, Config.NPCJobEarnings.max); local societyAccount = nil if xPlayer.job.grade >= 3 then - total = total * 2 + total = total * 2 end TriggerEvent('esx_addonaccount:getSharedAccount', 'society_taxi', function(account) - societyAccount = account + societyAccount = account end) if societyAccount ~= nil then - local playerMoney = math.floor(total / 100 * 30) - local societyMoney = math.floor(total / 100 * 70) + local playerMoney = math.floor(total / 100 * 30) + local societyMoney = math.floor(total / 100 * 70) - xPlayer.addMoney(playerMoney) - societyAccount.addMoney(societyMoney) + xPlayer.addMoney(playerMoney) + societyAccount.addMoney(societyMoney) - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('have_earned') .. playerMoney) - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('comp_earned') .. societyMoney) + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('have_earned') .. playerMoney) + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('comp_earned') .. societyMoney) - else + else - xPlayer.addMoney(total) - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('have_earned') .. total) + xPlayer.addMoney(total) + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('have_earned') .. total) - end + end end) RegisterServerEvent('esx_taxijob:getStockItem') AddEventHandler('esx_taxijob:getStockItem', function(itemName, count) - local xPlayer = ESX.GetPlayerFromId(source) + local xPlayer = ESX.GetPlayerFromId(source) - TriggerEvent('esx_addoninventory:getSharedInventory', 'society_taxi', function(inventory) + TriggerEvent('esx_addoninventory:getSharedInventory', 'society_taxi', 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('quantity_invalid')) - end + if item.count >= count then + inventory.removeItem(itemName, count) + xPlayer.addInventoryItem(itemName, count) + else + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('quantity_invalid')) + end - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('have_withdrawn') .. count .. ' ' .. item.label) + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('have_withdrawn') .. count .. ' ' .. item.label) - end) + end) end) ESX.RegisterServerCallback('esx_taxijob:getStockItems', function(source, cb) - TriggerEvent('esx_addoninventory:getSharedInventory', 'society_taxi', function(inventory) - cb(inventory.items) - end) + TriggerEvent('esx_addoninventory:getSharedInventory', 'society_taxi', function(inventory) + cb(inventory.items) + end) end) RegisterServerEvent('esx_taxijob:putStockItems') AddEventHandler('esx_taxijob:putStockItems', function(itemName, count) - local xPlayer = ESX.GetPlayerFromId(source) + local xPlayer = ESX.GetPlayerFromId(source) - TriggerEvent('esx_addoninventory:getSharedInventory', 'society_taxi', function(inventory) + TriggerEvent('esx_addoninventory:getSharedInventory', 'society_taxi', 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('quantity_invalid')) - end + if item.count >= 0 then + xPlayer.removeInventoryItem(itemName, count) + inventory.addItem(itemName, count) + else + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('quantity_invalid')) + end - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('added') .. count .. ' ' .. item.label) + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('added') .. count .. ' ' .. item.label) - end) + end) end) ESX.RegisterServerCallback('esx_taxijob: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) \ No newline at end of file +end) From 3eb7d27761006ecd1615be52f0a5aab2ec4cd1c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Thu, 14 Sep 2017 21:16:56 +0200 Subject: [PATCH 39/93] Fix crash when searching npc --- client/main.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/client/main.lua b/client/main.lua index 09877334..861b4eaf 100644 --- a/client/main.lua +++ b/client/main.lua @@ -71,16 +71,20 @@ function GetRandomWalkingNPC() print('Using fallback code to find walking ped') - while true do + for i=1, 250, 1 do local ped = GetRandomPedAtCoord(0.0, 0.0, 0.0, math.huge + 0.0, math.huge + 0.0, math.huge + 0.0, 26) if DoesEntityExist(ped) and IsPedHuman(ped) and IsPedWalking(ped) and not IsPedAPlayer(ped) then - return ped + table.insert(search, ped) end end + if #search > 0 then + return search[GetRandomIntInRange(1, #search)] + end + end function ClearCurrentMission() From 67b173d8a1a8fdf5aa2ea65a405b8b1b813930d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Thu, 14 Sep 2017 23:18:50 +0200 Subject: [PATCH 40/93] Update LICENSE.txt --- LICENSE.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/LICENSE.txt b/LICENSE.txt index 30ace6a8..4d837ce0 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -631,8 +631,8 @@ to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. - {one line to give the program's name and a brief idea of what it does.} - Copyright (C) {year} {name of author} + fxserver-esx_taxijob + Copyright (C) 2015 Jérémie N'gadi This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: - {project} Copyright (C) {year} {fullname} + fxserver-esx_taxijob Copyright (C) 2015 Jérémie N'gadi This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. From 7150e49a85f5a0bd729fedb1077a748bf1bba5d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Fri, 15 Sep 2017 15:32:56 +0200 Subject: [PATCH 41/93] chore(resource): Add version --- __resource.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/__resource.lua b/__resource.lua index 662fab57..a6f8d73f 100644 --- a/__resource.lua +++ b/__resource.lua @@ -2,6 +2,8 @@ resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' description 'ESX Taxi Job' +version '1.0.0' + client_scripts { '@es_extended/locale.lua', 'locales/de.lua', From a45530b5f1d26c11bccdb8a65480a3b8900de3dd Mon Sep 17 00:00:00 2001 From: Romain Lanz Date: Sat, 7 Oct 2017 17:44:54 +0200 Subject: [PATCH 42/93] fix(vehicle): delete the vehicle --- client/main.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/main.lua b/client/main.lua index 861b4eaf..4697bb39 100644 --- a/client/main.lua +++ b/client/main.lua @@ -466,11 +466,12 @@ AddEventHandler('esx_taxijob:hasEnteredMarker', function(zone) if zone == 'VehicleDeleter' then local playerPed = GetPlayerPed(-1) + local vehicle = GetVehiclePedIsIn(playerPed, false) if IsPedInAnyVehicle(playerPed, false) then CurrentAction = 'delete_vehicle' CurrentActionMsg = _U('store_veh') - CurrentActionData = {} + CurrentActionData = { vehicle = vehicle } end end From a336783cfcda8b9aa783b1a78b4147d0dd9b6865 Mon Sep 17 00:00:00 2001 From: Romain Lanz Date: Sat, 7 Oct 2017 17:46:12 +0200 Subject: [PATCH 43/93] chore: bump version --- __resource.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__resource.lua b/__resource.lua index a6f8d73f..42e2d08b 100644 --- a/__resource.lua +++ b/__resource.lua @@ -2,7 +2,7 @@ resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' description 'ESX Taxi Job' -version '1.0.0' +version '1.0.1' client_scripts { '@es_extended/locale.lua', From 555f1c8fac8ed5fe41005fe26cddda2c2d7896a5 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Mon, 30 Apr 2018 23:41:27 +0200 Subject: [PATCH 44/93] Fixed #9, fixed dead opening f6 menu, fixed restarting script, fixed exploit taking more than you can carry --- client/main.lua | 48 ++++--- config.lua | 224 ++++++++++++++++---------------- esx_taxijob.sql | 20 +-- locales/br.lua | 1 + locales/de.lua | 1 + locales/en.lua | 1 + locales/fr.lua | 1 + localization/de_config.lua | 125 ------------------ localization/de_esx_taxijob.sql | 20 +-- server/main.lua | 39 +++--- 10 files changed, 191 insertions(+), 289 deletions(-) delete mode 100644 localization/de_config.lua diff --git a/client/main.lua b/client/main.lua index 4697bb39..b4406f17 100644 --- a/client/main.lua +++ b/client/main.lua @@ -25,15 +25,19 @@ local IsNearCustomer = false local CustomerIsEnteringVehicle = false local CustomerEnteredVehicle = false local TargetCoords = nil +local IsDead = 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 + + Citizen.Wait(5000) + PlayerData = ESX.GetPlayerData() end) function DrawSub(msg, time) @@ -69,8 +73,6 @@ function GetRandomWalkingNPC() return search[GetRandomIntInRange(1, #search)] end - print('Using fallback code to find walking ped') - for i=1, 250, 1 do local ped = GetRandomPedAtCoord(0.0, 0.0, 0.0, math.huge + 0.0, math.huge + 0.0, math.huge + 0.0, 26) @@ -156,6 +158,7 @@ function OpenTaxiActionsMenu() 'default', GetCurrentResourceName(), 'taxi_actions', { title = 'Taxi', + align = 'top-left', elements = elements }, function(data, menu) @@ -185,7 +188,7 @@ function OpenTaxiActionsMenu() { title = _U('spawn_veh'), align = 'top-left', - elements = elements, + elements = elements }, function(data, menu) @@ -277,6 +280,7 @@ function OpenMobileTaxiActionsMenu() 'default', GetCurrentResourceName(), 'mobile_taxi_actions', { title = 'Taxi', + align = 'top-left', elements = { {label = _U('billing'), value = 'billing'} } @@ -329,9 +333,6 @@ end function OpenGetStocksMenu() ESX.TriggerServerCallback('esx_taxijob:getStockItems', function(items) - - print(json.encode(items)) - local elements = {} for i=1, #items, 1 do @@ -342,6 +343,7 @@ function OpenGetStocksMenu() 'default', GetCurrentResourceName(), 'stocks_menu', { title = 'Taxi Stock', + align = 'top-left', elements = elements }, function(data, menu) @@ -362,9 +364,10 @@ function OpenGetStocksMenu() else menu2.close() menu.close() - OpenGetStocksMenu() - TriggerServerEvent('esx_taxijob:getStockItem', itemName, count) + + Citizen.Wait(1000) + OpenGetStocksMenu() end end, @@ -403,6 +406,7 @@ function OpenPutStocksMenu() 'default', GetCurrentResourceName(), 'stocks_menu', { title = _U('inventory'), + align = 'top-left', elements = elements }, function(data, menu) @@ -423,9 +427,10 @@ function OpenPutStocksMenu() else menu2.close() menu.close() - OpenPutStocksMenu() - TriggerServerEvent('esx_taxijob:putStockItems', itemName, count) + + Citizen.Wait(1000) + OpenPutStocksMenu() end end, @@ -444,7 +449,6 @@ function OpenPutStocksMenu() end - RegisterNetEvent('esx:playerLoaded') AddEventHandler('esx:playerLoaded', function(xPlayer) PlayerData = xPlayer @@ -793,7 +797,7 @@ Citizen.CreateThread(function() AddTextComponentString(CurrentActionMsg) DisplayHelpTextFromStringLabel(0, 0, 1, -1) - if IsControlPressed(0, Keys['E']) and PlayerData.job ~= nil and PlayerData.job.name == 'taxi' and (GetGameTimer() - GUI.Time) > 300 then + if IsControlPressed(0, Keys['E']) and PlayerData.job ~= nil and PlayerData.job.name == 'taxi' and (GetGameTimer() - GUI.Time) > 300 then if CurrentAction == 'taxi_actions_menu' then OpenTaxiActionsMenu() @@ -825,12 +829,12 @@ Citizen.CreateThread(function() end - if IsControlPressed(0, Keys['F6']) and Config.EnablePlayerManagement and PlayerData.job ~= nil and PlayerData.job.name == 'taxi' and (GetGameTimer() - GUI.Time) > 150 then + if IsControlPressed(0, Keys['F6']) and not IsDead and Config.EnablePlayerManagement and PlayerData.job ~= nil and PlayerData.job.name == 'taxi' and (GetGameTimer() - GUI.Time) > 150 then OpenMobileTaxiActionsMenu() GUI.Time = GetGameTimer() end - if IsControlPressed(0, Keys['DELETE']) and (GetGameTimer() - GUI.Time) > 150 then + if IsControlPressed(0, Keys['DELETE']) and not IsDead and (GetGameTimer() - GUI.Time) > 150 then if OnJob then StopTaxiJob() @@ -874,3 +878,11 @@ Citizen.CreateThread(function() end end) + +AddEventHandler('esx:onPlayerDeath', function() + IsDead = true +end) + +AddEventHandler('playerSpawned', function(spawn) + IsDead = false +end) \ No newline at end of file diff --git a/config.lua b/config.lua index 3757e4df..967a3c24 100644 --- a/config.lua +++ b/config.lua @@ -1,126 +1,126 @@ Config = {} Config.DrawDistance = 100.0 Config.NPCJobEarnings = {min = 15, max = 40} -Config.MaxInService = 2 +Config.MaxInService = -1 Config.EnablePlayerManagement = false -Config.EnableSocietyOwnedVehicles = true -Config.Locale = 'fr' +Config.EnableSocietyOwnedVehicles = false +Config.Locale = 'en' Config.Zones = { - TaxiActions = { - Pos = {x = 915.039, y = -162.187, z = 73.684}, - Size = {x = 1.5, y = 1.5, z = 1.0}, - Color = {r = 204, g = 204, b = 0}, - Type = 1 - }, + TaxiActions = { + Pos = {x = 915.039, y = -162.187, z = 73.684}, + Size = {x = 1.5, y = 1.5, z = 1.0}, + Color = {r = 204, g = 204, b = 0}, + Type = 1 + }, - VehicleSpawnPoint = { - Pos = {x = 911.108, y = -177.867, z = 74.283}, - Size = {x = 1.5, y = 1.5, z = 1.0}, - Type = -1 - }, + VehicleSpawnPoint = { + Pos = {x = 911.108, y = -177.867, z = 74.283}, + Size = {x = 1.5, y = 1.5, z = 1.0}, + Type = -1 + }, - VehicleDeleter = { - Pos = {x = 908.317, y = -183.070, z = 73.201}, - Size = {x = 3.0, y = 3.0, z = 1.0}, - Color = {r = 204, g = 204, b = 0}, - Type = 1 - } + VehicleDeleter = { + Pos = {x = 908.317, y = -183.070, z = 73.201}, + Size = {x = 3.0, y = 3.0, z = 1.0}, + Color = {r = 204, g = 204, b = 0}, + Type = 1 + } } Config.JobLocations = { - {x = 293.476, y = -590.163, z = 42.7371}, - {x = 253.404, y = -375.86, z = 44.0819}, - {x = 120.808, y = -300.416, z = 45.1399}, - {x = -38.4132, y = -381.576, z = 38.3456}, - {x = -107.442, y = -614.377, z = 35.6703}, - {x = -252.292, y = -856.474, z = 30.5626}, - {x = -236.138, y = -988.382, z = 28.7749}, - {x = -276.989, y = -1061.18, z = 25.6853}, - {x = -576.451, y = -998.989, z = 21.785}, - {x = -602.798, y = -952.63, z = 21.6353}, - {x = -790.653, y = -961.855, z = 14.8932}, - {x = -912.588, y = -864.756, z = 15.0057}, - {x = -1069.77, y = -792.513, z = 18.8075}, - {x = -1306.94, y = -854.085, z = 15.0959}, - {x = -1468.51, y = -681.363, z = 26.178}, - {x = -1380.89, y = -452.7, z = 34.0843}, - {x = -1326.35, y = -394.81, z = 36.0632}, - {x = -1383.68, y = -269.985, z = 42.4878}, - {x = -1679.61, y = -457.339, z = 39.4048}, - {x = -1812.45, y = -416.917, z = 43.6734}, - {x = -2043.64, y = -268.291, z = 22.9927}, - {x = -2186.45, y = -421.595, z = 12.6776}, - {x = -1862.08, y = -586.528, z = 11.1747}, - {x = -1859.5, y = -617.563, z = 10.8788}, - {x = -1634.95, y = -988.302, z = 12.6241}, - {x = -1283.99, y = -1154.16, z = 5.30998}, - {x = -1126.47, y = -1338.08, z = 4.63434}, - {x = -867.907, y = -1159.67, z = 5.00795}, - {x = -847.55, y = -1141.38, z = 6.27591}, - {x = -722.625, y = -1144.6, z = 10.2176}, - {x = -575.503, y = -318.446, z = 34.5273}, - {x = -592.309, y = -224.853, z = 36.1209}, - {x = -559.594, y = -162.873, z = 37.7547}, - {x = -534.992, y = -65.6695, z = 40.634}, - {x = -758.234, y = -36.6906, z = 37.2911}, - {x = -1375.88, y = 20.9516, z = 53.2255}, - {x = -1320.25, y = -128.018, z = 48.097}, - {x = -1285.71, y = 294.287, z = 64.4619}, - {x = -1245.67, y = 386.533, z = 75.0908}, - {x = -760.355, y = 285.015, z = 85.0667}, - {x = -626.786, y = 254.146, z = 81.0964}, - {x = -563.609, y = 267.962, z = 82.5116}, - {x = -486.806, y = 271.977, z = 82.8187}, - {x = 88.295, y = 250.867, z = 108.188}, - {x = 234.087, y = 344.678, z = 105.018}, - {x = 434.963, y = 96.707, z = 99.1713}, - {x = 482.617, y = -142.533, z = 58.1936}, - {x = 762.651, y = -786.55, z = 25.8915}, - {x = 809.06, y = -1290.8, z = 25.7946}, - {x = 490.819, y = -1751.37, z = 28.0987}, - {x = 432.351, y = -1856.11, z = 27.0352}, - {x = 164.348, y = -1734.54, z = 28.8982}, - {x = -57.6909, y = -1501.4, z = 31.1084}, - {x = 52.2241, y = -1566.65, z = 29.006}, - {x = 310.222, y = -1376.76, z = 31.4442}, - {x = 181.967, y = -1332.79, z = 28.8773}, - {x = -74.6091, y = -1100.64, z = 25.738}, - {x = -887.045, y = -2187.46, z = 8.13248}, - {x = -749.584, y = -2296.59, z = 12.4627}, - {x = -1064.83, y = -2560.66, z = 19.6811}, - {x = -1033.44, y = -2730.24, z = 19.6868}, - {x = -1018.67, y = -2732, z = 13.2687}, - {x = 797.354, y = -174.423, z = 72.708}, - {x = 508.156, y = -117.908, z = 60.78}, - {x = 159.458, y = -27.555, z = 67.38}, - {x = -36.382, y = -106.912, z = 56.982}, - {x = -355.801, y = -270.404, z = 33.011}, - {x = -831.196, y = -76.871, z = 37.323}, - {x = -1038.707, y = -214.593, z = 37}, - {x = 1918.448, y = 3691.41, z = 32.261}, - {x = 1820.217, y = 3697.115, z = 33.493}, - {x = 1619.323, y = 3827.162, z = 34.482}, - {x = 1418.628, y = 3602.243, z = 34.511}, - {x = 1944.858, y = 3856.252, z = 31.741}, - {x = 2285.278, y = 3839.444, z = 34.023}, - {x = 2760.945, y = 3387.813, z = 55.659}, - {x = 1952.819, y = 2627.731, z = 45.368}, - {x = 1051.414, y = 474.833, z = 93.653}, - {x = 866.393, y = 17.635, z = 78.654}, - {x = 318.985, y = 167.41, z = 103.335}, - {x = 88.836, y = 254.054, z = 108.236}, - {x = -44.852, y = 70.414, z = 72.437}, - {x = -115.496, y = 84.333, z = 70.792}, - {x = -384.806, y = 226.868, z = 83.548}, - {x = -578.669, y = 139.085, z = 61.337}, - {x = -651.334, y = -584.879, z = 34.116}, - {x = -571.847, y = -1195.648, z = 17.869}, - {x = -1513.271, y = -670.039, z = 28.362}, - {x = -1297.484, y = -654.913, z = 26.123}, - {x = -1645.546, y = 144.571, z = 61.664}, - {x = -1160.618, y = 744.418, z = 154.571}, - {x = -798.09, y = 831.699, z = 204.351}, + {x = 293.476, y = -590.163, z = 42.7371}, + {x = 253.404, y = -375.86, z = 44.0819}, + {x = 120.808, y = -300.416, z = 45.1399}, + {x = -38.4132, y = -381.576, z = 38.3456}, + {x = -107.442, y = -614.377, z = 35.6703}, + {x = -252.292, y = -856.474, z = 30.5626}, + {x = -236.138, y = -988.382, z = 28.7749}, + {x = -276.989, y = -1061.18, z = 25.6853}, + {x = -576.451, y = -998.989, z = 21.785}, + {x = -602.798, y = -952.63, z = 21.6353}, + {x = -790.653, y = -961.855, z = 14.8932}, + {x = -912.588, y = -864.756, z = 15.0057}, + {x = -1069.77, y = -792.513, z = 18.8075}, + {x = -1306.94, y = -854.085, z = 15.0959}, + {x = -1468.51, y = -681.363, z = 26.178}, + {x = -1380.89, y = -452.7, z = 34.0843}, + {x = -1326.35, y = -394.81, z = 36.0632}, + {x = -1383.68, y = -269.985, z = 42.4878}, + {x = -1679.61, y = -457.339, z = 39.4048}, + {x = -1812.45, y = -416.917, z = 43.6734}, + {x = -2043.64, y = -268.291, z = 22.9927}, + {x = -2186.45, y = -421.595, z = 12.6776}, + {x = -1862.08, y = -586.528, z = 11.1747}, + {x = -1859.5, y = -617.563, z = 10.8788}, + {x = -1634.95, y = -988.302, z = 12.6241}, + {x = -1283.99, y = -1154.16, z = 5.30998}, + {x = -1126.47, y = -1338.08, z = 4.63434}, + {x = -867.907, y = -1159.67, z = 5.00795}, + {x = -847.55, y = -1141.38, z = 6.27591}, + {x = -722.625, y = -1144.6, z = 10.2176}, + {x = -575.503, y = -318.446, z = 34.5273}, + {x = -592.309, y = -224.853, z = 36.1209}, + {x = -559.594, y = -162.873, z = 37.7547}, + {x = -534.992, y = -65.6695, z = 40.634}, + {x = -758.234, y = -36.6906, z = 37.2911}, + {x = -1375.88, y = 20.9516, z = 53.2255}, + {x = -1320.25, y = -128.018, z = 48.097}, + {x = -1285.71, y = 294.287, z = 64.4619}, + {x = -1245.67, y = 386.533, z = 75.0908}, + {x = -760.355, y = 285.015, z = 85.0667}, + {x = -626.786, y = 254.146, z = 81.0964}, + {x = -563.609, y = 267.962, z = 82.5116}, + {x = -486.806, y = 271.977, z = 82.8187}, + {x = 88.295, y = 250.867, z = 108.188}, + {x = 234.087, y = 344.678, z = 105.018}, + {x = 434.963, y = 96.707, z = 99.1713}, + {x = 482.617, y = -142.533, z = 58.1936}, + {x = 762.651, y = -786.55, z = 25.8915}, + {x = 809.06, y = -1290.8, z = 25.7946}, + {x = 490.819, y = -1751.37, z = 28.0987}, + {x = 432.351, y = -1856.11, z = 27.0352}, + {x = 164.348, y = -1734.54, z = 28.8982}, + {x = -57.6909, y = -1501.4, z = 31.1084}, + {x = 52.2241, y = -1566.65, z = 29.006}, + {x = 310.222, y = -1376.76, z = 31.4442}, + {x = 181.967, y = -1332.79, z = 28.8773}, + {x = -74.6091, y = -1100.64, z = 25.738}, + {x = -887.045, y = -2187.46, z = 8.13248}, + {x = -749.584, y = -2296.59, z = 12.4627}, + {x = -1064.83, y = -2560.66, z = 19.6811}, + {x = -1033.44, y = -2730.24, z = 19.6868}, + {x = -1018.67, y = -2732, z = 13.2687}, + {x = 797.354, y = -174.423, z = 72.708}, + {x = 508.156, y = -117.908, z = 60.78}, + {x = 159.458, y = -27.555, z = 67.38}, + {x = -36.382, y = -106.912, z = 56.982}, + {x = -355.801, y = -270.404, z = 33.011}, + {x = -831.196, y = -76.871, z = 37.323}, + {x = -1038.707, y = -214.593, z = 37}, + {x = 1918.448, y = 3691.41, z = 32.261}, + {x = 1820.217, y = 3697.115, z = 33.493}, + {x = 1619.323, y = 3827.162, z = 34.482}, + {x = 1418.628, y = 3602.243, z = 34.511}, + {x = 1944.858, y = 3856.252, z = 31.741}, + {x = 2285.278, y = 3839.444, z = 34.023}, + {x = 2760.945, y = 3387.813, z = 55.659}, + {x = 1952.819, y = 2627.731, z = 45.368}, + {x = 1051.414, y = 474.833, z = 93.653}, + {x = 866.393, y = 17.635, z = 78.654}, + {x = 318.985, y = 167.41, z = 103.335}, + {x = 88.836, y = 254.054, z = 108.236}, + {x = -44.852, y = 70.414, z = 72.437}, + {x = -115.496, y = 84.333, z = 70.792}, + {x = -384.806, y = 226.868, z = 83.548}, + {x = -578.669, y = 139.085, z = 61.337}, + {x = -651.334, y = -584.879, z = 34.116}, + {x = -571.847, y = -1195.648, z = 17.869}, + {x = -1513.271, y = -670.039, z = 28.362}, + {x = -1297.484, y = -654.913, z = 26.123}, + {x = -1645.546, y = 144.571, z = 61.664}, + {x = -1160.618, y = 744.418, z = 154.571}, + {x = -798.09, y = 831.699, z = 204.351}, } diff --git a/esx_taxijob.sql b/esx_taxijob.sql index 8f3271d7..efa33acb 100644 --- a/esx_taxijob.sql +++ b/esx_taxijob.sql @@ -1,21 +1,25 @@ USE `essentialmode`; INSERT INTO `addon_account` (name, label, shared) VALUES - ('society_taxi','Taxi',1) + ('society_taxi', 'Taxi', 1) +; + +INSERT INTO `datastore` (name, label, shared) VALUES + ('society_taxi', 'Taxi', 1) ; INSERT INTO `addon_inventory` (name, label, shared) VALUES - ('society_taxi','Taxi',1) + ('society_taxi', 'Taxi', 1) ; INSERT INTO `jobs` (name, label) VALUES - ('taxi','Taxi') + ('taxi', 'Taxi') ; INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES - ('taxi',0,'recrue','Recrue',12,'{}','{}'), - ('taxi',1,'novice','Novice',24,'{}','{}'), - ('taxi',2,'experimente','Experimente',36,'{}','{}'), - ('taxi',3,'uber','Uber',48,'{}','{}'), - ('taxi',4,'boss','Patron',0,'{}','{}') + ('taxi',0,'recrue','Recrue',12,'{}','{}'), + ('taxi',1,'novice','Novice',24,'{}','{}'), + ('taxi',2,'experimente','Experimente',36,'{}','{}'), + ('taxi',3,'uber','Uber',48,'{}','{}'), + ('taxi',4,'boss','Patron',0,'{}','{}') ; diff --git a/locales/br.lua b/locales/br.lua index 41a539f3..71957680 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -27,4 +27,5 @@ Locales['br'] = { ['must_in_vehicle'] = 'Você deve estar em um veículo para começar a missão', ['have_earned'] = 'Você ganhou ~g~$', ['comp_earned'] = 'Sua empresa ganhou ~g~$', + ['player_cannot_hold'] = 'you do ~r~not~w~ have enough ~y~free space~w~ in your inventory!', } diff --git a/locales/de.lua b/locales/de.lua index 7f9fd38e..3568e468 100644 --- a/locales/de.lua +++ b/locales/de.lua @@ -27,4 +27,5 @@ Locales['de'] = { ['must_in_vehicle'] = 'Du musst in einem Fahrzeug sein um die Mission starten zu können', ['have_earned'] = 'verdient ~g~$', ['comp_earned'] = 'Die Firma verdient ~g~$', + ['player_cannot_hold'] = 'you do ~r~not~w~ have enough ~y~free space~w~ in your inventory!', } diff --git a/locales/en.lua b/locales/en.lua index 12d051cf..46e3b8a3 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -37,4 +37,5 @@ Locales['en'] = { ['taxi_client'] = 'taxi Client', ['have_withdrawn'] = 'you have withdrawn x', ['added'] = 'you added x', + ['player_cannot_hold'] = 'you do ~r~not~w~ have enough ~y~free space~w~ in your inventory!', } diff --git a/locales/fr.lua b/locales/fr.lua index 88f524df..515374e0 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -37,4 +37,5 @@ Locales['fr'] = { ['taxi_client'] = 'client Taxi', ['have_withdrawn'] = 'Vous avez retiré x', ['added'] = 'Vous avez ajouté x', + ['player_cannot_hold'] = 'you do ~r~not~w~ have enough ~y~free space~w~ in your inventory!', } diff --git a/localization/de_config.lua b/localization/de_config.lua deleted file mode 100644 index 3ceb4f63..00000000 --- a/localization/de_config.lua +++ /dev/null @@ -1,125 +0,0 @@ -Config = {} -Config.DrawDistance = 100.0 -Config.NPCJobEarnings = {min = 15, max = 40} -Config.MaxInService = 2 -Config.EnablePlayerManagement = false -Config.Locale = 'de' - -Config.Zones = { - - TaxiActions = { - Pos = {x = 915.039, y = -162.187, z = 73.684}, - Size = {x = 1.5, y = 1.5, z = 1.0}, - Color = {r = 204, g = 204, b = 0}, - Type = 1 - }, - - VehicleSpawnPoint = { - Pos = {x = 911.108, y = -177.867, z = 74.283}, - Size = {x = 1.5, y = 1.5, z = 1.0}, - Type = -1 - }, - - VehicleDeleter = { - Pos = {x = 908.317, y = -183.070, z = 73.201}, - Size = {x = 3.0, y = 3.0, z = 1.0}, - Color = {r = 204, g = 204, b = 0}, - Type = 1 - } - -} - -Config.JobLocations = { - {x = 293.476, y = -590.163, z = 42.7371}, - {x = 253.404, y = -375.86, z = 44.0819}, - {x = 120.808, y = -300.416, z = 45.1399}, - {x = -38.4132, y = -381.576, z = 38.3456}, - {x = -107.442, y = -614.377, z = 35.6703}, - {x = -252.292, y = -856.474, z = 30.5626}, - {x = -236.138, y = -988.382, z = 28.7749}, - {x = -276.989, y = -1061.18, z = 25.6853}, - {x = -576.451, y = -998.989, z = 21.785}, - {x = -602.798, y = -952.63, z = 21.6353}, - {x = -790.653, y = -961.855, z = 14.8932}, - {x = -912.588, y = -864.756, z = 15.0057}, - {x = -1069.77, y = -792.513, z = 18.8075}, - {x = -1306.94, y = -854.085, z = 15.0959}, - {x = -1468.51, y = -681.363, z = 26.178}, - {x = -1380.89, y = -452.7, z = 34.0843}, - {x = -1326.35, y = -394.81, z = 36.0632}, - {x = -1383.68, y = -269.985, z = 42.4878}, - {x = -1679.61, y = -457.339, z = 39.4048}, - {x = -1812.45, y = -416.917, z = 43.6734}, - {x = -2043.64, y = -268.291, z = 22.9927}, - {x = -2186.45, y = -421.595, z = 12.6776}, - {x = -1862.08, y = -586.528, z = 11.1747}, - {x = -1859.5, y = -617.563, z = 10.8788}, - {x = -1634.95, y = -988.302, z = 12.6241}, - {x = -1283.99, y = -1154.16, z = 5.30998}, - {x = -1126.47, y = -1338.08, z = 4.63434}, - {x = -867.907, y = -1159.67, z = 5.00795}, - {x = -847.55, y = -1141.38, z = 6.27591}, - {x = -722.625, y = -1144.6, z = 10.2176}, - {x = -575.503, y = -318.446, z = 34.5273}, - {x = -592.309, y = -224.853, z = 36.1209}, - {x = -559.594, y = -162.873, z = 37.7547}, - {x = -534.992, y = -65.6695, z = 40.634}, - {x = -758.234, y = -36.6906, z = 37.2911}, - {x = -1375.88, y = 20.9516, z = 53.2255}, - {x = -1320.25, y = -128.018, z = 48.097}, - {x = -1285.71, y = 294.287, z = 64.4619}, - {x = -1245.67, y = 386.533, z = 75.0908}, - {x = -760.355, y = 285.015, z = 85.0667}, - {x = -626.786, y = 254.146, z = 81.0964}, - {x = -563.609, y = 267.962, z = 82.5116}, - {x = -486.806, y = 271.977, z = 82.8187}, - {x = 88.295, y = 250.867, z = 108.188}, - {x = 234.087, y = 344.678, z = 105.018}, - {x = 434.963, y = 96.707, z = 99.1713}, - {x = 482.617, y = -142.533, z = 58.1936}, - {x = 762.651, y = -786.55, z = 25.8915}, - {x = 809.06, y = -1290.8, z = 25.7946}, - {x = 490.819, y = -1751.37, z = 28.0987}, - {x = 432.351, y = -1856.11, z = 27.0352}, - {x = 164.348, y = -1734.54, z = 28.8982}, - {x = -57.6909, y = -1501.4, z = 31.1084}, - {x = 52.2241, y = -1566.65, z = 29.006}, - {x = 310.222, y = -1376.76, z = 31.4442}, - {x = 181.967, y = -1332.79, z = 28.8773}, - {x = -74.6091, y = -1100.64, z = 25.738}, - {x = -887.045, y = -2187.46, z = 8.13248}, - {x = -749.584, y = -2296.59, z = 12.4627}, - {x = -1064.83, y = -2560.66, z = 19.6811}, - {x = -1033.44, y = -2730.24, z = 19.6868}, - {x = -1018.67, y = -2732, z = 13.2687}, - {x = 797.354, y = -174.423, z = 72.708}, - {x = 508.156, y = -117.908, z = 60.78}, - {x = 159.458, y = -27.555, z = 67.38}, - {x = -36.382, y = -106.912, z = 56.982}, - {x = -355.801, y = -270.404, z = 33.011}, - {x = -831.196, y = -76.871, z = 37.323}, - {x = -1038.707, y = -214.593, z = 37}, - {x = 1918.448, y = 3691.41, z = 32.261}, - {x = 1820.217, y = 3697.115, z = 33.493}, - {x = 1619.323, y = 3827.162, z = 34.482}, - {x = 1418.628, y = 3602.243, z = 34.511}, - {x = 1944.858, y = 3856.252, z = 31.741}, - {x = 2285.278, y = 3839.444, z = 34.023}, - {x = 2760.945, y = 3387.813, z = 55.659}, - {x = 1952.819, y = 2627.731, z = 45.368}, - {x = 1051.414, y = 474.833, z = 93.653}, - {x = 866.393, y = 17.635, z = 78.654}, - {x = 318.985, y = 167.41, z = 103.335}, - {x = 88.836, y = 254.054, z = 108.236}, - {x = -44.852, y = 70.414, z = 72.437}, - {x = -115.496, y = 84.333, z = 70.792}, - {x = -384.806, y = 226.868, z = 83.548}, - {x = -578.669, y = 139.085, z = 61.337}, - {x = -651.334, y = -584.879, z = 34.116}, - {x = -571.847, y = -1195.648, z = 17.869}, - {x = -1513.271, y = -670.039, z = 28.362}, - {x = -1297.484, y = -654.913, z = 26.123}, - {x = -1645.546, y = 144.571, z = 61.664}, - {x = -1160.618, y = 744.418, z = 154.571}, - {x = -798.09, y = 831.699, z = 204.351}, -} diff --git a/localization/de_esx_taxijob.sql b/localization/de_esx_taxijob.sql index dc4ba785..ed416e55 100644 --- a/localization/de_esx_taxijob.sql +++ b/localization/de_esx_taxijob.sql @@ -1,21 +1,25 @@ USE `essentialmode`; INSERT INTO `addon_account` (name, label, shared) VALUES - ('society_taxi','Taxi',1) + ('society_taxi', 'Taxi', 1) +; + +INSERT INTO `datastore` (name, label, shared) VALUES + ('society_taxi', 'Taxi', 1) ; INSERT INTO `addon_inventory` (name, label, shared) VALUES - ('society_taxi','Taxi',1) + ('society_taxi', 'Taxi', 1) ; INSERT INTO `jobs` (name, label) VALUES - ('taxi','Taxi') + ('taxi', 'Taxi') ; INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES - ('taxi',0,'recrue','Rekrut',12,'{}','{}'), - ('taxi',1,'novice','Anfänger',24,'{}','{}'), - ('taxi',2,'experimente','Experte',36,'{}','{}'), - ('taxi',3,'uber','Schichtführer',48,'{}','{}'), - ('taxi',4,'boss','Chef',0,'{}','{}') + ('taxi',0,'recrue','Rekrut',12,'{}','{}'), + ('taxi',1,'novice','Anfänger',24,'{}','{}'), + ('taxi',2,'experimente','Experte',36,'{}','{}'), + ('taxi',3,'uber','Schichtführer',48,'{}','{}'), + ('taxi',4,'boss','Chef',0,'{}','{}') ; diff --git a/server/main.lua b/server/main.lua index e8cd41b3..0fac5893 100644 --- a/server/main.lua +++ b/server/main.lua @@ -7,7 +7,7 @@ if Config.MaxInService ~= -1 then end TriggerEvent('esx_phone:registerNumber', 'taxi', _U('taxi_client'), true, true) -TriggerEvent('esx_society:registerSociety', 'taxi', 'Taxi', 'society_taxi', 'society_taxi', 'society_taxi', {type = 'private'}) +TriggerEvent('esx_society:registerSociety', 'taxi', 'Taxi', 'society_taxi', 'society_taxi', 'society_taxi', {type = 'public'}) RegisterServerEvent('esx_taxijob:success') AddEventHandler('esx_taxijob:success', function() @@ -48,24 +48,27 @@ end) RegisterServerEvent('esx_taxijob:getStockItem') AddEventHandler('esx_taxijob:getStockItem', function(itemName, count) + local xPlayer = ESX.GetPlayerFromId(source) + + TriggerEvent('esx_addoninventory:getSharedInventory', 'society_taxi', function(inventory) + local item = inventory.getItem(itemName) + local sourceItem = xPlayer.getInventoryItem(itemName) - local xPlayer = ESX.GetPlayerFromId(source) - - TriggerEvent('esx_addoninventory:getSharedInventory', 'society_taxi', function(inventory) - - 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('quantity_invalid')) - end - - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('have_withdrawn') .. count .. ' ' .. item.label) - - end) - + -- is there enough in the society? + if count > 0 and item.count >= count then + + -- can the player carry the said amount of x item? + if sourceItem.limit ~= -1 and (sourceItem.count + count) > sourceItem.limit then + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('player_cannot_hold')) + else + inventory.removeItem(itemName, count) + xPlayer.addInventoryItem(itemName, count) + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('have_withdrawn') .. count .. ' ' .. item.label) + end + else + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('quantity_invalid')) + end + end) end) ESX.RegisterServerCallback('esx_taxijob:getStockItems', function(source, cb) From ba93c3af9af7568bfa5f057d5681a7a9c337c6b5 Mon Sep 17 00:00:00 2001 From: AdrineX Date: Tue, 12 Jun 2018 23:38:18 +0300 Subject: [PATCH 45/93] Add Finnish lang... --- __resource.lua | 2 ++ locales/fi.lua | 41 +++++++++++++++++++++++++++++++++ localization/fi_esx_taxijob.sql | 25 ++++++++++++++++++++ 3 files changed, 68 insertions(+) create mode 100644 locales/fi.lua create mode 100644 localization/fi_esx_taxijob.sql diff --git a/__resource.lua b/__resource.lua index 42e2d08b..95011d91 100644 --- a/__resource.lua +++ b/__resource.lua @@ -9,6 +9,7 @@ client_scripts { 'locales/de.lua', 'locales/br.lua', 'locales/en.lua', + 'locales/fi.lua', 'locales/fr.lua', 'config.lua', 'client/main.lua' @@ -19,6 +20,7 @@ server_scripts { 'locales/de.lua', 'locales/br.lua', 'locales/en.lua', + 'locales/fi.lua', 'locales/fr.lua', 'config.lua', 'server/main.lua' diff --git a/locales/fi.lua b/locales/fi.lua new file mode 100644 index 00000000..3e195443 --- /dev/null +++ b/locales/fi.lua @@ -0,0 +1,41 @@ +Locales['fi'] = { + ['taking_service'] = 'Aloitetaan työ: ', + ['spawn_veh'] = 'spawnaa ajoneuvo', + ['remove_comp_money'] = 'Nosta yrityksen rahoja', + ['deposit_money'] = 'talleta rahaa', + ['launder_money'] = 'pese rahaa', + ['full_service'] = 'täysi palvelu: ', + ['withdraw_amount'] = 'noston summa', + ['amount_invalid'] = 'virheellinen summa', + ['deposit_amount'] = 'talletuksen summa', + ['launder_amount'] = 'pestävä määrä', + ['press_to_open'] = 'paina ~INPUT_CONTEXT~ avataksesi valikko', + ['billing'] = 'Laskutus', + ['invoice_amount'] = 'laskun määrä', + ['no_players_near'] = 'ei pelaajia lähellä', + ['store_veh'] = 'paina ~INPUT_CONTEXT~ laittaaksesi auto talliin', + ['drive_search_pass'] = 'Ajele ympäriinsä etsi uusia ~y~asiakkaita', + ['customer_found'] = 'Sinä ~g~löysit~s~ asiakkaan, aja lähemmäksi', + ['client_unconcious'] = 'Sinun asiakkaasi on ~r~tajuton~w~. Etsi uusi.', + ['arrive_dest'] = 'Sinä ~g~saavuit~s~ kohteeseen', + ['take_me_to_near'] = '~w~Vie minut ~y~ %s~w~, lähellä~y~ %s', + ['take_me_to'] = '~w~Vie minut~y~ %s', + ['close_to_client'] = 'Olet asiakkaan lähellä, mene lähemmäksi', + ['return_to_veh'] = 'Mene takaisin ajoneuvoon, jatkaaksesi töitä', + ['only_taxi'] = 'Voit vain tallettaa taxeja', + ['must_in_taxi'] = 'Sinun pitää olla taxissa että voit alottaa työn', + ['must_in_vehicle'] = 'Sinun pitää olla ajoneuvossa että voit alottaa työn', + ['have_earned'] = 'Sinä tienasit ~g~€', + ['comp_earned'] = 'Yrityksesi tienasi ~g~€', + ['deposit_stock'] = 'Talleta varastoon', + ['take_stock'] = 'ota varastosta', + ['boss_actions'] = 'pomon toiminnot', + ['mission_complete'] = 'tehtävä suoritettu', + ['quantity'] = 'määrä', + ['quantity_invalid'] = 'virheellinen Määrä', + ['inventory'] = 'reppu', + ['taxi_client'] = 'taxi Asiakas', + ['have_withdrawn'] = 'sinä otit x', + ['added'] = 'sinä laitoit x', + ['player_cannot_hold'] = 'sinulla ~r~ei ole~w~ enempää ~y~vapaata tilaa~w~ repussasi!', +} diff --git a/localization/fi_esx_taxijob.sql b/localization/fi_esx_taxijob.sql new file mode 100644 index 00000000..8a4bc1df --- /dev/null +++ b/localization/fi_esx_taxijob.sql @@ -0,0 +1,25 @@ +USE `essentialmode`; + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('society_taxi', 'Taxi', 1) +; + +INSERT INTO `datastore` (name, label, shared) VALUES + ('society_taxi', 'Taxi', 1) +; + +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('society_taxi', 'Taxi', 1) +; + +INSERT INTO `jobs` (name, label) VALUES + ('taxi', 'Taxi') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('taxi',0,'recrue','Harjottelija',12,'{}','{}'), + ('taxi',1,'novice','Alottelija',24,'{}','{}'), + ('taxi',2,'experimente','Kokenut',36,'{}','{}'), + ('taxi',3,'uber','Uber',48,'{}','{}'), + ('taxi',4,'boss','Pomo',0,'{}','{}') +; From a82f6269e9d51025f544479f4f69bb490f9e56eb Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sat, 23 Jun 2018 10:51:25 +0200 Subject: [PATCH 46/93] Correct native names, readme cleanup --- README.md | 46 +++++++++++++++++++++++++++++++++------------- __resource.lua | 32 +++++++++++++++++--------------- client/main.lua | 6 +++--- 3 files changed, 53 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 152a18f6..c1882150 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,47 @@ -# fxserver-esx_taxijob -FXServer ESX Taxi Job +# esx_taxijob -[REQUIREMENTS] +## Requirements * Auto mode - * esx_service => https://github.com/FXServer-ESX/fxserver-esx_service + * [esx_service](https://github.com/ESX-Org/esx_service) * Player management (billing and boss actions) - * esx_society => https://github.com/FXServer-ESX/fxserver-esx_society - * esx_billing => https://github.com/FXServer-ESX/fxserver-esx_billing + * [esx_society](https://github.com/ESX-Org/esx_society) + * [esx_billing](https://github.com/ESX-Org/esx_billing) -[INSTALLATION] +## Download & Installation -1) CD in your resources/[esx] folder -2) Clone the repository +### Using [fvm](https://github.com/qlaffont/fvm-installer) ``` -git clone https://github.com/FXServer-ESX/fxserver-esx_taxijob esx_taxijob +fvm install --save --folder=esx esx-org/esx_taxijob ``` -3) Import esx_taxijob.sql in your database -4) Add this in your server.cfg : +### Using Git +``` +cd resources +git clone https://github.com/ESX-Org/esx_taxijob [esx]/esx_taxijob +``` +### Manually +- Download https://github.com/ESX-Org/esx_taxijob/archive/master.zip +- Put it in the `[esx]` directory + +## Installation +- Import `esx_taxijob.sql` in your database +- If you want player management you have to set `Config.EnablePlayerManagement` to `true` in `config.lua` +- Add this to your `server.cfg`: ``` start esx_taxijob ``` -5) If you want player management you have to set Config.EnablePlayerManagement to true in config.lua + +# Legal +### License +esx_taxijob + +Copyright (C) 2015-2018 Jérémie N'gadi + +This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version. + +This program Is distributed In the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty Of MERCHANTABILITY Or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License For more details. + +You should have received a copy Of the GNU General Public License along with this program. If Not, see http://www.gnu.org/licenses/. diff --git a/__resource.lua b/__resource.lua index 42e2d08b..8c52762a 100644 --- a/__resource.lua +++ b/__resource.lua @@ -2,24 +2,26 @@ resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' description 'ESX Taxi Job' -version '1.0.1' +version '1.0.2' client_scripts { - '@es_extended/locale.lua', - 'locales/de.lua', - 'locales/br.lua', - 'locales/en.lua', - 'locales/fr.lua', - 'config.lua', - 'client/main.lua' + '@es_extended/locale.lua', + 'locales/de.lua', + 'locales/br.lua', + 'locales/en.lua', + 'locales/fr.lua', + 'config.lua', + 'client/main.lua' } server_scripts { - '@es_extended/locale.lua', - 'locales/de.lua', - 'locales/br.lua', - 'locales/en.lua', - 'locales/fr.lua', - 'config.lua', - 'server/main.lua' + '@es_extended/locale.lua', + 'locales/de.lua', + 'locales/br.lua', + 'locales/en.lua', + 'locales/fr.lua', + 'config.lua', + 'server/main.lua' } + +dependency 'es_extended' \ No newline at end of file diff --git a/client/main.lua b/client/main.lua index b4406f17..b265ae91 100644 --- a/client/main.lua +++ b/client/main.lua @@ -50,11 +50,11 @@ end function ShowLoadingPromt(msg, time, type) Citizen.CreateThread(function() Citizen.Wait(0) - N_0xaba17d7ce615adbf("STRING") + BeginTextCommandBusyString("STRING") AddTextComponentString(msg) - N_0xbd12f8228410d9b4(type) + EndTextCommandBusyString(type) Citizen.Wait(time) - N_0x10d373323e5b9c0d() + RemoveLoadingPrompt() end) end From 7df520f7cfd975f96669a94f74dd1f6298fc34ca Mon Sep 17 00:00:00 2001 From: MajorMarcin Date: Thu, 28 Jun 2018 19:25:15 +0200 Subject: [PATCH 47/93] pl translation --- locales/pl.lua | 41 +++++++++++++++++++++++++++++++++ localization/pl_esx_taxijob.sql | 25 ++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 locales/pl.lua create mode 100644 localization/pl_esx_taxijob.sql diff --git a/locales/pl.lua b/locales/pl.lua new file mode 100644 index 00000000..7d9feb70 --- /dev/null +++ b/locales/pl.lua @@ -0,0 +1,41 @@ +Locales['pl'] = { + ['taking_service'] = 'Przyjmowanie usługi: ', + ['spawn_veh'] = 'Sprowadź pojazd', + ['remove_comp_money'] = 'Usuń pieniądze firmy', + ['deposit_money'] = 'Zdeponuj pieniądze', + ['launder_money'] = 'Wypierz pieniądze', + ['full_service'] = 'Pełny serwis: ', + ['withdraw_amount'] = 'Wartość wypłaty', + ['amount_invalid'] = 'Wartość nieprawidłowa', + ['deposit_amount'] = 'Wartość do depozytu', + ['launder_amount'] = 'Wartość do wyprania', + ['press_to_open'] = 'Naciśnij ~INPUT_CONTEXT~ aby wejść do menu', + ['billing'] = 'Rachunek', + ['invoice_amount'] = 'Wartość należności', + ['no_players_near'] = 'Brak graczy w pobliżu', + ['store_veh'] = 'Naciśnij ~INPUT_CONTEXT~ aby zdać pojazd', + ['drive_search_pass'] = 'Jazda w poszukiwaniu ~y~pasażerów', + ['customer_found'] = '~g~Znalazłeś~s~ klienta, jedź do niego', + ['client_unconcious'] = 'Twój jest ~r~nieprzytomny xD~w~. Poszukaj innego.', + ['arrive_dest'] = '~g~Dojechałeś~s~ do celu', + ['take_me_to_near'] = '~w~Zabierz mnie do~y~ %s~w~, w pobliżu ~y~ %s', + ['take_me_to'] = '~w~Weź mnie do~y~ %s', + ['close_to_client'] = 'Jesteś blisko klienta, podjedź do niego bliżej', + ['return_to_veh'] = 'Proszę wróć do swojego pojazdu aby kontynuować misję', + ['only_taxi'] = 'Możesz przechowywać tylko taksówki.', + ['must_in_taxi'] = 'Musisz być w taksówce aby rozpocząć misję', + ['must_in_vehicle'] = 'Musisz być w pojeździe aby rozpocząć misję', + ['have_earned'] = 'Zarobiłeś ~g~$', + ['comp_earned'] = 'Twoja firma zarobiła ~g~$', + ['deposit_stock'] = 'Depozyt', + ['take_stock'] = 'Weź depozyt', + ['boss_actions'] = 'Akcje szefa', + ['mission_complete'] = 'Misja zakończona', + ['quantity'] = 'Ilość', + ['quantity_invalid'] = 'Nieprawidłowa ilość', + ['inventory'] = 'Ekwipunek', + ['taxi_client'] = 'Klient taksówki', + ['have_withdrawn'] = 'Wypłaciłeś x', + ['added'] = 'Dodałeś x', + ['player_cannot_hold'] = '~r~Nie~w~ masz wystarczająco ~y~wolnego miejsca~w~ w swoim ekwipunku!', +} diff --git a/localization/pl_esx_taxijob.sql b/localization/pl_esx_taxijob.sql new file mode 100644 index 00000000..a35d1acf --- /dev/null +++ b/localization/pl_esx_taxijob.sql @@ -0,0 +1,25 @@ +USE `essentialmode`; + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('society_taxi', 'Taxi', 1) +; + +INSERT INTO `datastore` (name, label, shared) VALUES + ('society_taxi', 'Taxi', 1) +; + +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('society_taxi', 'Taxi', 1) +; + +INSERT INTO `jobs` (name, label) VALUES + ('taxi', 'Taxi') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('taxi',0,'recrue','Tymczasowy',12,'{}','{}'), + ('taxi',1,'novice','Nowy',24,'{}','{}'), + ('taxi',2,'experimente','Etatowy',36,'{}','{}'), + ('taxi',3,'uber','Uber',48,'{}','{}'), + ('taxi',4,'boss','Właściciel',0,'{}','{}') +; From ba246473de3975d27005a03f9065884131ae1e97 Mon Sep 17 00:00:00 2001 From: MajorMarcin Date: Sat, 30 Jun 2018 18:58:51 +0200 Subject: [PATCH 48/93] fixed lower case --- locales/pl.lua | 78 +++++++++++++++++++++++++------------------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/locales/pl.lua b/locales/pl.lua index 7d9feb70..a0ff7c83 100644 --- a/locales/pl.lua +++ b/locales/pl.lua @@ -1,41 +1,41 @@ Locales['pl'] = { - ['taking_service'] = 'Przyjmowanie usługi: ', - ['spawn_veh'] = 'Sprowadź pojazd', - ['remove_comp_money'] = 'Usuń pieniądze firmy', - ['deposit_money'] = 'Zdeponuj pieniądze', - ['launder_money'] = 'Wypierz pieniądze', - ['full_service'] = 'Pełny serwis: ', - ['withdraw_amount'] = 'Wartość wypłaty', - ['amount_invalid'] = 'Wartość nieprawidłowa', - ['deposit_amount'] = 'Wartość do depozytu', - ['launder_amount'] = 'Wartość do wyprania', - ['press_to_open'] = 'Naciśnij ~INPUT_CONTEXT~ aby wejść do menu', - ['billing'] = 'Rachunek', - ['invoice_amount'] = 'Wartość należności', - ['no_players_near'] = 'Brak graczy w pobliżu', - ['store_veh'] = 'Naciśnij ~INPUT_CONTEXT~ aby zdać pojazd', - ['drive_search_pass'] = 'Jazda w poszukiwaniu ~y~pasażerów', - ['customer_found'] = '~g~Znalazłeś~s~ klienta, jedź do niego', - ['client_unconcious'] = 'Twój jest ~r~nieprzytomny xD~w~. Poszukaj innego.', - ['arrive_dest'] = '~g~Dojechałeś~s~ do celu', - ['take_me_to_near'] = '~w~Zabierz mnie do~y~ %s~w~, w pobliżu ~y~ %s', - ['take_me_to'] = '~w~Weź mnie do~y~ %s', - ['close_to_client'] = 'Jesteś blisko klienta, podjedź do niego bliżej', - ['return_to_veh'] = 'Proszę wróć do swojego pojazdu aby kontynuować misję', - ['only_taxi'] = 'Możesz przechowywać tylko taksówki.', - ['must_in_taxi'] = 'Musisz być w taksówce aby rozpocząć misję', - ['must_in_vehicle'] = 'Musisz być w pojeździe aby rozpocząć misję', - ['have_earned'] = 'Zarobiłeś ~g~$', - ['comp_earned'] = 'Twoja firma zarobiła ~g~$', - ['deposit_stock'] = 'Depozyt', - ['take_stock'] = 'Weź depozyt', - ['boss_actions'] = 'Akcje szefa', - ['mission_complete'] = 'Misja zakończona', - ['quantity'] = 'Ilość', - ['quantity_invalid'] = 'Nieprawidłowa ilość', - ['inventory'] = 'Ekwipunek', - ['taxi_client'] = 'Klient taksówki', - ['have_withdrawn'] = 'Wypłaciłeś x', - ['added'] = 'Dodałeś x', - ['player_cannot_hold'] = '~r~Nie~w~ masz wystarczająco ~y~wolnego miejsca~w~ w swoim ekwipunku!', + ['taking_service'] = 'przyjmowanie usługi: ', + ['spawn_veh'] = 'sprowadź pojazd', + ['remove_comp_money'] = 'usuń pieniądze firmy', + ['deposit_money'] = 'zdeponuj pieniądze', + ['launder_money'] = 'wypierz pieniądze', + ['full_service'] = 'pełny serwis: ', + ['withdraw_amount'] = 'wartość wypłaty', + ['amount_invalid'] = 'wartość nieprawidłowa', + ['deposit_amount'] = 'wartość do depozytu', + ['launder_amount'] = 'wartość do wyprania', + ['press_to_open'] = 'naciśnij ~INPUT_CONTEXT~ aby wejść do menu', + ['billing'] = 'rachunek', + ['invoice_amount'] = 'wartość należności', + ['no_players_near'] = 'brak graczy w pobliżu', + ['store_veh'] = 'naciśnij ~INPUT_CONTEXT~ aby zdać pojazd', + ['drive_search_pass'] = 'jazda w poszukiwaniu ~y~pasażerów', + ['customer_found'] = '~g~znalazłeś~s~ klienta, jedź do niego', + ['client_unconcious'] = 'twój jest ~r~nieprzytomny xD~w~. Poszukaj innego.', + ['arrive_dest'] = '~g~dojechałeś~s~ do celu', + ['take_me_to_near'] = '~w~zabierz mnie do~y~ %s~w~, w pobliżu ~y~ %s', + ['take_me_to'] = '~w~weź mnie do~y~ %s', + ['close_to_client'] = 'jesteś blisko klienta, podjedź do niego bliżej', + ['return_to_veh'] = 'proszę wróć do swojego pojazdu aby kontynuować misję', + ['only_taxi'] = 'możesz przechowywać tylko taksówki.', + ['must_in_taxi'] = 'musisz być w taksówce aby rozpocząć misję', + ['must_in_vehicle'] = 'musisz być w pojeździe aby rozpocząć misję', + ['have_earned'] = 'zarobiłeś ~g~$', + ['comp_earned'] = 'twoja firma zarobiła ~g~$', + ['deposit_stock'] = 'depozyt', + ['take_stock'] = 'weź depozyt', + ['boss_actions'] = 'akcje szefa', + ['mission_complete'] = 'misja zakończona', + ['quantity'] = 'ilość', + ['quantity_invalid'] = 'nieprawidłowa ilość', + ['inventory'] = 'wkwipunek', + ['taxi_client'] = 'klient taksówki', + ['have_withdrawn'] = 'wypłaciłeś x', + ['added'] = 'dodałeś x', + ['player_cannot_hold'] = '~r~nie~w~ masz wystarczająco ~y~wolnego miejsca~w~ w swoim ekwipunku!', } From da4275011d1f1b82b4496559941508e15e685e7d Mon Sep 17 00:00:00 2001 From: MajorMarcin Date: Thu, 5 Jul 2018 17:52:12 +0200 Subject: [PATCH 49/93] pl translation --- __resource.lua | 2 ++ locales/pl.lua | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/__resource.lua b/__resource.lua index 53f82092..51e9c9df 100644 --- a/__resource.lua +++ b/__resource.lua @@ -11,6 +11,7 @@ client_scripts { 'locales/en.lua', 'locales/fi.lua', 'locales/fr.lua', + 'locales/pl.lua', 'config.lua', 'client/main.lua' } @@ -22,6 +23,7 @@ server_scripts { 'locales/en.lua', 'locales/fi.lua', 'locales/fr.lua', + 'locales/pl.lua', 'config.lua', 'server/main.lua' } diff --git a/locales/pl.lua b/locales/pl.lua index a0ff7c83..f40f8b1e 100644 --- a/locales/pl.lua +++ b/locales/pl.lua @@ -15,11 +15,11 @@ Locales['pl'] = { ['no_players_near'] = 'brak graczy w pobliżu', ['store_veh'] = 'naciśnij ~INPUT_CONTEXT~ aby zdać pojazd', ['drive_search_pass'] = 'jazda w poszukiwaniu ~y~pasażerów', - ['customer_found'] = '~g~znalazłeś~s~ klienta, jedź do niego', + ['customer_found'] = '~g~Znalazłeś~s~ klienta, jedź do niego', ['client_unconcious'] = 'twój jest ~r~nieprzytomny xD~w~. Poszukaj innego.', - ['arrive_dest'] = '~g~dojechałeś~s~ do celu', - ['take_me_to_near'] = '~w~zabierz mnie do~y~ %s~w~, w pobliżu ~y~ %s', - ['take_me_to'] = '~w~weź mnie do~y~ %s', + ['arrive_dest'] = '~g~Dojechałeś~s~ do celu', + ['take_me_to_near'] = '~w~Zabierz mnie do~y~ %s~w~, w pobliżu ~y~ %s', + ['take_me_to'] = '~w~Weź mnie do~y~ %s', ['close_to_client'] = 'jesteś blisko klienta, podjedź do niego bliżej', ['return_to_veh'] = 'proszę wróć do swojego pojazdu aby kontynuować misję', ['only_taxi'] = 'możesz przechowywać tylko taksówki.', @@ -37,5 +37,5 @@ Locales['pl'] = { ['taxi_client'] = 'klient taksówki', ['have_withdrawn'] = 'wypłaciłeś x', ['added'] = 'dodałeś x', - ['player_cannot_hold'] = '~r~nie~w~ masz wystarczająco ~y~wolnego miejsca~w~ w swoim ekwipunku!', + ['player_cannot_hold'] = '~r~Nie~w~ masz wystarczająco ~y~wolnego miejsca~w~ w swoim ekwipunku!', } From 77d6818a5829e79755a77115d7d60a33a40db6b2 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Thu, 5 Jul 2018 18:09:16 +0200 Subject: [PATCH 50/93] Removed gui timer --- client/main.lua | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/client/main.lua b/client/main.lua index b265ae91..54e9a37a 100644 --- a/client/main.lua +++ b/client/main.lua @@ -11,7 +11,6 @@ local Keys = { } local PlayerData = {} -local GUI = {} local HasAlreadyEnteredMarker = false local LastZone = nil local CurrentAction = nil @@ -28,7 +27,6 @@ local TargetCoords = nil local IsDead = false ESX = nil -GUI.Time = 0 Citizen.CreateThread(function() while ESX == nil do @@ -797,7 +795,7 @@ Citizen.CreateThread(function() AddTextComponentString(CurrentActionMsg) DisplayHelpTextFromStringLabel(0, 0, 1, -1) - if IsControlPressed(0, Keys['E']) and PlayerData.job ~= nil and PlayerData.job.name == 'taxi' and (GetGameTimer() - GUI.Time) > 300 then + if IsControlJustReleased(0, Keys['E']) and PlayerData.job ~= nil and PlayerData.job.name == 'taxi' then if CurrentAction == 'taxi_actions_menu' then OpenTaxiActionsMenu() @@ -823,18 +821,16 @@ Citizen.CreateThread(function() end CurrentAction = nil - GUI.Time = GetGameTimer() end end - if IsControlPressed(0, Keys['F6']) and not IsDead and Config.EnablePlayerManagement and PlayerData.job ~= nil and PlayerData.job.name == 'taxi' and (GetGameTimer() - GUI.Time) > 150 then + if IsControlJustReleased(0, Keys['F6']) and not IsDead and Config.EnablePlayerManagement and PlayerData.job ~= nil and PlayerData.job.name == 'taxi' then OpenMobileTaxiActionsMenu() - GUI.Time = GetGameTimer() end - if IsControlPressed(0, Keys['DELETE']) and not IsDead and (GetGameTimer() - GUI.Time) > 150 then + if IsControlJustReleased(0, Keys['DELETE']) and not IsDead then if OnJob then StopTaxiJob() @@ -846,7 +842,7 @@ Citizen.CreateThread(function() if IsPedInAnyVehicle(playerPed, false) then - local vehicle = GetVehiclePedIsIn(playerPed, false) + local vehicle = GetVehiclePedIsIn(playerPed, false) if PlayerData.job.grade >= 3 then StartTaxiJob() @@ -872,8 +868,6 @@ Citizen.CreateThread(function() end - GUI.Time = GetGameTimer() - end end From 2cab765936773f9c4c2e53c6a730e5a63aaae0d0 Mon Sep 17 00:00:00 2001 From: nearbyplayer Date: Wed, 8 Aug 2018 20:34:14 -0400 Subject: [PATCH 51/93] Add Localized SQL (EN) --- localization/en_esx_taxijob.sql | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 localization/en_esx_taxijob.sql diff --git a/localization/en_esx_taxijob.sql b/localization/en_esx_taxijob.sql new file mode 100644 index 00000000..a904b26b --- /dev/null +++ b/localization/en_esx_taxijob.sql @@ -0,0 +1,25 @@ +USE `essentialmode`; + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('society_taxi', 'Taxi', 1) +; + +INSERT INTO `datastore` (name, label, shared) VALUES + ('society_taxi', 'Taxi', 1) +; + +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('society_taxi', 'Taxi', 1) +; + +INSERT INTO `jobs` (name, label) VALUES + ('taxi', 'Taxi') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('taxi',0,'recrue','Recruit',12,'{}','{}'), + ('taxi',1,'novice','Cabby',24,'{}','{}'), + ('taxi',2,'experimente','Experienced',36,'{}','{}'), + ('taxi',3,'uber','Uber Cabby',48,'{}','{}'), + ('taxi',4,'boss','Lead Cabby',0,'{}','{}') +; From b1f9aedd2fca519460c895721eaddeebc309c294 Mon Sep 17 00:00:00 2001 From: nearbyplayer Date: Fri, 10 Aug 2018 00:56:10 -0400 Subject: [PATCH 52/93] Repo Update --- .editorconfig | 6 +++--- LICENSE.txt => LICENSE | 0 2 files changed, 3 insertions(+), 3 deletions(-) rename LICENSE.txt => LICENSE (100%) diff --git a/.editorconfig b/.editorconfig index 41c2aaf2..9b425256 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,9 +1,9 @@ root = true [*] -indent_size = 2 -indent_style = space -end_of_line = lf +indent_size = 4 +indent_style = tab +end_of_line = crlf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true \ No newline at end of file diff --git a/LICENSE.txt b/LICENSE similarity index 100% rename from LICENSE.txt rename to LICENSE From 0c00f1c6ea268a74c694dec4864a13bf0c8e6121 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sun, 12 Aug 2018 18:04:07 +0200 Subject: [PATCH 53/93] Swedish locale, locale improvements, you can only store taxis --- __resource.lua | 2 + client/main.lua | 149 ++++++++++++++++++++++-------------------------- locales/br.lua | 24 ++++---- locales/de.lua | 30 +++++----- locales/en.lua | 30 ++++------ locales/fi.lua | 22 +++---- locales/fr.lua | 16 ++---- locales/pl.lua | 22 +++---- locales/sv.lua | 35 ++++++++++++ server/main.lua | 91 +++++++++++++---------------- 10 files changed, 208 insertions(+), 213 deletions(-) create mode 100644 locales/sv.lua diff --git a/__resource.lua b/__resource.lua index 51e9c9df..90167455 100644 --- a/__resource.lua +++ b/__resource.lua @@ -12,6 +12,7 @@ client_scripts { 'locales/fi.lua', 'locales/fr.lua', 'locales/pl.lua', + 'locales/sv.lua', 'config.lua', 'client/main.lua' } @@ -24,6 +25,7 @@ server_scripts { 'locales/fi.lua', 'locales/fr.lua', 'locales/pl.lua', + 'locales/sv.lua', 'config.lua', 'server/main.lua' } diff --git a/client/main.lua b/client/main.lua index 54e9a37a..2b339ed5 100644 --- a/client/main.lua +++ b/client/main.lua @@ -117,25 +117,20 @@ function StartTaxiJob() end function StopTaxiJob() + local playerPed = GetPlayerPed(-1) - local playerPed = GetPlayerPed(-1) + if IsPedInAnyVehicle(playerPed, false) and CurrentCustomer ~= nil then + local vehicle = GetVehiclePedIsIn(playerPed, false) + TaskLeaveVehicle(CurrentCustomer, vehicle, 0) - if IsPedInAnyVehicle(playerPed, false) and CurrentCustomer ~= nil then - local vehicle = GetVehiclePedIsIn(playerPed, false) - TaskLeaveVehicle(CurrentCustomer, vehicle, 0) - - if CustomerEnteredVehicle then - TaskGoStraightToCoord(CurrentCustomer, TargetCoords.x, TargetCoords.y, TargetCoords.z, 1.0, -1, 0.0, 0.0) - end - - end - - ClearCurrentMission() - - OnJob = false - - DrawSub(_U('mission_complete'), 5000) + if CustomerEnteredVehicle then + TaskGoStraightToCoord(CurrentCustomer, TargetCoords.x, TargetCoords.y, TargetCoords.z, 1.0, -1, 0.0, 0.0) + end + end + ClearCurrentMission() + OnJob = false + DrawSub(_U('mission_complete'), 5000) end function OpenTaxiActionsMenu() @@ -785,92 +780,84 @@ end) -- Key Controls Citizen.CreateThread(function() - while true do + while true do - Citizen.Wait(0) + Citizen.Wait(0) - if CurrentAction ~= nil then + if CurrentAction ~= nil then - SetTextComponentFormat('STRING') - AddTextComponentString(CurrentActionMsg) - DisplayHelpTextFromStringLabel(0, 0, 1, -1) + SetTextComponentFormat('STRING') + AddTextComponentString(CurrentActionMsg) + DisplayHelpTextFromStringLabel(0, 0, 1, -1) - if IsControlJustReleased(0, Keys['E']) and PlayerData.job ~= nil and PlayerData.job.name == 'taxi' then + if IsControlJustReleased(0, Keys['E']) and PlayerData.job ~= nil and PlayerData.job.name == 'taxi' then - if CurrentAction == 'taxi_actions_menu' then - OpenTaxiActionsMenu() - end + if CurrentAction == 'taxi_actions_menu' then + OpenTaxiActionsMenu() + elseif CurrentAction == 'delete_vehicle' then - if CurrentAction == 'delete_vehicle' then + local playerPed = PlayerPedId() - local playerPed = GetPlayerPed(-1) + if Config.EnableSocietyOwnedVehicles then + local vehicleProps = ESX.Game.GetVehicleProperties(CurrentActionData.vehicle) + TriggerServerEvent('esx_society:putVehicleInGarage', 'taxi', vehicleProps) + else + if GetEntityModel(CurrentActionData.vehicle) == GetHashKey('taxi') then + ESX.Game.DeleteVehicle(CurrentActionData.vehicle) - if Config.EnableSocietyOwnedVehicles then - local vehicleProps = ESX.Game.GetVehicleProperties(CurrentActionData.vehicle) - TriggerServerEvent('esx_society:putVehicleInGarage', 'taxi', vehicleProps) - else - if GetEntityModel(CurrentActionData.vehicle) == GetHashKey('taxi') then - if Config.MaxInService ~= -1 then - TriggerServerEvent('esx_service:disableService', 'taxi') - end - end - end + if Config.MaxInService ~= -1 then + TriggerServerEvent('esx_service:disableService', 'taxi') + end + else + ESX.ShowNotification(_U('only_taxi')) + end + end - ESX.Game.DeleteVehicle(CurrentActionData.vehicle) + end - end + CurrentAction = nil - CurrentAction = nil + elseif IsControlJustReleased(0, Keys['F6']) and GetLastInputMethod(2) and not IsDead and Config.EnablePlayerManagement and PlayerData.job ~= nil and PlayerData.job.name == 'taxi' then + OpenMobileTaxiActionsMenu() + elseif IsControlJustReleased(0, Keys['DELETE']) and GetLastInputMethod(2) and not IsDead then - end + if OnJob then + StopTaxiJob() + else - end + if PlayerData.job ~= nil and PlayerData.job.name == 'taxi' then - if IsControlJustReleased(0, Keys['F6']) and not IsDead and Config.EnablePlayerManagement and PlayerData.job ~= nil and PlayerData.job.name == 'taxi' then - OpenMobileTaxiActionsMenu() - end + local playerPed = PlayerPedId() + if IsPedInAnyVehicle(playerPed, false) then - if IsControlJustReleased(0, Keys['DELETE']) and not IsDead then + local vehicle = GetVehiclePedIsIn(playerPed, false) + if PlayerData.job.grade >= 3 then + StartTaxiJob() + else + if GetEntityModel(vehicle) == GetHashKey('taxi') then + StartTaxiJob() + else + ESX.ShowNotification(_U('must_in_taxi')) + end + end - if OnJob then - StopTaxiJob() - else + else - if PlayerData.job ~= nil and PlayerData.job.name == 'taxi' then + if PlayerData.job.grade >= 3 then + ESX.ShowNotification(_U('must_in_vehicle')) + else + ESX.ShowNotification(_U('must_in_taxi')) + end - local playerPed = GetPlayerPed(-1) + end - if IsPedInAnyVehicle(playerPed, false) then + end - local vehicle = GetVehiclePedIsIn(playerPed, false) + end - if PlayerData.job.grade >= 3 then - StartTaxiJob() - else - if GetEntityModel(vehicle) == GetHashKey('taxi') then - StartTaxiJob() - else - ESX.ShowNotification(_U('must_in_taxi')) - end - end - - else - - if PlayerData.job.grade >= 3 then - ESX.ShowNotification(_U('must_in_vehicle')) - else - ESX.ShowNotification(_U('must_in_taxi')) - end - - end - - end - - end - - end - - end + end + end + end end) AddEventHandler('esx:onPlayerDeath', function() diff --git a/locales/br.lua b/locales/br.lua index 71957680..90096a02 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -1,14 +1,8 @@ Locales['br'] = { ['taking_service'] = 'Pegando serviço: ', ['spawn_veh'] = 'pegar veículo', - ['remove_comp_money'] = 'Remover dinheiro da empresa', - ['deposit_money'] = 'Depositar dinheiro', - ['launder_money'] = 'Lavar dinheiro', ['full_service'] = 'Serviço completo: ', - ['withdraw_amount'] = 'Valor do saque', ['amount_invalid'] = 'Valor inválido', - ['deposit_amount'] = 'Valor para deposito', - ['launder_amount'] = 'Valor para lavagem', ['press_to_open'] = 'Pressione ~INPUT_CONTEXT~ para acessar o menu', ['billing'] = 'Faturamento', ['invoice_amount'] = 'Valor da fatura', @@ -25,7 +19,17 @@ Locales['br'] = { ['only_taxi'] = 'Você só pode guardar taxis.', ['must_in_taxi'] = 'Você deve estar em um táxi para começar a missão', ['must_in_vehicle'] = 'Você deve estar em um veículo para começar a missão', - ['have_earned'] = 'Você ganhou ~g~$', - ['comp_earned'] = 'Sua empresa ganhou ~g~$', - ['player_cannot_hold'] = 'you do ~r~not~w~ have enough ~y~free space~w~ in your inventory!', -} + ['have_earned'] = 'Você ganhou ~g~$%s~s~', + ['comp_earned'] = '- Sua empresa ganhou ~g~$%s~s~\n- Você ganhou ~g~$%s~s~', + ['deposit_stock'] = 'deposit Stock', + ['take_stock'] = 'take Stock', + ['boss_actions'] = 'boss Actions', + ['mission_complete'] = 'mission Completed', + ['quantity'] = 'quantity', + ['quantity_invalid'] = 'that is an invalid quantity!', + ['inventory'] = 'inventory', + ['taxi_client'] = 'taxi Client', + ['have_withdrawn'] = 'você retirou ~y~x%s~s~ ~b~%s~s~', + ['have_deposited'] = 'você depositou ~y~x%s~s~ ~b~%s~s~', + ['player_cannot_hold'] = 'você não tem espaço suficiente em seu inventário!', +} \ No newline at end of file diff --git a/locales/de.lua b/locales/de.lua index 3568e468..0c671c0f 100644 --- a/locales/de.lua +++ b/locales/de.lua @@ -1,14 +1,8 @@ Locales['de'] = { ['taking_service'] = 'Service annehmen: ', ['spawn_veh'] = 'Fahrzeug spawnen', - ['remove_comp_money'] = 'Firmengeld abheben', - ['deposit_money'] = 'Geld einzahlen', - ['launder_money'] = 'Geld waschen', ['full_service'] = 'Voller Service: ', - ['withdraw_amount'] = 'Betrag zum abheben', ['amount_invalid'] = 'Betrag ungültig', - ['deposit_amount'] = 'Betrag zum einzahlen', - ['launder_amount'] = 'Betrag zum waschen', ['press_to_open'] = 'Drücke ~INPUT_CONTEXT~ um das Menü zu öffnen', ['billing'] = 'Rechnung', ['invoice_amount'] = 'Rechnugsbetrag', @@ -16,16 +10,26 @@ Locales['de'] = { ['store_veh'] = 'Drücke ~INPUT_CONTEXT~ um das Fahrzeug zu parken', ['drive_search_pass'] = 'Auf der Suche nach ~y~Passagieren', ['customer_found'] = 'du hast einen Passagier ~g~gefunden~s~ , Fahre in zum Ziel', - ['client_unconcious'] = 'dein Passagier ist ~r~bewusstlos~w~. Suche nach einem anderen.', + ['client_unconcious'] = 'dein Passagier ist ~r~bewusstlos~s~. Suche nach einem anderen.', ['arrive_dest'] = 'du bist an deinem Ziel ~g~angekommen~s~', - ['take_me_to_near'] = '~w~Bring mich nach~y~ %s~w~, in der Nähe von~y~ %s', - ['take_me_to'] = '~w~Bring mich nach~y~ %s', + ['take_me_to_near'] = '~s~Bring mich nach~y~ %s~s~, in der Nähe von~y~ %s', + ['take_me_to'] = '~s~Bring mich nach~y~ %s', ['close_to_client'] = 'du bist nahe an dem Passagier, du musst noch näher ran', ['return_to_veh'] = 'bitte kehre zu deinem Fahezeug zurück umd die Mission fortzuführen', ['only_taxi'] = 'Du kannst nur Taxis parken.', ['must_in_taxi'] = 'Du musst in einem Taxis sein umd die Mission starten zu können', ['must_in_vehicle'] = 'Du musst in einem Fahrzeug sein um die Mission starten zu können', - ['have_earned'] = 'verdient ~g~$', - ['comp_earned'] = 'Die Firma verdient ~g~$', - ['player_cannot_hold'] = 'you do ~r~not~w~ have enough ~y~free space~w~ in your inventory!', -} + ['have_earned'] = 'verdient ~g~$%s~s~', + ['comp_earned'] = '- Die Firma verdient ~g~$\n- Verdient ~g~$%s~s~', + ['deposit_stock'] = 'deposit Stock', + ['take_stock'] = 'take Stock', + ['boss_actions'] = 'boss Actions', + ['mission_complete'] = 'mission Completed', + ['quantity'] = 'quantity', + ['quantity_invalid'] = 'that is an invalid quantity!', + ['inventory'] = 'inventory', + ['taxi_client'] = 'taxi Client', + ['have_withdrawn'] = 'you have withdrawn ~y~x%s~s~ ~b~%s~s~', + ['have_deposited'] = 'you have deposited ~y~x%s~s~ ~b~%s~s~', + ['player_cannot_hold'] = 'you do ~r~not~s~ have enough ~y~free space~s~ in your inventory!', +} \ No newline at end of file diff --git a/locales/en.lua b/locales/en.lua index 46e3b8a3..31d41c9e 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -1,14 +1,8 @@ Locales['en'] = { ['taking_service'] = 'taking service: ', ['spawn_veh'] = 'spawn vehicle', - ['remove_comp_money'] = 'remove company money', - ['deposit_money'] = 'deposit money', - ['launder_money'] = 'launder money', ['full_service'] = 'full service: ', - ['withdraw_amount'] = 'amount of withdrawal', ['amount_invalid'] = 'amount invalid', - ['deposit_amount'] = 'amount to deposit', - ['launder_amount'] = 'amount to launder', ['press_to_open'] = 'press ~INPUT_CONTEXT~ to access the menu', ['billing'] = 'billing', ['invoice_amount'] = 'invoice amount', @@ -16,26 +10,26 @@ Locales['en'] = { ['store_veh'] = 'press ~INPUT_CONTEXT~ to store the vehicle', ['drive_search_pass'] = 'driving in search of ~y~passengers', ['customer_found'] = 'you have ~g~found~s~ a customer, drive until last', - ['client_unconcious'] = 'your client is ~r~unconscious~w~. Look for another one.', + ['client_unconcious'] = 'your client is ~r~unconscious~s~. Look for another one.', ['arrive_dest'] = 'you have ~g~arrived~s~ at your destination', - ['take_me_to_near'] = '~w~Take me to~y~ %s~w~, near~y~ %s', - ['take_me_to'] = '~w~Take me to~y~ %s', - ['close_to_client'] = 'you are close to the client, get close to them', + ['take_me_to_near'] = '~s~Take me to~y~ %s~s~, near ~y~%s', + ['take_me_to'] = '~s~Take me to ~y~%s', + ['close_to_client'] = 'you are too far from the client, get close to them', ['return_to_veh'] = 'please return to your vehicle to continue the mission', - ['only_taxi'] = 'you can only storee taxis.', + ['only_taxi'] = 'you can only store taxis.', ['must_in_taxi'] = 'you must be in a taxi to start the mission', ['must_in_vehicle'] = 'you must be in a vehicle to begin the mission', - ['have_earned'] = 'you have earned ~g~$', - ['comp_earned'] = 'your company has earned ~g~$', + ['have_earned'] = 'you have earned ~g~$%s~s~', + ['comp_earned'] = '- your company has earned ~g~$%s~s~\n- you have earned ~g~$%s~s~', ['deposit_stock'] = 'deposit Stock', ['take_stock'] = 'take Stock', ['boss_actions'] = 'boss Actions', ['mission_complete'] = 'mission Completed', ['quantity'] = 'quantity', - ['quantity_invalid'] = 'invalid Quantity', + ['quantity_invalid'] = 'that is an invalid quantity!', ['inventory'] = 'inventory', ['taxi_client'] = 'taxi Client', - ['have_withdrawn'] = 'you have withdrawn x', - ['added'] = 'you added x', - ['player_cannot_hold'] = 'you do ~r~not~w~ have enough ~y~free space~w~ in your inventory!', -} + ['have_withdrawn'] = 'you have withdrawn ~y~x%s~s~ ~b~%s~s~', + ['have_deposited'] = 'you have deposited ~y~x%s~s~ ~b~%s~s~', + ['player_cannot_hold'] = 'you do ~r~not~s~ have enough ~y~free space~s~ in your inventory!', +} \ No newline at end of file diff --git a/locales/fi.lua b/locales/fi.lua index 3e195443..1559ba1e 100644 --- a/locales/fi.lua +++ b/locales/fi.lua @@ -1,14 +1,8 @@ Locales['fi'] = { ['taking_service'] = 'Aloitetaan työ: ', ['spawn_veh'] = 'spawnaa ajoneuvo', - ['remove_comp_money'] = 'Nosta yrityksen rahoja', - ['deposit_money'] = 'talleta rahaa', - ['launder_money'] = 'pese rahaa', ['full_service'] = 'täysi palvelu: ', - ['withdraw_amount'] = 'noston summa', ['amount_invalid'] = 'virheellinen summa', - ['deposit_amount'] = 'talletuksen summa', - ['launder_amount'] = 'pestävä määrä', ['press_to_open'] = 'paina ~INPUT_CONTEXT~ avataksesi valikko', ['billing'] = 'Laskutus', ['invoice_amount'] = 'laskun määrä', @@ -16,17 +10,17 @@ Locales['fi'] = { ['store_veh'] = 'paina ~INPUT_CONTEXT~ laittaaksesi auto talliin', ['drive_search_pass'] = 'Ajele ympäriinsä etsi uusia ~y~asiakkaita', ['customer_found'] = 'Sinä ~g~löysit~s~ asiakkaan, aja lähemmäksi', - ['client_unconcious'] = 'Sinun asiakkaasi on ~r~tajuton~w~. Etsi uusi.', + ['client_unconcious'] = 'Sinun asiakkaasi on ~r~tajuton~s~. Etsi uusi.', ['arrive_dest'] = 'Sinä ~g~saavuit~s~ kohteeseen', - ['take_me_to_near'] = '~w~Vie minut ~y~ %s~w~, lähellä~y~ %s', - ['take_me_to'] = '~w~Vie minut~y~ %s', + ['take_me_to_near'] = '~s~Vie minut ~y~ %s~s~, lähellä~y~ %s', + ['take_me_to'] = '~s~Vie minut~y~ %s', ['close_to_client'] = 'Olet asiakkaan lähellä, mene lähemmäksi', ['return_to_veh'] = 'Mene takaisin ajoneuvoon, jatkaaksesi töitä', ['only_taxi'] = 'Voit vain tallettaa taxeja', ['must_in_taxi'] = 'Sinun pitää olla taxissa että voit alottaa työn', ['must_in_vehicle'] = 'Sinun pitää olla ajoneuvossa että voit alottaa työn', - ['have_earned'] = 'Sinä tienasit ~g~€', - ['comp_earned'] = 'Yrityksesi tienasi ~g~€', + ['have_earned'] = 'Sinä tienasit ~g~€%s~s~', + ['comp_earned'] = '- Yrityksesi tienasi ~g~€%s~s~\n- Sinä tienasit ~g~€%s~s~', ['deposit_stock'] = 'Talleta varastoon', ['take_stock'] = 'ota varastosta', ['boss_actions'] = 'pomon toiminnot', @@ -35,7 +29,7 @@ Locales['fi'] = { ['quantity_invalid'] = 'virheellinen Määrä', ['inventory'] = 'reppu', ['taxi_client'] = 'taxi Asiakas', - ['have_withdrawn'] = 'sinä otit x', - ['added'] = 'sinä laitoit x', - ['player_cannot_hold'] = 'sinulla ~r~ei ole~w~ enempää ~y~vapaata tilaa~w~ repussasi!', + ['have_withdrawn'] = 'sinä nostit ~y~x%s~s~ ~b~%s~s~', + ['have_deposited'] = 'sinä talletit ~y~x%s~s~ ~b~%s~s~', + ['player_cannot_hold'] = 'sinulla ~r~ei ole~s~ enempää ~y~vapaata tilaa~s~ repussasi!', } diff --git a/locales/fr.lua b/locales/fr.lua index 515374e0..c031c579 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -1,14 +1,8 @@ Locales['fr'] = { ['taking_service'] = 'prise de service : ', ['spawn_veh'] = 'sortir véhicule', - ['remove_comp_money'] = 'retirer argent société', - ['deposit_money'] = 'déposer argent', - ['launder_money'] = 'blanchir argent', ['full_service'] = 'service complet : ', - ['withdraw_amount'] = 'montant du retrait', ['amount_invalid'] = 'montant invalide', - ['deposit_amount'] = 'montant du dépôt', - ['launder_amount'] = 'montant à blanchir', ['press_to_open'] = 'appuyez sur ~INPUT_CONTEXT~ pour accéder au menu', ['billing'] = 'facuration', ['invoice_amount'] = 'montant de la facture', @@ -25,8 +19,8 @@ Locales['fr'] = { ['only_taxi'] = 'vous ne pouvez ranger que les taxi', ['must_in_taxi'] = 'vous devez être dans un taxi pour commencer la mission', ['must_in_vehicle'] = 'vous devez être dans un véhicule pour commencer la mission', - ['have_earned'] = 'vous avez gagné ~g~$', - ['comp_earned'] = 'votre société a gagné ~g~$', + ['have_earned'] = 'vous avez gagné ~g~$%s~s~', + ['comp_earned'] = '- Votre société a gagné ~g~$%s~s~\n- Vous avez gagné ~g~$%s~s~', ['deposit_stock'] = 'Déposer Stock', ['take_stock'] = 'Prendre Stock', ['boss_actions'] = 'action Patron', @@ -35,7 +29,7 @@ Locales['fr'] = { ['quantity_invalid'] = 'Quantité invalide', ['inventory'] = 'Inventaire', ['taxi_client'] = 'client Taxi', - ['have_withdrawn'] = 'Vous avez retiré x', - ['added'] = 'Vous avez ajouté x', - ['player_cannot_hold'] = 'you do ~r~not~w~ have enough ~y~free space~w~ in your inventory!', + ['have_withdrawn'] = 'vous avez pris ~y~x%s~s~ ~b~%s~s~', + ['have_deposited'] = 'vous avez déposé ~y~x%s~s~ ~b~%s~s~', + ['player_cannot_hold'] = 'vous n\'avez pas assez ~y~de place~s~ dans votre inventaire!', } diff --git a/locales/pl.lua b/locales/pl.lua index f40f8b1e..5333044a 100644 --- a/locales/pl.lua +++ b/locales/pl.lua @@ -1,14 +1,8 @@ Locales['pl'] = { ['taking_service'] = 'przyjmowanie usługi: ', ['spawn_veh'] = 'sprowadź pojazd', - ['remove_comp_money'] = 'usuń pieniądze firmy', - ['deposit_money'] = 'zdeponuj pieniądze', - ['launder_money'] = 'wypierz pieniądze', ['full_service'] = 'pełny serwis: ', - ['withdraw_amount'] = 'wartość wypłaty', ['amount_invalid'] = 'wartość nieprawidłowa', - ['deposit_amount'] = 'wartość do depozytu', - ['launder_amount'] = 'wartość do wyprania', ['press_to_open'] = 'naciśnij ~INPUT_CONTEXT~ aby wejść do menu', ['billing'] = 'rachunek', ['invoice_amount'] = 'wartość należności', @@ -16,17 +10,17 @@ Locales['pl'] = { ['store_veh'] = 'naciśnij ~INPUT_CONTEXT~ aby zdać pojazd', ['drive_search_pass'] = 'jazda w poszukiwaniu ~y~pasażerów', ['customer_found'] = '~g~Znalazłeś~s~ klienta, jedź do niego', - ['client_unconcious'] = 'twój jest ~r~nieprzytomny xD~w~. Poszukaj innego.', + ['client_unconcious'] = 'twój jest ~r~nieprzytomny xD~s~. Poszukaj innego.', ['arrive_dest'] = '~g~Dojechałeś~s~ do celu', - ['take_me_to_near'] = '~w~Zabierz mnie do~y~ %s~w~, w pobliżu ~y~ %s', - ['take_me_to'] = '~w~Weź mnie do~y~ %s', + ['take_me_to_near'] = '~s~Zabierz mnie do~y~ %s~s~, w pobliżu ~y~ %s', + ['take_me_to'] = '~s~Weź mnie do~y~ %s', ['close_to_client'] = 'jesteś blisko klienta, podjedź do niego bliżej', ['return_to_veh'] = 'proszę wróć do swojego pojazdu aby kontynuować misję', ['only_taxi'] = 'możesz przechowywać tylko taksówki.', ['must_in_taxi'] = 'musisz być w taksówce aby rozpocząć misję', ['must_in_vehicle'] = 'musisz być w pojeździe aby rozpocząć misję', - ['have_earned'] = 'zarobiłeś ~g~$', - ['comp_earned'] = 'twoja firma zarobiła ~g~$', + ['have_earned'] = 'zarobiłeś ~g~$%s~s~', + ['comp_earned'] = '- Twoja firma zarobiła ~g~$%s~s~\n- Zarobiłeś ~g~$%s~s~', ['deposit_stock'] = 'depozyt', ['take_stock'] = 'weź depozyt', ['boss_actions'] = 'akcje szefa', @@ -35,7 +29,7 @@ Locales['pl'] = { ['quantity_invalid'] = 'nieprawidłowa ilość', ['inventory'] = 'wkwipunek', ['taxi_client'] = 'klient taksówki', - ['have_withdrawn'] = 'wypłaciłeś x', - ['added'] = 'dodałeś x', - ['player_cannot_hold'] = '~r~Nie~w~ masz wystarczająco ~y~wolnego miejsca~w~ w swoim ekwipunku!', + ['have_withdrawn'] = 'wyciągnąłeś/aś ~y~x%s~s~ ~b~%s~s~', + ['have_deposited'] = 'zdeponowałeś/aś ~y~x%s~s~ ~b~%s~s~', + ['player_cannot_hold'] = '~r~Nie~s~ masz wystarczająco ~y~wolnego miejsca~s~ w swoim ekwipunku!', } diff --git a/locales/sv.lua b/locales/sv.lua new file mode 100644 index 00000000..a627de0c --- /dev/null +++ b/locales/sv.lua @@ -0,0 +1,35 @@ +Locales['sv'] = { + ['taking_service'] = 'du deltog tjänst: ', + ['spawn_veh'] = 'plocka ut taxi', + ['full_service'] = 'du kan inte delta tjänst: ', + ['amount_invalid'] = 'ogiltig mängd!', + ['press_to_open'] = 'tryck ~INPUT_CONTEXT~ för att öppna menyn.', + ['billing'] = 'skapa räkning', + ['invoice_amount'] = 'faktureringsbelopp', + ['no_players_near'] = 'det finns ingen spelare i närheten!', + ['store_veh'] = 'tryck ~INPUT_CONTEXT~ för att ~y~spara~s~ fordonet.', + ['drive_search_pass'] = 'åk runt för att hitta ~y~kunder~s~', + ['customer_found'] = 'du har ~g~hittat~s~ en kund!', + ['client_unconcious'] = 'din kund är ~r~medvetslös~s~. Hitta en ny.', + ['arrive_dest'] = 'du har ~g~anlänt~s~ till din destination', + ['take_me_to_near'] = '~s~Ta mig till ~y~%s~s~, vid ~y~%s~s~', + ['take_me_to'] = '~s~Ta mig till ~y~%s~s~', + ['close_to_client'] = 'åk närmare din kund!', + ['return_to_veh'] = 'vänligen återvänd till ditt fordon och återuppta körningen.', + ['only_taxi'] = 'du kan endast lagra ~y~taxi fordon~s~ här..', + ['must_in_taxi'] = 'du måste vara i en ~y~taxi~s~ för att starta uppdraget.', + ['must_in_vehicle'] = 'du måste vara i ett ~b~fordon~s~ för att starta uppdraget.', + ['have_earned'] = 'du har tjärnat ~g~%s SEK~s~', + ['comp_earned'] = '- ditt företag har tjärnat ~g~%s SEK~s~\n- du har tjärnat ~g~%s SEK~s~', + ['deposit_stock'] = 'lagra objekt', + ['take_stock'] = 'ta ut objekt', + ['boss_actions'] = 'chefmeny', + ['mission_complete'] = 'uppdraget har ~y~slutförts~s~!', + ['quantity'] = 'mängd', + ['quantity_invalid'] = 'det är en ogiltig mängd', + ['inventory'] = 'inventory', + ['taxi_client'] = 'taxi klient', + ['have_withdrawn'] = 'du har tagit ut ~y~x%s~s~ ~b~%s~s~', + ['have_deposited'] = 'du har lagrat ~y~x%s~s~ ~b~%s~s~', + ['player_cannot_hold'] = 'du har ~r~inte~s~ tillräckligt med ~y~utrymme~s~ för att hålla det!', +} \ No newline at end of file diff --git a/server/main.lua b/server/main.lua index 0fac5893..1c349242 100644 --- a/server/main.lua +++ b/server/main.lua @@ -3,7 +3,7 @@ ESX = nil TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) if Config.MaxInService ~= -1 then - TriggerEvent('esx_service:activateService', 'taxi', Config.MaxInService) + TriggerEvent('esx_service:activateService', 'taxi', Config.MaxInService) end TriggerEvent('esx_phone:registerNumber', 'taxi', _U('taxi_client'), true, true) @@ -11,38 +11,34 @@ TriggerEvent('esx_society:registerSociety', 'taxi', 'Taxi', 'society_taxi', 'soc RegisterServerEvent('esx_taxijob:success') AddEventHandler('esx_taxijob:success', function() + math.randomseed(os.time()) - math.randomseed(os.time()) + local xPlayer = ESX.GetPlayerFromId(source) + local total = math.random(Config.NPCJobEarnings.min, Config.NPCJobEarnings.max) + local societyAccount = nil - local xPlayer = ESX.GetPlayerFromId(source) - local total = math.random(Config.NPCJobEarnings.min, Config.NPCJobEarnings.max); - local societyAccount = nil + if xPlayer.job.grade >= 3 then + total = total * 2 + end - if xPlayer.job.grade >= 3 then - total = total * 2 - end + TriggerEvent('esx_addonaccount:getSharedAccount', 'society_taxi', function(account) + societyAccount = account + end) - TriggerEvent('esx_addonaccount:getSharedAccount', 'society_taxi', function(account) - societyAccount = account - end) + if societyAccount ~= nil then - if societyAccount ~= nil then + local playerMoney = math.floor(total / 100 * 30) + local societyMoney = math.floor(total / 100 * 70) - local playerMoney = math.floor(total / 100 * 30) - local societyMoney = math.floor(total / 100 * 70) + xPlayer.addMoney(playerMoney) + societyAccount.addMoney(societyMoney) - xPlayer.addMoney(playerMoney) - societyAccount.addMoney(societyMoney) + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('comp_earned', societyMoney, playerMoney)) - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('have_earned') .. playerMoney) - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('comp_earned') .. societyMoney) - - else - - xPlayer.addMoney(total) - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('have_earned') .. total) - - end + else + xPlayer.addMoney(total) + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('have_earned', total)) + end end) @@ -63,7 +59,7 @@ AddEventHandler('esx_taxijob:getStockItem', function(itemName, count) else inventory.removeItem(itemName, count) xPlayer.addInventoryItem(itemName, count) - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('have_withdrawn') .. count .. ' ' .. item.label) + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('have_withdrawn', count, item.label)) end else TriggerClientEvent('esx:showNotification', xPlayer.source, _U('quantity_invalid')) @@ -72,42 +68,33 @@ AddEventHandler('esx_taxijob:getStockItem', function(itemName, count) end) ESX.RegisterServerCallback('esx_taxijob:getStockItems', function(source, cb) - - TriggerEvent('esx_addoninventory:getSharedInventory', 'society_taxi', function(inventory) - cb(inventory.items) - end) - + TriggerEvent('esx_addoninventory:getSharedInventory', 'society_taxi', function(inventory) + cb(inventory.items) + end) end) RegisterServerEvent('esx_taxijob:putStockItems') AddEventHandler('esx_taxijob:putStockItems', function(itemName, count) + local xPlayer = ESX.GetPlayerFromId(source) - local xPlayer = ESX.GetPlayerFromId(source) + TriggerEvent('esx_addoninventory:getSharedInventory', 'society_taxi', function(inventory) + local item = inventory.getItem(itemName) - TriggerEvent('esx_addoninventory:getSharedInventory', 'society_taxi', function(inventory) + if item.count >= 0 then + xPlayer.removeInventoryItem(itemName, count) + inventory.addItem(itemName, count) + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('have_deposited', count, item.label)) + else + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('quantity_invalid')) + end - 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('quantity_invalid')) - end - - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('added') .. count .. ' ' .. item.label) - - end) + end) end) ESX.RegisterServerCallback('esx_taxijob: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 } ) end) From 2191cc446eafd78e519821c0d76b28c51f4cce7f Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sun, 12 Aug 2018 18:14:38 +0200 Subject: [PATCH 54/93] Check if taxi spawnpoint is blocked --- client/main.lua | 5 +++++ locales/br.lua | 1 + locales/de.lua | 1 + locales/en.lua | 1 + locales/fi.lua | 1 + locales/fr.lua | 1 + locales/pl.lua | 1 + locales/sv.lua | 1 + 8 files changed, 12 insertions(+) diff --git a/client/main.lua b/client/main.lua index 2b339ed5..9b864b72 100644 --- a/client/main.lua +++ b/client/main.lua @@ -166,6 +166,11 @@ function OpenTaxiActionsMenu() if data.current.value == 'spawn_vehicle' then + if not ESX.Game.IsSpawnPointClear(Config.Zones.VehicleSpawnPoint.Pos, 3.0) then + ESX.ShowNotification(_U('spawnpoint_blocked')) + return + end + if Config.EnableSocietyOwnedVehicles then local elements = {} diff --git a/locales/br.lua b/locales/br.lua index 90096a02..cc709de2 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -17,6 +17,7 @@ Locales['br'] = { ['close_to_client'] = 'Você está perto do passageiro, aproximisse dele', ['return_to_veh'] = 'Volte para o seu veículo para continuar a missão', ['only_taxi'] = 'Você só pode guardar taxis.', + ['spawnpoint_blocked'] = 'there is a vehicle blocking the spawnpoint!', ['must_in_taxi'] = 'Você deve estar em um táxi para começar a missão', ['must_in_vehicle'] = 'Você deve estar em um veículo para começar a missão', ['have_earned'] = 'Você ganhou ~g~$%s~s~', diff --git a/locales/de.lua b/locales/de.lua index 0c671c0f..78c09f30 100644 --- a/locales/de.lua +++ b/locales/de.lua @@ -17,6 +17,7 @@ Locales['de'] = { ['close_to_client'] = 'du bist nahe an dem Passagier, du musst noch näher ran', ['return_to_veh'] = 'bitte kehre zu deinem Fahezeug zurück umd die Mission fortzuführen', ['only_taxi'] = 'Du kannst nur Taxis parken.', + ['spawnpoint_blocked'] = 'there is a vehicle blocking the spawnpoint!', ['must_in_taxi'] = 'Du musst in einem Taxis sein umd die Mission starten zu können', ['must_in_vehicle'] = 'Du musst in einem Fahrzeug sein um die Mission starten zu können', ['have_earned'] = 'verdient ~g~$%s~s~', diff --git a/locales/en.lua b/locales/en.lua index 31d41c9e..7980d803 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -17,6 +17,7 @@ Locales['en'] = { ['close_to_client'] = 'you are too far from the client, get close to them', ['return_to_veh'] = 'please return to your vehicle to continue the mission', ['only_taxi'] = 'you can only store taxis.', + ['spawnpoint_blocked'] = 'there is a vehicle blocking the spawnpoint!', ['must_in_taxi'] = 'you must be in a taxi to start the mission', ['must_in_vehicle'] = 'you must be in a vehicle to begin the mission', ['have_earned'] = 'you have earned ~g~$%s~s~', diff --git a/locales/fi.lua b/locales/fi.lua index 1559ba1e..30c0c4c3 100644 --- a/locales/fi.lua +++ b/locales/fi.lua @@ -17,6 +17,7 @@ Locales['fi'] = { ['close_to_client'] = 'Olet asiakkaan lähellä, mene lähemmäksi', ['return_to_veh'] = 'Mene takaisin ajoneuvoon, jatkaaksesi töitä', ['only_taxi'] = 'Voit vain tallettaa taxeja', + ['spawnpoint_blocked'] = 'there is a vehicle blocking the spawnpoint!', ['must_in_taxi'] = 'Sinun pitää olla taxissa että voit alottaa työn', ['must_in_vehicle'] = 'Sinun pitää olla ajoneuvossa että voit alottaa työn', ['have_earned'] = 'Sinä tienasit ~g~€%s~s~', diff --git a/locales/fr.lua b/locales/fr.lua index c031c579..0038ec6a 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -17,6 +17,7 @@ Locales['fr'] = { ['close_to_client'] = 'vous êtes à proximité du client, approchez-vous de lui', ['return_to_veh'] = 'veuillez remonter dans votre véhicule pour continuer la mission', ['only_taxi'] = 'vous ne pouvez ranger que les taxi', + ['spawnpoint_blocked'] = 'there is a vehicle blocking the spawnpoint!', ['must_in_taxi'] = 'vous devez être dans un taxi pour commencer la mission', ['must_in_vehicle'] = 'vous devez être dans un véhicule pour commencer la mission', ['have_earned'] = 'vous avez gagné ~g~$%s~s~', diff --git a/locales/pl.lua b/locales/pl.lua index 5333044a..0884c76f 100644 --- a/locales/pl.lua +++ b/locales/pl.lua @@ -17,6 +17,7 @@ Locales['pl'] = { ['close_to_client'] = 'jesteś blisko klienta, podjedź do niego bliżej', ['return_to_veh'] = 'proszę wróć do swojego pojazdu aby kontynuować misję', ['only_taxi'] = 'możesz przechowywać tylko taksówki.', + ['spawnpoint_blocked'] = 'there is a vehicle blocking the spawnpoint!', ['must_in_taxi'] = 'musisz być w taksówce aby rozpocząć misję', ['must_in_vehicle'] = 'musisz być w pojeździe aby rozpocząć misję', ['have_earned'] = 'zarobiłeś ~g~$%s~s~', diff --git a/locales/sv.lua b/locales/sv.lua index a627de0c..9c207d21 100644 --- a/locales/sv.lua +++ b/locales/sv.lua @@ -17,6 +17,7 @@ Locales['sv'] = { ['close_to_client'] = 'åk närmare din kund!', ['return_to_veh'] = 'vänligen återvänd till ditt fordon och återuppta körningen.', ['only_taxi'] = 'du kan endast lagra ~y~taxi fordon~s~ här..', + ['spawnpoint_blocked'] = 'det är ett fordon som blockerar spawnpointen!', ['must_in_taxi'] = 'du måste vara i en ~y~taxi~s~ för att starta uppdraget.', ['must_in_vehicle'] = 'du måste vara i ett ~b~fordon~s~ för att starta uppdraget.', ['have_earned'] = 'du har tjärnat ~g~%s SEK~s~', From b90a0878fd2de28f4535ddf755cde8e6295f6e9e Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sun, 12 Aug 2018 18:25:51 +0200 Subject: [PATCH 55/93] Fixed mistake --- client/main.lua | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/client/main.lua b/client/main.lua index 9b864b72..05fd8472 100644 --- a/client/main.lua +++ b/client/main.lua @@ -821,39 +821,39 @@ Citizen.CreateThread(function() end CurrentAction = nil + end + end - elseif IsControlJustReleased(0, Keys['F6']) and GetLastInputMethod(2) and not IsDead and Config.EnablePlayerManagement and PlayerData.job ~= nil and PlayerData.job.name == 'taxi' then - OpenMobileTaxiActionsMenu() - elseif IsControlJustReleased(0, Keys['DELETE']) and GetLastInputMethod(2) and not IsDead then + if IsControlJustReleased(0, Keys['F6']) and GetLastInputMethod(2) and not IsDead and Config.EnablePlayerManagement and PlayerData.job ~= nil and PlayerData.job.name == 'taxi' then + OpenMobileTaxiActionsMenu() + elseif IsControlJustReleased(0, Keys['DELETE']) and GetLastInputMethod(2) and not IsDead then - if OnJob then - StopTaxiJob() - else + if OnJob then + StopTaxiJob() + else - if PlayerData.job ~= nil and PlayerData.job.name == 'taxi' then + if PlayerData.job ~= nil and PlayerData.job.name == 'taxi' then - local playerPed = PlayerPedId() - if IsPedInAnyVehicle(playerPed, false) then - - local vehicle = GetVehiclePedIsIn(playerPed, false) - if PlayerData.job.grade >= 3 then - StartTaxiJob() - else - if GetEntityModel(vehicle) == GetHashKey('taxi') then - StartTaxiJob() - else - ESX.ShowNotification(_U('must_in_taxi')) - end - end + local playerPed = PlayerPedId() + if IsPedInAnyVehicle(playerPed, false) then + local vehicle = GetVehiclePedIsIn(playerPed, false) + if PlayerData.job.grade >= 3 then + StartTaxiJob() else - - if PlayerData.job.grade >= 3 then - ESX.ShowNotification(_U('must_in_vehicle')) + if GetEntityModel(vehicle) == GetHashKey('taxi') then + StartTaxiJob() else ESX.ShowNotification(_U('must_in_taxi')) end + end + else + + if PlayerData.job.grade >= 3 then + ESX.ShowNotification(_U('must_in_vehicle')) + else + ESX.ShowNotification(_U('must_in_taxi')) end end From 983a0a4c1b60bf2fa47400389c74460f5b9b1953 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sun, 12 Aug 2018 20:36:17 +0200 Subject: [PATCH 56/93] Tweaked spawnpoint check, fixed inventory --- client/main.lua | 2 +- server/main.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/main.lua b/client/main.lua index 05fd8472..67c70b83 100644 --- a/client/main.lua +++ b/client/main.lua @@ -166,7 +166,7 @@ function OpenTaxiActionsMenu() if data.current.value == 'spawn_vehicle' then - if not ESX.Game.IsSpawnPointClear(Config.Zones.VehicleSpawnPoint.Pos, 3.0) then + if not ESX.Game.IsSpawnPointClear(Config.Zones.VehicleSpawnPoint.Pos, 5.0) then ESX.ShowNotification(_U('spawnpoint_blocked')) return end diff --git a/server/main.lua b/server/main.lua index 1c349242..704f8043 100644 --- a/server/main.lua +++ b/server/main.lua @@ -96,5 +96,5 @@ ESX.RegisterServerCallback('esx_taxijob:getPlayerInventory', function(source, cb local xPlayer = ESX.GetPlayerFromId(source) local items = xPlayer.inventory - cb( { items } ) + cb( { items = items } ) end) From f7f34600adc11b36911cd15bc604054a5f8f3683 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Mon, 13 Aug 2018 13:32:57 +0200 Subject: [PATCH 57/93] Implemented authorized vehicles, added cloakroom, moved circles --- client/main.lua | 401 +++++++++++++++++++++++++----------------------- config.lua | 40 ++++- locales/br.lua | 18 ++- locales/de.lua | 18 ++- locales/en.lua | 18 ++- locales/fi.lua | 20 ++- locales/fr.lua | 20 ++- locales/pl.lua | 20 ++- locales/sv.lua | 17 +- 9 files changed, 338 insertions(+), 234 deletions(-) diff --git a/client/main.lua b/client/main.lua index 67c70b83..a608379a 100644 --- a/client/main.lua +++ b/client/main.lua @@ -34,7 +34,7 @@ Citizen.CreateThread(function() Citizen.Wait(0) end - Citizen.Wait(5000) + Citizen.Wait(1000) PlayerData = ESX.GetPlayerData() end) @@ -88,36 +88,32 @@ function GetRandomWalkingNPC() end function ClearCurrentMission() + if DoesBlipExist(CurrentCustomerBlip) then + RemoveBlip(CurrentCustomerBlip) + end - if DoesBlipExist(CurrentCustomerBlip) then - RemoveBlip(CurrentCustomerBlip) - end - - if DoesBlipExist(DestinationBlip) then - RemoveBlip(DestinationBlip) - end - - CurrentCustomer = nil - CurrentCustomerBlip = nil - DestinationBlip = nil - IsNearCustomer = false - CustomerIsEnteringVehicle = false - CustomerEnteredVehicle = false - TargetCoords = nil + if DoesBlipExist(DestinationBlip) then + RemoveBlip(DestinationBlip) + end + CurrentCustomer = nil + CurrentCustomerBlip = nil + DestinationBlip = nil + IsNearCustomer = false + CustomerIsEnteringVehicle = false + CustomerEnteredVehicle = false + TargetCoords = nil end function StartTaxiJob() + ShowLoadingPromt(_U('taking_service') .. 'Taxi/Uber', 5000, 3) + ClearCurrentMission() - ShowLoadingPromt(_U('taking_service') .. 'Taxi/Uber', 5000, 3) - ClearCurrentMission() - - OnJob = true - + OnJob = true end function StopTaxiJob() - local playerPed = GetPlayerPed(-1) + local playerPed = PlayerPedId() if IsPedInAnyVehicle(playerPed, false) and CurrentCustomer ~= nil then local vehicle = GetVehiclePedIsIn(playerPed, false) @@ -133,141 +129,152 @@ function StopTaxiJob() DrawSub(_U('mission_complete'), 5000) end +function OpenCloakroom() + ESX.UI.Menu.CloseAll() + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'taxi_cloakroom', + { + title = _U('cloakroom_menu'), + align = 'top-left', + elements = { + { label = _U('wear_citizen'), value = 'wear_citizen' }, + { label = _U('wear_work'), value = 'wear_work'} + } + }, function(data, menu) + if data.current.value == 'wear_citizen' then + ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin) + TriggerEvent('skinchanger:loadSkin', skin) + end) + elseif data.current.value == 'wear_citizen' then + 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 + end) + end + end, function(data, menu) + menu.close() + + CurrentAction = 'cloakroom' + CurrentActionMsg = _U('cloakroom_prompt') + CurrentActionData = {} + end) + +end + +function OpenVehicleSpawnerMenu() + ESX.UI.Menu.CloseAll() + + local elements = {} + + if Config.EnableSocietyOwnedVehicles then + + 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 + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_spawner', + { + title = _U('spawn_veh'), + align = 'top-left', + elements = elements + }, function(data, menu) + if not ESX.Game.IsSpawnPointClear(Config.Zones.VehicleSpawnPoint.Pos, 5.0) then + ESX.ShowNotification(_U('spawnpoint_blocked')) + return + end + + menu.close() + + local vehicleProps = data.current.value + ESX.Game.SpawnVehicle(vehicleProps.model, Config.Zones.VehicleSpawnPoint.Pos, Config.Zones.VehicleSpawnPoint.Heading, function(vehicle) + ESX.Game.SetVehicleProperties(vehicle, vehicleProps) + local playerPed = PlayerPedId() + TaskWarpPedIntoVehicle(playerPed, vehicle, -1) + end) + + TriggerServerEvent('esx_society:removeVehicleFromGarage', 'taxi', vehicleProps) + + end, function(data, menu) + CurrentAction = 'vehicle_spawner' + CurrentActionMsg = _U('spawner_prompt') + CurrentActionData = {} + + menu.close() + end) + end, 'taxi') + + else -- not society vehicles + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_spawner', + { + title = _U('spawn_veh'), + align = 'top-left', + elements = Config.AuthorizedVehicles + }, function(data, menu) + if not ESX.Game.IsSpawnPointClear(Config.Zones.VehicleSpawnPoint.Pos, 5.0) then + ESX.ShowNotification(_U('spawnpoint_blocked')) + return + end + + menu.close() + ESX.Game.SpawnVehicle(data.current.model, Config.Zones.VehicleSpawnPoint.Pos, Config.Zones.VehicleSpawnPoint.Heading, function(vehicle) + local playerPed = PlayerPedId() + TaskWarpPedIntoVehicle(playerPed, vehicle, -1) + end) + end, function(data, menu) + CurrentAction = 'vehicle_spawner' + CurrentActionMsg = _U('spawner_prompt') + CurrentActionData = {} + + menu.close() + end) + end +end + function OpenTaxiActionsMenu() + local elements = { + {label = _U('deposit_stock'), value = 'put_stock'}, + {label = _U('take_stock'), value = 'get_stock'} + } - local elements = { - {label = _U('spawn_veh'), value = 'spawn_vehicle'}, - {label = _U('deposit_stock'), value = 'put_stock'}, - {label = _U('take_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 - 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(), 'taxi_actions', + { + title = 'Taxi', + align = 'top-left', + elements = elements + }, function(data, menu) - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'taxi_actions', - { - title = 'Taxi', - align = 'top-left', - elements = elements - }, - function(data, menu) + if data.current.value == 'put_stock' then + OpenPutStocksMenu() + elseif data.current.value == 'get_stock' then + OpenGetStocksMenu() + elseif data.current.value == 'boss_actions' then + TriggerEvent('esx_society:openBossMenu', 'taxi', function(data, menu) + menu.close() + end) + end - if data.current.value == 'put_stock' then - OpenPutStocksMenu() - end - - if data.current.value == 'get_stock' then - OpenGetStocksMenu() - end - - if data.current.value == 'spawn_vehicle' then - - if not ESX.Game.IsSpawnPointClear(Config.Zones.VehicleSpawnPoint.Pos, 5.0) then - ESX.ShowNotification(_U('spawnpoint_blocked')) - return - end - - if Config.EnableSocietyOwnedVehicles then - - local elements = {} - - 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 - - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'vehicle_spawner', - { - title = _U('spawn_veh'), - align = 'top-left', - elements = elements - }, - function(data, menu) - - menu.close() - - 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) - - TriggerServerEvent('esx_society:removeVehicleFromGarage', 'taxi', vehicleProps) - - end, - function(data, menu) - menu.close() - end - ) - - end, 'taxi') - - else - - menu.close() - - if Config.MaxInService == -1 then - - local playerPed = GetPlayerPed(-1) - local coords = Config.Zones.VehicleSpawnPoint.Pos - - ESX.Game.SpawnVehicle('taxi', coords, 225.0, function(vehicle) - TaskWarpPedIntoVehicle(playerPed, vehicle, -1) - end) - - else - - ESX.TriggerServerCallback('esx_service:enableService', function(canTakeService, maxInService, inServiceCount) - - if canTakeService then - - local playerPed = GetPlayerPed(-1) - local coords = Config.Zones.VehicleSpawnPoint.Pos - - ESX.Game.SpawnVehicle('taxi', coords, 225.0, function(vehicle) - TaskWarpPedIntoVehicle(playerPed, vehicle, -1) - end) - - else - - ESX.ShowNotification(_U('full_service') .. inServiceCount .. '/' .. maxInService) - - end - - end, 'taxi') - - end - - end - - end - - if data.current.value == 'boss_actions' then - TriggerEvent('esx_society:openBossMenu', 'taxi', function(data, menu) - menu.close() - end) - end - - end, - function(data, menu) - - menu.close() - - CurrentAction = 'taxi_actions_menu' - CurrentActionMsg = _U('press_to_open') - CurrentActionData = {} - - end - ) + end, function(data, menu) + menu.close() + CurrentAction = 'taxi_actions_menu' + CurrentActionMsg = _U('press_to_open') + CurrentActionData = {} + end) end function OpenMobileTaxiActionsMenu() @@ -449,70 +456,71 @@ 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_taxijob:hasEnteredMarker', function(zone) - if zone == 'TaxiActions' then - CurrentAction = 'taxi_actions_menu' - CurrentActionMsg = _U('press_to_open') - CurrentActionData = {} - end + if zone == 'VehicleSpawner' then + CurrentAction = 'vehicle_spawner' + CurrentActionMsg = _U('spawner_prompt') + CurrentActionData = {} + elseif zone == 'VehicleDeleter' then + local playerPed = PlayerPedId() + local vehicle = GetVehiclePedIsIn(playerPed, false) - if zone == 'VehicleDeleter' then + if IsPedInAnyVehicle(playerPed, false) and GetPedInVehicleSeat(vehicle, -1) == playerPed then + CurrentAction = 'delete_vehicle' + CurrentActionMsg = _U('store_veh') + CurrentActionData = { vehicle = vehicle } + end + elseif zone == 'TaxiActions' then + CurrentAction = 'taxi_actions_menu' + CurrentActionMsg = _U('press_to_open') + CurrentActionData = {} - local playerPed = GetPlayerPed(-1) - local vehicle = GetVehiclePedIsIn(playerPed, false) - - if IsPedInAnyVehicle(playerPed, false) then - CurrentAction = 'delete_vehicle' - CurrentActionMsg = _U('store_veh') - CurrentActionData = { vehicle = vehicle } - end - - end + elseif zone == 'Cloakroom' then + CurrentAction = 'cloakroom' + CurrentActionMsg = _U('cloakroom_prompt') + CurrentActionData = {} + end end) AddEventHandler('esx_taxijob:hasExitedMarker', function(zone) - ESX.UI.Menu.CloseAll() - CurrentAction = nil + ESX.UI.Menu.CloseAll() + CurrentAction = nil end) RegisterNetEvent('esx_phone:loaded') AddEventHandler('esx_phone:loaded', function(phoneNumber, contacts) + local specialContact = { + name = 'Taxi', + number = 'taxi', + base64Icon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAGGElEQVR4XsWWW2gd1xWGv7Vn5pyRj47ut8iOYlmyWxw1KSZN4riOW6eFuCYldaBtIL1Ag4NNmt5ICORCaNKXlF6oCy0hpSoJKW4bp7Sk6YNb01RuLq4d0pQ0kWQrshVJ1uX46HJ0zpy5rCKfQYgjCUs4kA+GtTd786+ftW8jqsqHibB6TLZn2zeq09ZTWAIWCxACoTI1E+6v+eSpXwHRqkVZPcmqlBzCApLQ8dk3IWVKMQlYcHG81OODNmD6D7d9VQrTSbwsH73lFKePtvOxXSfn48U+Xpb58fl5gPmgl6DiR19PZN4+G7iODY4liIAACqiCHyp+AFvb7ML3uot1QP5yDUim292RtIqfU6Lr8wFVDVV8AsPKRDAxzYkKm2kj5sSFuUT3+v2FXkDXakD6f+7c1NGS7Ml0Pkah6jq8mhvwUy7Cyijg5Aoks6/hTp+k7vRjDJ73dmw8WHxlJRM2y5Nsb3GPDuzsZURbGMsUmRkoUPByCMrKCG7SobJiO01X7OKq6utoe3XX34BaoLDaCljj3faTcu3j3z3T+iADwzNYEmKIWcGAIAtqqkKAxZa2Sja/tY+59/7y48aveQ8A4Woq4Fa3bj7Q1/EgwWRAZ52NMTYCWAZEwIhBUEQgUiVQ8IpKvqj4kVJCyGRCRrb+hvap+gPAo0DuUhWQfx2q29u+t/vPmarbCLwII7qQTEQRLbUtBJ2PAkZARBADqkLBV/I+BGrhpoSN577FWz3P3XbTvRMvAlpuwC4crv5jwtK9RAFSu46+G8cRwESxQ+K2gESAgCiIASHuA8YCBdSUohdCKGCF0H6iGc3MgrEphvKi+6Wp24HABioSjuxFARGobyJ5OMXEiGHW6iLR0EmifhPJDddj3CoqtuwEZSkCc73/RAvTeEOvU5w8gz/Zj2TfoLFFibZvQrI5EOFiPqgAZmzApTINKKgPiW20ffkXtPXfA9Ysmf5/kHn/T0z8e5rpCS5JVQNUN1ayfn2a+qvT2JWboOOXMPg0ms6C2IAAWTc2ACPeupdbm5yb8XNQczOM90DOB0uoa01Ttz5FZ6IL3Ctg9DUIg7Lto2DZ0HIDFEbAz4AaiBRyxZJe9U7kQg84KYbH/JeJESANXPXwXdWffvzu1p+x5VE4/ST4EyAOoEAI6WsAhdx/AYulhJDqAgRm/hPPEVAfnAboeAB6v88jTw/f98SzU8eAwbgC5IGRg3vsW3E7YewYzJwF4wAhikJURGqvBO8ouAFIxBI0gqgPEp9B86+ASSAIEEHhbEnX7eTgnrFbn3iW5+K82EAA+M2V+d2EeRj9K/izIBYgJZGwCO4Gzm/uRQOwDEsI41PSfPZ+xJsBKwFo6dOwpJvezMU84Md5sSmRCM51uacGbUKvHWEjAKIelXaGJqePyopjzFTdx6Ef/gDbjo3FKEoQKN+8/yEqRt8jf67IaNDBnF9FZFwERRGspMM20+XC64nym9AMhSE1G7fjbb0bCQsISi6vFCdPMPzuUwR9AcmOKQ7cew+WZcq3IGEYMZeb4p13sjjmU4TX7Cfdtp0oDAFBbZfk/37N0MALAKbcAKaY4yPeuwy3t2J8MAKDIxDVd1Lz8Ts599vb8Wameen532GspRWIQmXPHV8k0BquvPP3TOSgsRmiCFRAHWh9420Gi7nl34JaBen7O7UWRMD740AQ7yEf8nW78TIeN+7+PCIsOYaqMJHxqKtpJ++D+DA5ARsawEmASqzv1Cz7FjRpbt951tUAOcAHdNEUC7C5NAJo7Dws03CAFMxlkdSRZmCMxaq8ejKuVwSqIJfzA61LmyIgBoxZfgmYmQazKLGumHitRso0ZVkD0aE/FI7UrYv2WUYXjo0ihNhEatA1GBEUIxEWAcKCHhHCVMG8AETlda0ENn3hrm+/6Zh47RBCtXn+mZ/sAXzWjnPHV77zkiXBgl6gFkee+em1wBlgdnEF8sCF5moLI7KwlSIMwABwgbVT21htMNjleheAfPkShEBh/PzQccexdxBT9IPjQAYYZ+3o2OjQ8cQiPb+kVwBCliENXA3sAm6Zj3E/zaq4fD07HmwEmuKYXsUFcDl6Hz7/B1RGfEbPim/bAAAAAElFTkSuQmCC', + } - local specialContact = { - name = 'Taxi', - number = 'taxi', - base64Icon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAGGElEQVR4XsWWW2gd1xWGv7Vn5pyRj47ut8iOYlmyWxw1KSZN4riOW6eFuCYldaBtIL1Ag4NNmt5ICORCaNKXlF6oCy0hpSoJKW4bp7Sk6YNb01RuLq4d0pQ0kWQrshVJ1uX46HJ0zpy5rCKfQYgjCUs4kA+GtTd786+ftW8jqsqHibB6TLZn2zeq09ZTWAIWCxACoTI1E+6v+eSpXwHRqkVZPcmqlBzCApLQ8dk3IWVKMQlYcHG81OODNmD6D7d9VQrTSbwsH73lFKePtvOxXSfn48U+Xpb58fl5gPmgl6DiR19PZN4+G7iODY4liIAACqiCHyp+AFvb7ML3uot1QP5yDUim292RtIqfU6Lr8wFVDVV8AsPKRDAxzYkKm2kj5sSFuUT3+v2FXkDXakD6f+7c1NGS7Ml0Pkah6jq8mhvwUy7Cyijg5Aoks6/hTp+k7vRjDJ73dmw8WHxlJRM2y5Nsb3GPDuzsZURbGMsUmRkoUPByCMrKCG7SobJiO01X7OKq6utoe3XX34BaoLDaCljj3faTcu3j3z3T+iADwzNYEmKIWcGAIAtqqkKAxZa2Sja/tY+59/7y48aveQ8A4Woq4Fa3bj7Q1/EgwWRAZ52NMTYCWAZEwIhBUEQgUiVQ8IpKvqj4kVJCyGRCRrb+hvap+gPAo0DuUhWQfx2q29u+t/vPmarbCLwII7qQTEQRLbUtBJ2PAkZARBADqkLBV/I+BGrhpoSN577FWz3P3XbTvRMvAlpuwC4crv5jwtK9RAFSu46+G8cRwESxQ+K2gESAgCiIASHuA8YCBdSUohdCKGCF0H6iGc3MgrEphvKi+6Wp24HABioSjuxFARGobyJ5OMXEiGHW6iLR0EmifhPJDddj3CoqtuwEZSkCc73/RAvTeEOvU5w8gz/Zj2TfoLFFibZvQrI5EOFiPqgAZmzApTINKKgPiW20ffkXtPXfA9Ysmf5/kHn/T0z8e5rpCS5JVQNUN1ayfn2a+qvT2JWboOOXMPg0ms6C2IAAWTc2ACPeupdbm5yb8XNQczOM90DOB0uoa01Ttz5FZ6IL3Ctg9DUIg7Lto2DZ0HIDFEbAz4AaiBRyxZJe9U7kQg84KYbH/JeJESANXPXwXdWffvzu1p+x5VE4/ST4EyAOoEAI6WsAhdx/AYulhJDqAgRm/hPPEVAfnAboeAB6v88jTw/f98SzU8eAwbgC5IGRg3vsW3E7YewYzJwF4wAhikJURGqvBO8ouAFIxBI0gqgPEp9B86+ASSAIEEHhbEnX7eTgnrFbn3iW5+K82EAA+M2V+d2EeRj9K/izIBYgJZGwCO4Gzm/uRQOwDEsI41PSfPZ+xJsBKwFo6dOwpJvezMU84Md5sSmRCM51uacGbUKvHWEjAKIelXaGJqePyopjzFTdx6Ef/gDbjo3FKEoQKN+8/yEqRt8jf67IaNDBnF9FZFwERRGspMM20+XC64nym9AMhSE1G7fjbb0bCQsISi6vFCdPMPzuUwR9AcmOKQ7cew+WZcq3IGEYMZeb4p13sjjmU4TX7Cfdtp0oDAFBbZfk/37N0MALAKbcAKaY4yPeuwy3t2J8MAKDIxDVd1Lz8Ts599vb8Wameen532GspRWIQmXPHV8k0BquvPP3TOSgsRmiCFRAHWh9420Gi7nl34JaBen7O7UWRMD740AQ7yEf8nW78TIeN+7+PCIsOYaqMJHxqKtpJ++D+DA5ARsawEmASqzv1Cz7FjRpbt951tUAOcAHdNEUC7C5NAJo7Dws03CAFMxlkdSRZmCMxaq8ejKuVwSqIJfzA61LmyIgBoxZfgmYmQazKLGumHitRso0ZVkD0aE/FI7UrYv2WUYXjo0ihNhEatA1GBEUIxEWAcKCHhHCVMG8AETlda0ENn3hrm+/6Zh47RBCtXn+mZ/sAXzWjnPHV77zkiXBgl6gFkee+em1wBlgdnEF8sCF5moLI7KwlSIMwABwgbVT21htMNjleheAfPkShEBh/PzQccexdxBT9IPjQAYYZ+3o2OjQ8cQiPb+kVwBCliENXA3sAm6Zj3E/zaq4fD07HmwEmuKYXsUFcDl6Hz7/B1RGfEbPim/bAAAAAElFTkSuQmCC', - } - - TriggerEvent('esx_phone:addSpecialContact', specialContact.name, specialContact.number, specialContact.base64Icon) - + TriggerEvent('esx_phone:addSpecialContact', specialContact.name, specialContact.number, specialContact.base64Icon) end) -- Create Blips Citizen.CreateThread(function() + local blip = AddBlipForCoord(Config.Zones.TaxiActions.Pos.x, Config.Zones.TaxiActions.Pos.y, Config.Zones.TaxiActions.Pos.z) - local blip = AddBlipForCoord(Config.Zones.TaxiActions.Pos.x, Config.Zones.TaxiActions.Pos.y, Config.Zones.TaxiActions.Pos.z) - - SetBlipSprite (blip, 198) - SetBlipDisplay(blip, 4) - SetBlipScale (blip, 1.0) - SetBlipColour (blip, 5) - SetBlipAsShortRange(blip, true) - - BeginTextCommandSetBlipName("STRING") - AddTextComponentString("Taxi") - EndTextCommandSetBlipName(blip) + SetBlipSprite (blip, 198) + SetBlipDisplay(blip, 4) + SetBlipScale (blip, 1.0) + SetBlipColour (blip, 5) + SetBlipAsShortRange(blip, true) + BeginTextCommandSetBlipName("STRING") + AddTextComponentString(_U('blip_taxi')) + EndTextCommandSetBlipName(blip) end) -- Display markers @@ -523,7 +531,7 @@ Citizen.CreateThread(function() if PlayerData.job ~= nil and PlayerData.job.name == 'taxi' then - local coords = GetEntityCoords(GetPlayerPed(-1)) + local coords = GetEntityCoords(PlayerPedId()) 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 @@ -544,7 +552,7 @@ Citizen.CreateThread(function() if PlayerData.job ~= nil and PlayerData.job.name == 'taxi' then - local coords = GetEntityCoords(GetPlayerPed(-1)) + local coords = GetEntityCoords(PlayerPedId()) local isInMarker = false local currentZone = nil @@ -578,7 +586,7 @@ Citizen.CreateThread(function() Citizen.Wait(0) - local playerPed = GetPlayerPed(-1) + local playerPed = PlayerPedId() if OnJob then @@ -791,14 +799,16 @@ Citizen.CreateThread(function() if CurrentAction ~= nil then - SetTextComponentFormat('STRING') - AddTextComponentString(CurrentActionMsg) - DisplayHelpTextFromStringLabel(0, 0, 1, -1) + ESX.ShowHelpNotification(CurrentActionMsg) if IsControlJustReleased(0, Keys['E']) and PlayerData.job ~= nil and PlayerData.job.name == 'taxi' then if CurrentAction == 'taxi_actions_menu' then OpenTaxiActionsMenu() + elseif CurrentAction == 'cloakroom' then + OpenCloakroom() + elseif CurrentAction == 'vehicle_spawner' then + OpenVehicleSpawnerMenu() elseif CurrentAction == 'delete_vehicle' then local playerPed = PlayerPedId() @@ -806,6 +816,7 @@ Citizen.CreateThread(function() if Config.EnableSocietyOwnedVehicles then local vehicleProps = ESX.Game.GetVehicleProperties(CurrentActionData.vehicle) TriggerServerEvent('esx_society:putVehicleInGarage', 'taxi', vehicleProps) + ESX.Game.DeleteVehicle(CurrentActionData.vehicle) else if GetEntityModel(CurrentActionData.vehicle) == GetHashKey('taxi') then ESX.Game.DeleteVehicle(CurrentActionData.vehicle) diff --git a/config.lua b/config.lua index 967a3c24..c5e42df9 100644 --- a/config.lua +++ b/config.lua @@ -6,26 +6,50 @@ Config.EnablePlayerManagement = false Config.EnableSocietyOwnedVehicles = false Config.Locale = 'en' +Config.AuthorizedVehicles = { + + { + model = 'taxi', + label = 'Taxi' + } + +} + Config.Zones = { - TaxiActions = { - Pos = {x = 915.039, y = -162.187, z = 73.684}, - Size = {x = 1.5, y = 1.5, z = 1.0}, - Color = {r = 204, g = 204, b = 0}, - Type = 1 + VehicleSpawner = { + Pos = {x = 915.039, y = -162.187, z = 73.684}, + Size = {x = 1.5, y = 1.5, z = 1.0}, + Color = {r = 204, g = 204, b = 0}, + Type = 1 }, VehicleSpawnPoint = { - Pos = {x = 911.108, y = -177.867, z = 74.283}, - Size = {x = 1.5, y = 1.5, z = 1.0}, - Type = -1 + Pos = {x = 911.108, y = -177.867, z = 74.283}, + Size = {x = 1.5, y = 1.5, z = 1.0}, + Type = -1, + Heading = 225.0 }, VehicleDeleter = { Pos = {x = 908.317, y = -183.070, z = 73.201}, Size = {x = 3.0, y = 3.0, z = 1.0}, + Color = {r = 255, g = 0, b = 0}, + Type = 1 + }, + + TaxiActions = { + Pos = {x = 903.32, y = -170.55, z = 73.00}, + Size = {x = 1.5, y = 1.5, z = 1.0}, Color = {r = 204, g = 204, b = 0}, Type = 1 + }, + + Cloakroom = { + Pos = {x = 894.88, y = -180.23, z = 73.50}, + Size = {x = 1.5, y = 1.5, z = 1.0}, + Color = {r = 204, g = 204, b = 0}, + Type = 1 } } diff --git a/locales/br.lua b/locales/br.lua index cc709de2..714c9a79 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -1,13 +1,24 @@ Locales['br'] = { - ['taking_service'] = 'Pegando serviço: ', + -- cloakroom + ['cloakroom_menu'] = 'cloakroom', + ['cloakroom_prompt'] = 'press ~INPUT_CONTEXT~ to open the ~y~cloakroom~s~.', + ['wear_citizen'] = 'citizen wear', + ['wear_work'] = 'taxi wear', + + -- garage + ['spawner_prompt'] = 'press ~INPUT_CONTEXT~ to open the ~y~garage~s~.', + ['store_veh'] = 'Pressione ~INPUT_CONTEXT~ para guardar o veículo', ['spawn_veh'] = 'pegar veículo', + ['spawnpoint_blocked'] = 'there is a vehicle blocking the spawnpoint!', + ['only_taxi'] = 'Você só pode guardar taxis.', + + ['taking_service'] = 'Pegando serviço: ', ['full_service'] = 'Serviço completo: ', ['amount_invalid'] = 'Valor inválido', ['press_to_open'] = 'Pressione ~INPUT_CONTEXT~ para acessar o menu', ['billing'] = 'Faturamento', ['invoice_amount'] = 'Valor da fatura', ['no_players_near'] = 'Nenhum jogador nas proximidades', - ['store_veh'] = 'Pressione ~INPUT_CONTEXT~ para guardar o veículo', ['drive_search_pass'] = 'Dirigindo em busca de ~y~passageiros', ['customer_found'] = 'Você ~g~encontrou~s~ um passageiro, dirija até o destino', ['client_unconcious'] = 'Seu passageiro está ~r~insconsciente~w~. Procure por outro.', @@ -16,8 +27,6 @@ Locales['br'] = { ['take_me_to'] = '~w~Leve me para~y~ %s', ['close_to_client'] = 'Você está perto do passageiro, aproximisse dele', ['return_to_veh'] = 'Volte para o seu veículo para continuar a missão', - ['only_taxi'] = 'Você só pode guardar taxis.', - ['spawnpoint_blocked'] = 'there is a vehicle blocking the spawnpoint!', ['must_in_taxi'] = 'Você deve estar em um táxi para começar a missão', ['must_in_vehicle'] = 'Você deve estar em um veículo para começar a missão', ['have_earned'] = 'Você ganhou ~g~$%s~s~', @@ -33,4 +42,5 @@ Locales['br'] = { ['have_withdrawn'] = 'você retirou ~y~x%s~s~ ~b~%s~s~', ['have_deposited'] = 'você depositou ~y~x%s~s~ ~b~%s~s~', ['player_cannot_hold'] = 'você não tem espaço suficiente em seu inventário!', + ['blip_taxi'] = 'taxi', } \ No newline at end of file diff --git a/locales/de.lua b/locales/de.lua index 78c09f30..0af860aa 100644 --- a/locales/de.lua +++ b/locales/de.lua @@ -1,13 +1,24 @@ Locales['de'] = { - ['taking_service'] = 'Service annehmen: ', + -- cloakroom + ['cloakroom_menu'] = 'cloakroom', + ['cloakroom_prompt'] = 'press ~INPUT_CONTEXT~ to open the ~y~cloakroom~s~.', + ['wear_citizen'] = 'citizen wear', + ['wear_work'] = 'taxi wear', + + -- garage + ['spawner_prompt'] = 'press ~INPUT_CONTEXT~ to open the ~y~garage~s~.', + ['store_veh'] = 'Drücke ~INPUT_CONTEXT~ um das Fahrzeug zu parken', ['spawn_veh'] = 'Fahrzeug spawnen', + ['spawnpoint_blocked'] = 'there is a vehicle blocking the spawnpoint!', + ['only_taxi'] = 'Du kannst nur Taxis parken.', + + ['taking_service'] = 'Service annehmen: ', ['full_service'] = 'Voller Service: ', ['amount_invalid'] = 'Betrag ungültig', ['press_to_open'] = 'Drücke ~INPUT_CONTEXT~ um das Menü zu öffnen', ['billing'] = 'Rechnung', ['invoice_amount'] = 'Rechnugsbetrag', ['no_players_near'] = 'Kein Spieler in der Nähe', - ['store_veh'] = 'Drücke ~INPUT_CONTEXT~ um das Fahrzeug zu parken', ['drive_search_pass'] = 'Auf der Suche nach ~y~Passagieren', ['customer_found'] = 'du hast einen Passagier ~g~gefunden~s~ , Fahre in zum Ziel', ['client_unconcious'] = 'dein Passagier ist ~r~bewusstlos~s~. Suche nach einem anderen.', @@ -16,8 +27,6 @@ Locales['de'] = { ['take_me_to'] = '~s~Bring mich nach~y~ %s', ['close_to_client'] = 'du bist nahe an dem Passagier, du musst noch näher ran', ['return_to_veh'] = 'bitte kehre zu deinem Fahezeug zurück umd die Mission fortzuführen', - ['only_taxi'] = 'Du kannst nur Taxis parken.', - ['spawnpoint_blocked'] = 'there is a vehicle blocking the spawnpoint!', ['must_in_taxi'] = 'Du musst in einem Taxis sein umd die Mission starten zu können', ['must_in_vehicle'] = 'Du musst in einem Fahrzeug sein um die Mission starten zu können', ['have_earned'] = 'verdient ~g~$%s~s~', @@ -33,4 +42,5 @@ Locales['de'] = { ['have_withdrawn'] = 'you have withdrawn ~y~x%s~s~ ~b~%s~s~', ['have_deposited'] = 'you have deposited ~y~x%s~s~ ~b~%s~s~', ['player_cannot_hold'] = 'you do ~r~not~s~ have enough ~y~free space~s~ in your inventory!', + ['blip_taxi'] = 'taxi', } \ No newline at end of file diff --git a/locales/en.lua b/locales/en.lua index 7980d803..e749d5d4 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -1,13 +1,24 @@ Locales['en'] = { - ['taking_service'] = 'taking service: ', + -- cloakroom + ['cloakroom_menu'] = 'cloakroom', + ['cloakroom_prompt'] = 'press ~INPUT_CONTEXT~ to open the ~y~cloakroom~s~.', + ['wear_citizen'] = 'citizen wear', + ['wear_work'] = 'taxi wear', + + -- garage + ['spawner_prompt'] = 'press ~INPUT_CONTEXT~ to open the ~y~garage~s~.', + ['store_veh'] = 'press ~INPUT_CONTEXT~ to store the vehicle', ['spawn_veh'] = 'spawn vehicle', + ['spawnpoint_blocked'] = 'there is a vehicle blocking the spawnpoint!', + ['only_taxi'] = 'you can only store taxis.', + + ['taking_service'] = 'taking service: ', ['full_service'] = 'full service: ', ['amount_invalid'] = 'amount invalid', ['press_to_open'] = 'press ~INPUT_CONTEXT~ to access the menu', ['billing'] = 'billing', ['invoice_amount'] = 'invoice amount', ['no_players_near'] = 'no players nearby', - ['store_veh'] = 'press ~INPUT_CONTEXT~ to store the vehicle', ['drive_search_pass'] = 'driving in search of ~y~passengers', ['customer_found'] = 'you have ~g~found~s~ a customer, drive until last', ['client_unconcious'] = 'your client is ~r~unconscious~s~. Look for another one.', @@ -16,8 +27,6 @@ Locales['en'] = { ['take_me_to'] = '~s~Take me to ~y~%s', ['close_to_client'] = 'you are too far from the client, get close to them', ['return_to_veh'] = 'please return to your vehicle to continue the mission', - ['only_taxi'] = 'you can only store taxis.', - ['spawnpoint_blocked'] = 'there is a vehicle blocking the spawnpoint!', ['must_in_taxi'] = 'you must be in a taxi to start the mission', ['must_in_vehicle'] = 'you must be in a vehicle to begin the mission', ['have_earned'] = 'you have earned ~g~$%s~s~', @@ -33,4 +42,5 @@ Locales['en'] = { ['have_withdrawn'] = 'you have withdrawn ~y~x%s~s~ ~b~%s~s~', ['have_deposited'] = 'you have deposited ~y~x%s~s~ ~b~%s~s~', ['player_cannot_hold'] = 'you do ~r~not~s~ have enough ~y~free space~s~ in your inventory!', + ['blip_taxi'] = 'taxi', } \ No newline at end of file diff --git a/locales/fi.lua b/locales/fi.lua index 30c0c4c3..243f5e77 100644 --- a/locales/fi.lua +++ b/locales/fi.lua @@ -1,13 +1,24 @@ Locales['fi'] = { - ['taking_service'] = 'Aloitetaan työ: ', + -- cloakroom + ['cloakroom_menu'] = 'cloakroom', + ['cloakroom_prompt'] = 'press ~INPUT_CONTEXT~ to open the ~y~cloakroom~s~.', + ['wear_citizen'] = 'citizen wear', + ['wear_work'] = 'taxi wear', + + -- garage + ['spawner_prompt'] = 'press ~INPUT_CONTEXT~ to open the ~y~garage~s~.', + ['store_veh'] = 'paina ~INPUT_CONTEXT~ laittaaksesi auto talliin', ['spawn_veh'] = 'spawnaa ajoneuvo', + ['spawnpoint_blocked'] = 'there is a vehicle blocking the spawnpoint!', + ['only_taxi'] = 'Voit vain tallettaa taxeja', + + ['taking_service'] = 'Aloitetaan työ: ', ['full_service'] = 'täysi palvelu: ', ['amount_invalid'] = 'virheellinen summa', ['press_to_open'] = 'paina ~INPUT_CONTEXT~ avataksesi valikko', ['billing'] = 'Laskutus', ['invoice_amount'] = 'laskun määrä', ['no_players_near'] = 'ei pelaajia lähellä', - ['store_veh'] = 'paina ~INPUT_CONTEXT~ laittaaksesi auto talliin', ['drive_search_pass'] = 'Ajele ympäriinsä etsi uusia ~y~asiakkaita', ['customer_found'] = 'Sinä ~g~löysit~s~ asiakkaan, aja lähemmäksi', ['client_unconcious'] = 'Sinun asiakkaasi on ~r~tajuton~s~. Etsi uusi.', @@ -16,8 +27,6 @@ Locales['fi'] = { ['take_me_to'] = '~s~Vie minut~y~ %s', ['close_to_client'] = 'Olet asiakkaan lähellä, mene lähemmäksi', ['return_to_veh'] = 'Mene takaisin ajoneuvoon, jatkaaksesi töitä', - ['only_taxi'] = 'Voit vain tallettaa taxeja', - ['spawnpoint_blocked'] = 'there is a vehicle blocking the spawnpoint!', ['must_in_taxi'] = 'Sinun pitää olla taxissa että voit alottaa työn', ['must_in_vehicle'] = 'Sinun pitää olla ajoneuvossa että voit alottaa työn', ['have_earned'] = 'Sinä tienasit ~g~€%s~s~', @@ -33,4 +42,5 @@ Locales['fi'] = { ['have_withdrawn'] = 'sinä nostit ~y~x%s~s~ ~b~%s~s~', ['have_deposited'] = 'sinä talletit ~y~x%s~s~ ~b~%s~s~', ['player_cannot_hold'] = 'sinulla ~r~ei ole~s~ enempää ~y~vapaata tilaa~s~ repussasi!', -} + ['blip_taxi'] = 'taxi', +} \ No newline at end of file diff --git a/locales/fr.lua b/locales/fr.lua index 0038ec6a..cc1a381c 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -1,13 +1,24 @@ Locales['fr'] = { - ['taking_service'] = 'prise de service : ', + -- cloakroom + ['cloakroom_menu'] = 'cloakroom', + ['cloakroom_prompt'] = 'press ~INPUT_CONTEXT~ to open the ~y~cloakroom~s~.', + ['wear_citizen'] = 'citizen wear', + ['wear_work'] = 'taxi wear', + + -- garage + ['spawner_prompt'] = 'press ~INPUT_CONTEXT~ to open the ~y~garage~s~.', + ['store_veh'] = 'appuyez sur ~INPUT_CONTEXT~ pour ranger le véhicule', ['spawn_veh'] = 'sortir véhicule', + ['spawnpoint_blocked'] = 'there is a vehicle blocking the spawnpoint!', + ['only_taxi'] = 'vous ne pouvez ranger que les taxi', + + ['taking_service'] = 'prise de service : ', ['full_service'] = 'service complet : ', ['amount_invalid'] = 'montant invalide', ['press_to_open'] = 'appuyez sur ~INPUT_CONTEXT~ pour accéder au menu', ['billing'] = 'facuration', ['invoice_amount'] = 'montant de la facture', ['no_players_near'] = 'aucun joueur à proximité', - ['store_veh'] = 'appuyez sur ~INPUT_CONTEXT~ pour ranger le véhicule', ['drive_search_pass'] = 'conduisez à la recherche de ~y~passagers', ['customer_found'] = 'vous avez ~g~trouvé~s~ un client, conduisez jusqu\'à ce dernier', ['client_unconcious'] = 'votre client est ~r~inconscient~w~. Cherchez-en un autre.', @@ -16,8 +27,6 @@ Locales['fr'] = { ['take_me_to'] = '~w~Emmenez-moi à~y~ %s', ['close_to_client'] = 'vous êtes à proximité du client, approchez-vous de lui', ['return_to_veh'] = 'veuillez remonter dans votre véhicule pour continuer la mission', - ['only_taxi'] = 'vous ne pouvez ranger que les taxi', - ['spawnpoint_blocked'] = 'there is a vehicle blocking the spawnpoint!', ['must_in_taxi'] = 'vous devez être dans un taxi pour commencer la mission', ['must_in_vehicle'] = 'vous devez être dans un véhicule pour commencer la mission', ['have_earned'] = 'vous avez gagné ~g~$%s~s~', @@ -33,4 +42,5 @@ Locales['fr'] = { ['have_withdrawn'] = 'vous avez pris ~y~x%s~s~ ~b~%s~s~', ['have_deposited'] = 'vous avez déposé ~y~x%s~s~ ~b~%s~s~', ['player_cannot_hold'] = 'vous n\'avez pas assez ~y~de place~s~ dans votre inventaire!', -} + ['blip_taxi'] = 'taxi', +} \ No newline at end of file diff --git a/locales/pl.lua b/locales/pl.lua index 0884c76f..3d3e0a06 100644 --- a/locales/pl.lua +++ b/locales/pl.lua @@ -1,13 +1,24 @@ Locales['pl'] = { - ['taking_service'] = 'przyjmowanie usługi: ', + -- cloakroom + ['cloakroom_menu'] = 'cloakroom', + ['cloakroom_prompt'] = 'press ~INPUT_CONTEXT~ to open the ~y~cloakroom~s~.', + ['wear_citizen'] = 'citizen wear', + ['wear_work'] = 'taxi wear', + + -- garage + ['spawner_prompt'] = 'press ~INPUT_CONTEXT~ to open the ~y~garage~s~.', + ['store_veh'] = 'naciśnij ~INPUT_CONTEXT~ aby zdać pojazd', ['spawn_veh'] = 'sprowadź pojazd', + ['spawnpoint_blocked'] = 'there is a vehicle blocking the spawnpoint!', + ['only_taxi'] = 'możesz przechowywać tylko taksówki.', + + ['taking_service'] = 'przyjmowanie usługi: ', ['full_service'] = 'pełny serwis: ', ['amount_invalid'] = 'wartość nieprawidłowa', ['press_to_open'] = 'naciśnij ~INPUT_CONTEXT~ aby wejść do menu', ['billing'] = 'rachunek', ['invoice_amount'] = 'wartość należności', ['no_players_near'] = 'brak graczy w pobliżu', - ['store_veh'] = 'naciśnij ~INPUT_CONTEXT~ aby zdać pojazd', ['drive_search_pass'] = 'jazda w poszukiwaniu ~y~pasażerów', ['customer_found'] = '~g~Znalazłeś~s~ klienta, jedź do niego', ['client_unconcious'] = 'twój jest ~r~nieprzytomny xD~s~. Poszukaj innego.', @@ -16,8 +27,6 @@ Locales['pl'] = { ['take_me_to'] = '~s~Weź mnie do~y~ %s', ['close_to_client'] = 'jesteś blisko klienta, podjedź do niego bliżej', ['return_to_veh'] = 'proszę wróć do swojego pojazdu aby kontynuować misję', - ['only_taxi'] = 'możesz przechowywać tylko taksówki.', - ['spawnpoint_blocked'] = 'there is a vehicle blocking the spawnpoint!', ['must_in_taxi'] = 'musisz być w taksówce aby rozpocząć misję', ['must_in_vehicle'] = 'musisz być w pojeździe aby rozpocząć misję', ['have_earned'] = 'zarobiłeś ~g~$%s~s~', @@ -33,4 +42,5 @@ Locales['pl'] = { ['have_withdrawn'] = 'wyciągnąłeś/aś ~y~x%s~s~ ~b~%s~s~', ['have_deposited'] = 'zdeponowałeś/aś ~y~x%s~s~ ~b~%s~s~', ['player_cannot_hold'] = '~r~Nie~s~ masz wystarczająco ~y~wolnego miejsca~s~ w swoim ekwipunku!', -} + ['blip_taxi'] = 'taxi', +} \ No newline at end of file diff --git a/locales/sv.lua b/locales/sv.lua index 9c207d21..92427b3e 100644 --- a/locales/sv.lua +++ b/locales/sv.lua @@ -1,13 +1,23 @@ Locales['sv'] = { - ['taking_service'] = 'du deltog tjänst: ', + -- cloakroom + ['cloakroom_menu'] = 'omklädningsrum', + ['cloakroom_prompt'] = 'tryck ~INPUT_CONTEXT~ för att öppna ~y~omklädningsrummet~s~.', + ['wear_citizen'] = 'civila kläder', + ['wear_work'] = 'taxikläder', + + -- garage + ['spawner_prompt'] = 'tryck ~INPUT_CONTEXT~ för att öppna ~y~garaget~s~.', + ['store_veh'] = 'tryck ~INPUT_CONTEXT~ för att ~y~spara~s~ fordonet.', ['spawn_veh'] = 'plocka ut taxi', + ['spawnpoint_blocked'] = 'det är ett fordon som blockerar spawnpointen!', + ['only_taxi'] = 'du kan endast lagra ~y~taxi fordon~s~ här..', + ['taking_service'] = 'du deltog tjänst: ', ['full_service'] = 'du kan inte delta tjänst: ', ['amount_invalid'] = 'ogiltig mängd!', ['press_to_open'] = 'tryck ~INPUT_CONTEXT~ för att öppna menyn.', ['billing'] = 'skapa räkning', ['invoice_amount'] = 'faktureringsbelopp', ['no_players_near'] = 'det finns ingen spelare i närheten!', - ['store_veh'] = 'tryck ~INPUT_CONTEXT~ för att ~y~spara~s~ fordonet.', ['drive_search_pass'] = 'åk runt för att hitta ~y~kunder~s~', ['customer_found'] = 'du har ~g~hittat~s~ en kund!', ['client_unconcious'] = 'din kund är ~r~medvetslös~s~. Hitta en ny.', @@ -16,8 +26,6 @@ Locales['sv'] = { ['take_me_to'] = '~s~Ta mig till ~y~%s~s~', ['close_to_client'] = 'åk närmare din kund!', ['return_to_veh'] = 'vänligen återvänd till ditt fordon och återuppta körningen.', - ['only_taxi'] = 'du kan endast lagra ~y~taxi fordon~s~ här..', - ['spawnpoint_blocked'] = 'det är ett fordon som blockerar spawnpointen!', ['must_in_taxi'] = 'du måste vara i en ~y~taxi~s~ för att starta uppdraget.', ['must_in_vehicle'] = 'du måste vara i ett ~b~fordon~s~ för att starta uppdraget.', ['have_earned'] = 'du har tjärnat ~g~%s SEK~s~', @@ -33,4 +41,5 @@ Locales['sv'] = { ['have_withdrawn'] = 'du har tagit ut ~y~x%s~s~ ~b~%s~s~', ['have_deposited'] = 'du har lagrat ~y~x%s~s~ ~b~%s~s~', ['player_cannot_hold'] = 'du har ~r~inte~s~ tillräckligt med ~y~utrymme~s~ för att hålla det!', + ['blip_taxi'] = 'taxifirman', } \ No newline at end of file From 903be46d31431d711bb5fad79451eeae636f9dae Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Mon, 13 Aug 2018 13:48:13 +0200 Subject: [PATCH 58/93] Added sql clothes --- client/main.lua | 2 +- esx_taxijob.sql | 10 +++++----- localization/de_esx_taxijob.sql | 10 +++++----- localization/en_esx_taxijob.sql | 10 +++++----- localization/fi_esx_taxijob.sql | 10 +++++----- localization/pl_esx_taxijob.sql | 10 +++++----- localization/sv_esx_taxijob.sql | 25 +++++++++++++++++++++++++ 7 files changed, 51 insertions(+), 26 deletions(-) create mode 100644 localization/sv_esx_taxijob.sql diff --git a/client/main.lua b/client/main.lua index a608379a..1ed4ab50 100644 --- a/client/main.lua +++ b/client/main.lua @@ -145,7 +145,7 @@ function OpenCloakroom() ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin) TriggerEvent('skinchanger:loadSkin', skin) end) - elseif data.current.value == 'wear_citizen' then + elseif data.current.value == 'wear_work' then ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) if skin.sex == 0 then TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_male) diff --git a/esx_taxijob.sql b/esx_taxijob.sql index efa33acb..37047ac2 100644 --- a/esx_taxijob.sql +++ b/esx_taxijob.sql @@ -17,9 +17,9 @@ INSERT INTO `jobs` (name, label) VALUES ; INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES - ('taxi',0,'recrue','Recrue',12,'{}','{}'), - ('taxi',1,'novice','Novice',24,'{}','{}'), - ('taxi',2,'experimente','Experimente',36,'{}','{}'), - ('taxi',3,'uber','Uber',48,'{}','{}'), - ('taxi',4,'boss','Patron',0,'{}','{}') + ('taxi',0,'recrue','Recrue',12,'{"hair_2":0,"hair_color_2":0,"torso_1":32,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":0,"age_2":0,"glasses_2":0,"ears_2":0,"arms":27,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',1,'novice','Novice',24,'{"hair_2":0,"hair_color_2":0,"torso_1":32,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":0,"age_2":0,"glasses_2":0,"ears_2":0,"arms":27,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',2,'experimente','Experimente',36,'{"hair_2":0,"hair_color_2":0,"torso_1":26,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":57,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":11,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',3,'uber','Uber',48,'{"hair_2":0,"hair_color_2":0,"torso_1":26,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":57,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":11,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',4,'boss','Patron',0,'{"hair_2":0,"hair_color_2":0,"torso_1":29,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":1,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":4,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}') ; diff --git a/localization/de_esx_taxijob.sql b/localization/de_esx_taxijob.sql index ed416e55..5339916f 100644 --- a/localization/de_esx_taxijob.sql +++ b/localization/de_esx_taxijob.sql @@ -17,9 +17,9 @@ INSERT INTO `jobs` (name, label) VALUES ; INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES - ('taxi',0,'recrue','Rekrut',12,'{}','{}'), - ('taxi',1,'novice','Anfänger',24,'{}','{}'), - ('taxi',2,'experimente','Experte',36,'{}','{}'), - ('taxi',3,'uber','Schichtführer',48,'{}','{}'), - ('taxi',4,'boss','Chef',0,'{}','{}') + ('taxi',0,'recrue','Rekrut',12,'{"hair_2":0,"hair_color_2":0,"torso_1":32,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":0,"age_2":0,"glasses_2":0,"ears_2":0,"arms":27,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',1,'novice','Anfänger',24,'{"hair_2":0,"hair_color_2":0,"torso_1":32,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":0,"age_2":0,"glasses_2":0,"ears_2":0,"arms":27,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',2,'experimente','Experte',36,'{"hair_2":0,"hair_color_2":0,"torso_1":26,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":57,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":11,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',3,'uber','Schichtführer',48,'{"hair_2":0,"hair_color_2":0,"torso_1":26,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":57,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":11,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',4,'boss','Chef',0,'{"hair_2":0,"hair_color_2":0,"torso_1":29,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":1,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":4,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}') ; diff --git a/localization/en_esx_taxijob.sql b/localization/en_esx_taxijob.sql index a904b26b..30eaf93b 100644 --- a/localization/en_esx_taxijob.sql +++ b/localization/en_esx_taxijob.sql @@ -17,9 +17,9 @@ INSERT INTO `jobs` (name, label) VALUES ; INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES - ('taxi',0,'recrue','Recruit',12,'{}','{}'), - ('taxi',1,'novice','Cabby',24,'{}','{}'), - ('taxi',2,'experimente','Experienced',36,'{}','{}'), - ('taxi',3,'uber','Uber Cabby',48,'{}','{}'), - ('taxi',4,'boss','Lead Cabby',0,'{}','{}') + ('taxi',0,'recrue','Recruit',12,'{"hair_2":0,"hair_color_2":0,"torso_1":32,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":0,"age_2":0,"glasses_2":0,"ears_2":0,"arms":27,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',1,'novice','Cabby',24,'{"hair_2":0,"hair_color_2":0,"torso_1":32,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":0,"age_2":0,"glasses_2":0,"ears_2":0,"arms":27,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',2,'experimente','Experienced',36,'{"hair_2":0,"hair_color_2":0,"torso_1":26,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":57,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":11,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',3,'uber','Uber Cabby',48,'{"hair_2":0,"hair_color_2":0,"torso_1":26,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":57,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":11,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',4,'boss','Lead Cabby',0,'{"hair_2":0,"hair_color_2":0,"torso_1":29,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":1,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":4,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}') ; diff --git a/localization/fi_esx_taxijob.sql b/localization/fi_esx_taxijob.sql index 8a4bc1df..8c3a5b66 100644 --- a/localization/fi_esx_taxijob.sql +++ b/localization/fi_esx_taxijob.sql @@ -17,9 +17,9 @@ INSERT INTO `jobs` (name, label) VALUES ; INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES - ('taxi',0,'recrue','Harjottelija',12,'{}','{}'), - ('taxi',1,'novice','Alottelija',24,'{}','{}'), - ('taxi',2,'experimente','Kokenut',36,'{}','{}'), - ('taxi',3,'uber','Uber',48,'{}','{}'), - ('taxi',4,'boss','Pomo',0,'{}','{}') + ('taxi',0,'recrue','Harjottelija',12,'{"hair_2":0,"hair_color_2":0,"torso_1":32,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":0,"age_2":0,"glasses_2":0,"ears_2":0,"arms":27,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',1,'novice','Alottelija',24,'{"hair_2":0,"hair_color_2":0,"torso_1":32,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":0,"age_2":0,"glasses_2":0,"ears_2":0,"arms":27,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',2,'experimente','Kokenut',36,'{"hair_2":0,"hair_color_2":0,"torso_1":26,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":57,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":11,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',3,'uber','Uber',48,'{"hair_2":0,"hair_color_2":0,"torso_1":26,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":57,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":11,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',4,'boss','Pomo',0,'{"hair_2":0,"hair_color_2":0,"torso_1":29,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":1,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":4,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}') ; diff --git a/localization/pl_esx_taxijob.sql b/localization/pl_esx_taxijob.sql index a35d1acf..3abcb442 100644 --- a/localization/pl_esx_taxijob.sql +++ b/localization/pl_esx_taxijob.sql @@ -17,9 +17,9 @@ INSERT INTO `jobs` (name, label) VALUES ; INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES - ('taxi',0,'recrue','Tymczasowy',12,'{}','{}'), - ('taxi',1,'novice','Nowy',24,'{}','{}'), - ('taxi',2,'experimente','Etatowy',36,'{}','{}'), - ('taxi',3,'uber','Uber',48,'{}','{}'), - ('taxi',4,'boss','Właściciel',0,'{}','{}') + ('taxi',0,'recrue','Tymczasowy',12,'{"hair_2":0,"hair_color_2":0,"torso_1":32,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":0,"age_2":0,"glasses_2":0,"ears_2":0,"arms":27,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',1,'novice','Nowy',24,'{"hair_2":0,"hair_color_2":0,"torso_1":32,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":0,"age_2":0,"glasses_2":0,"ears_2":0,"arms":27,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',2,'experimente','Etatowy',36,'{"hair_2":0,"hair_color_2":0,"torso_1":26,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":57,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":11,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',3,'uber','Uber',48,'{"hair_2":0,"hair_color_2":0,"torso_1":26,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":57,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":11,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',4,'boss','Właściciel',0,'{"hair_2":0,"hair_color_2":0,"torso_1":29,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":1,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":4,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}') ; diff --git a/localization/sv_esx_taxijob.sql b/localization/sv_esx_taxijob.sql new file mode 100644 index 00000000..4f36a640 --- /dev/null +++ b/localization/sv_esx_taxijob.sql @@ -0,0 +1,25 @@ +USE `essentialmode`; + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('society_taxi', 'Taxi', 1) +; + +INSERT INTO `datastore` (name, label, shared) VALUES + ('society_taxi', 'Taxi', 1) +; + +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('society_taxi', 'Taxi', 1) +; + +INSERT INTO `jobs` (name, label) VALUES + ('taxi', 'Taxi') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('taxi',0,'recrue','Nyrekryterad',12,'{"hair_2":0,"hair_color_2":0,"torso_1":32,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":0,"age_2":0,"glasses_2":0,"ears_2":0,"arms":27,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',1,'novice','Skicklig förare',24,'{"hair_2":0,"hair_color_2":0,"torso_1":32,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":0,"age_2":0,"glasses_2":0,"ears_2":0,"arms":27,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',2,'experimente','Erfaren förare',36,'{"hair_2":0,"hair_color_2":0,"torso_1":26,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":57,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":11,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',3,'uber','Professionell förare',48,'{"hair_2":0,"hair_color_2":0,"torso_1":26,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":57,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":11,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',4,'boss','Företagsägare',0,'{"hair_2":0,"hair_color_2":0,"torso_1":29,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":1,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":4,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}') +; From 2f3bd4734b91e5f1f06fd0b8176337b2f15773c4 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Mon, 13 Aug 2018 14:20:19 +0200 Subject: [PATCH 59/93] Moved NPC job to F6 menu --- client/main.lua | 157 ++++++++++++++++++++++++------------------------ locales/br.lua | 2 + locales/de.lua | 2 + locales/en.lua | 2 + locales/fi.lua | 2 + locales/fr.lua | 2 + locales/pl.lua | 2 + locales/sv.lua | 5 +- 8 files changed, 96 insertions(+), 78 deletions(-) diff --git a/client/main.lua b/client/main.lua index 1ed4ab50..918b42e3 100644 --- a/client/main.lua +++ b/client/main.lua @@ -279,60 +279,98 @@ end function OpenMobileTaxiActionsMenu() - ESX.UI.Menu.CloseAll() + ESX.UI.Menu.CloseAll() - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'mobile_taxi_actions', - { - title = 'Taxi', - align = 'top-left', - elements = { - {label = _U('billing'), value = 'billing'} - } - }, - function(data, menu) + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'mobile_taxi_actions', + { + title = 'Taxi', + align = 'top-left', + elements = { + { label = _U('billing'), value = 'billing' }, + { label = _U('start_job'), value = 'start_job' } + } + }, function(data, menu) - if data.current.value == 'billing' then + if data.current.value == 'billing' then - ESX.UI.Menu.Open( - 'dialog', GetCurrentResourceName(), 'billing', - { - title = _U('invoice_amount') - }, - function(data, menu) + ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'billing', { + title = _U('invoice_amount') + }, function(data, menu) - local amount = tonumber(data.value) + 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_near')) + else + TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(closestPlayer), 'society_taxi', 'Taxi', amount) + ESX.ShowNotification(_U('billing_sent')) + end - if amount == nil then - ESX.ShowNotification(_U('amount_invalid')) - else + end - menu.close() + end, function(data, menu) + menu.close() + end) - local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer() + elseif data.current.value == 'start_job' then + + if OnJob then + StopTaxiJob() + else - if closestPlayer == -1 or closestDistance > 3.0 then - ESX.ShowNotification(_U('no_players_near')) - else - TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(closestPlayer), 'society_taxi', 'Taxi', amount) - end + if PlayerData.job ~= nil and PlayerData.job.name == 'taxi' then - end + local playerPed = PlayerPedId() + if IsPedInAnyVehicle(playerPed, false) then - end, - function(data, menu) - menu.close() - end - ) + local vehicle = GetVehiclePedIsIn(playerPed, false) + if PlayerData.job.grade >= 3 then + StartTaxiJob() + else + if IsInAuthorizedVehicle() then + StartTaxiJob() + else + ESX.ShowNotification(_U('must_in_taxi')) + end + end - end + else - end, - function(data, menu) - menu.close() - end - ) + if PlayerData.job.grade >= 3 then + ESX.ShowNotification(_U('must_in_vehicle')) + else + ESX.ShowNotification(_U('must_in_taxi')) + end + end + + end + + end + + end + + end, function(data, menu) + menu.close() + end) + +end + +function IsInAuthorizedVehicle() + local playerPed = PlayerPedId() + local vehModel = GetEntityModel(GetVehiclePedIsIn(playerPed, false)) + + for i=1, #Config.AuthorizedVehicles, 1 do + if vehModel == GetHashKey(Config.AuthorizedVehicles[i].model) then + return true + end + end + + return false end function OpenGetStocksMenu() @@ -818,7 +856,7 @@ Citizen.CreateThread(function() TriggerServerEvent('esx_society:putVehicleInGarage', 'taxi', vehicleProps) ESX.Game.DeleteVehicle(CurrentActionData.vehicle) else - if GetEntityModel(CurrentActionData.vehicle) == GetHashKey('taxi') then + if IsInAuthorizedVehicle() then ESX.Game.DeleteVehicle(CurrentActionData.vehicle) if Config.MaxInService ~= -1 then @@ -837,41 +875,6 @@ Citizen.CreateThread(function() if IsControlJustReleased(0, Keys['F6']) and GetLastInputMethod(2) and not IsDead and Config.EnablePlayerManagement and PlayerData.job ~= nil and PlayerData.job.name == 'taxi' then OpenMobileTaxiActionsMenu() - elseif IsControlJustReleased(0, Keys['DELETE']) and GetLastInputMethod(2) and not IsDead then - - if OnJob then - StopTaxiJob() - else - - if PlayerData.job ~= nil and PlayerData.job.name == 'taxi' then - - local playerPed = PlayerPedId() - if IsPedInAnyVehicle(playerPed, false) then - - local vehicle = GetVehiclePedIsIn(playerPed, false) - if PlayerData.job.grade >= 3 then - StartTaxiJob() - else - if GetEntityModel(vehicle) == GetHashKey('taxi') then - StartTaxiJob() - else - ESX.ShowNotification(_U('must_in_taxi')) - end - end - - else - - if PlayerData.job.grade >= 3 then - ESX.ShowNotification(_U('must_in_vehicle')) - else - ESX.ShowNotification(_U('must_in_taxi')) - end - - end - - end - - end end end end) diff --git a/locales/br.lua b/locales/br.lua index 714c9a79..ba064905 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -17,8 +17,10 @@ Locales['br'] = { ['amount_invalid'] = 'Valor inválido', ['press_to_open'] = 'Pressione ~INPUT_CONTEXT~ para acessar o menu', ['billing'] = 'Faturamento', + ['billing_sent'] = 'the bill has been registered!', ['invoice_amount'] = 'Valor da fatura', ['no_players_near'] = 'Nenhum jogador nas proximidades', + ['start_job'] = 'start / stop driving NPC jobs', ['drive_search_pass'] = 'Dirigindo em busca de ~y~passageiros', ['customer_found'] = 'Você ~g~encontrou~s~ um passageiro, dirija até o destino', ['client_unconcious'] = 'Seu passageiro está ~r~insconsciente~w~. Procure por outro.', diff --git a/locales/de.lua b/locales/de.lua index 0af860aa..2b68db63 100644 --- a/locales/de.lua +++ b/locales/de.lua @@ -17,8 +17,10 @@ Locales['de'] = { ['amount_invalid'] = 'Betrag ungültig', ['press_to_open'] = 'Drücke ~INPUT_CONTEXT~ um das Menü zu öffnen', ['billing'] = 'Rechnung', + ['billing_sent'] = 'the bill has been registered!', ['invoice_amount'] = 'Rechnugsbetrag', ['no_players_near'] = 'Kein Spieler in der Nähe', + ['start_job'] = 'start / stop driving NPC jobs', ['drive_search_pass'] = 'Auf der Suche nach ~y~Passagieren', ['customer_found'] = 'du hast einen Passagier ~g~gefunden~s~ , Fahre in zum Ziel', ['client_unconcious'] = 'dein Passagier ist ~r~bewusstlos~s~. Suche nach einem anderen.', diff --git a/locales/en.lua b/locales/en.lua index e749d5d4..c0d6ac20 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -17,8 +17,10 @@ Locales['en'] = { ['amount_invalid'] = 'amount invalid', ['press_to_open'] = 'press ~INPUT_CONTEXT~ to access the menu', ['billing'] = 'billing', + ['billing_sent'] = 'the bill has been registered!', ['invoice_amount'] = 'invoice amount', ['no_players_near'] = 'no players nearby', + ['start_job'] = 'start / stop driving NPC jobs', ['drive_search_pass'] = 'driving in search of ~y~passengers', ['customer_found'] = 'you have ~g~found~s~ a customer, drive until last', ['client_unconcious'] = 'your client is ~r~unconscious~s~. Look for another one.', diff --git a/locales/fi.lua b/locales/fi.lua index 243f5e77..f11f442b 100644 --- a/locales/fi.lua +++ b/locales/fi.lua @@ -17,8 +17,10 @@ Locales['fi'] = { ['amount_invalid'] = 'virheellinen summa', ['press_to_open'] = 'paina ~INPUT_CONTEXT~ avataksesi valikko', ['billing'] = 'Laskutus', + ['billing_sent'] = 'the bill has been registered!', ['invoice_amount'] = 'laskun määrä', ['no_players_near'] = 'ei pelaajia lähellä', + ['start_job'] = 'start / stop driving NPC jobs', ['drive_search_pass'] = 'Ajele ympäriinsä etsi uusia ~y~asiakkaita', ['customer_found'] = 'Sinä ~g~löysit~s~ asiakkaan, aja lähemmäksi', ['client_unconcious'] = 'Sinun asiakkaasi on ~r~tajuton~s~. Etsi uusi.', diff --git a/locales/fr.lua b/locales/fr.lua index cc1a381c..d6b4d58f 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -17,8 +17,10 @@ Locales['fr'] = { ['amount_invalid'] = 'montant invalide', ['press_to_open'] = 'appuyez sur ~INPUT_CONTEXT~ pour accéder au menu', ['billing'] = 'facuration', + ['billing_sent'] = 'the bill has been registered!', ['invoice_amount'] = 'montant de la facture', ['no_players_near'] = 'aucun joueur à proximité', + ['start_job'] = 'start / stop driving NPC jobs', ['drive_search_pass'] = 'conduisez à la recherche de ~y~passagers', ['customer_found'] = 'vous avez ~g~trouvé~s~ un client, conduisez jusqu\'à ce dernier', ['client_unconcious'] = 'votre client est ~r~inconscient~w~. Cherchez-en un autre.', diff --git a/locales/pl.lua b/locales/pl.lua index 3d3e0a06..f3430079 100644 --- a/locales/pl.lua +++ b/locales/pl.lua @@ -17,8 +17,10 @@ Locales['pl'] = { ['amount_invalid'] = 'wartość nieprawidłowa', ['press_to_open'] = 'naciśnij ~INPUT_CONTEXT~ aby wejść do menu', ['billing'] = 'rachunek', + ['billing_sent'] = 'the bill has been registered!', ['invoice_amount'] = 'wartość należności', ['no_players_near'] = 'brak graczy w pobliżu', + ['start_job'] = 'start / stop driving NPC jobs', ['drive_search_pass'] = 'jazda w poszukiwaniu ~y~pasażerów', ['customer_found'] = '~g~Znalazłeś~s~ klienta, jedź do niego', ['client_unconcious'] = 'twój jest ~r~nieprzytomny xD~s~. Poszukaj innego.', diff --git a/locales/sv.lua b/locales/sv.lua index 92427b3e..79eff121 100644 --- a/locales/sv.lua +++ b/locales/sv.lua @@ -11,14 +11,17 @@ Locales['sv'] = { ['spawn_veh'] = 'plocka ut taxi', ['spawnpoint_blocked'] = 'det är ett fordon som blockerar spawnpointen!', ['only_taxi'] = 'du kan endast lagra ~y~taxi fordon~s~ här..', + ['taking_service'] = 'du deltog tjänst: ', ['full_service'] = 'du kan inte delta tjänst: ', ['amount_invalid'] = 'ogiltig mängd!', ['press_to_open'] = 'tryck ~INPUT_CONTEXT~ för att öppna menyn.', ['billing'] = 'skapa räkning', + ['billing_sent'] = 'räkningen har registrerats!', ['invoice_amount'] = 'faktureringsbelopp', ['no_players_near'] = 'det finns ingen spelare i närheten!', - ['drive_search_pass'] = 'åk runt för att hitta ~y~kunder~s~', + ['start_job'] = 'starta / sluta köra NPC', + ['drive_search_pass'] = 'Åtk runt för att hitta ~y~kunder~s~', ['customer_found'] = 'du har ~g~hittat~s~ en kund!', ['client_unconcious'] = 'din kund är ~r~medvetslös~s~. Hitta en ny.', ['arrive_dest'] = 'du har ~g~anlänt~s~ till din destination', From e76cd892f6672cd3d8e9eb4244488e991114b510 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Mon, 13 Aug 2018 14:25:15 +0200 Subject: [PATCH 60/93] Improve PlayerData --- client/main.lua | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/client/main.lua b/client/main.lua index 918b42e3..82a33632 100644 --- a/client/main.lua +++ b/client/main.lua @@ -10,7 +10,6 @@ local Keys = { ["NENTER"] = 201, ["N4"] = 108, ["N5"] = 60, ["N6"] = 107, ["N+"] = 96, ["N-"] = 97, ["N7"] = 117, ["N8"] = 61, ["N9"] = 118 } -local PlayerData = {} local HasAlreadyEnteredMarker = false local LastZone = nil local CurrentAction = nil @@ -33,9 +32,12 @@ Citizen.CreateThread(function() TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) Citizen.Wait(0) end - - Citizen.Wait(1000) - PlayerData = ESX.GetPlayerData() + + while ESX.GetPlayerData().job == nil do + Citizen.Wait(10) + end + + ESX.PlayerData = ESX.GetPlayerData() end) function DrawSub(msg, time) @@ -245,7 +247,7 @@ function OpenTaxiActionsMenu() {label = _U('take_stock'), value = 'get_stock'} } - if Config.EnablePlayerManagement and PlayerData.job ~= nil and PlayerData.job.grade_name == 'boss' then + if Config.EnablePlayerManagement and ESX.PlayerData.job ~= nil and ESX.PlayerData.job.grade_name == 'boss' then table.insert(elements, {label = _U('boss_actions'), value = 'boss_actions'}) end @@ -322,13 +324,13 @@ function OpenMobileTaxiActionsMenu() StopTaxiJob() else - if PlayerData.job ~= nil and PlayerData.job.name == 'taxi' then + if ESX.PlayerData.job ~= nil and ESX.PlayerData.job.name == 'taxi' then local playerPed = PlayerPedId() if IsPedInAnyVehicle(playerPed, false) then local vehicle = GetVehiclePedIsIn(playerPed, false) - if PlayerData.job.grade >= 3 then + if ESX.PlayerData.job.grade >= 3 then StartTaxiJob() else if IsInAuthorizedVehicle() then @@ -340,7 +342,7 @@ function OpenMobileTaxiActionsMenu() else - if PlayerData.job.grade >= 3 then + if ESX.PlayerData.job.grade >= 3 then ESX.ShowNotification(_U('must_in_vehicle')) else ESX.ShowNotification(_U('must_in_taxi')) @@ -494,12 +496,12 @@ end RegisterNetEvent('esx:playerLoaded') AddEventHandler('esx:playerLoaded', function(xPlayer) - PlayerData = xPlayer + ESX.PlayerData = xPlayer end) RegisterNetEvent('esx:setJob') AddEventHandler('esx:setJob', function(job) - PlayerData.job = job + ESX.PlayerData.job = job end) AddEventHandler('esx_taxijob:hasEnteredMarker', function(zone) @@ -567,7 +569,7 @@ Citizen.CreateThread(function() Wait(0) - if PlayerData.job ~= nil and PlayerData.job.name == 'taxi' then + if ESX.PlayerData.job ~= nil and ESX.PlayerData.job.name == 'taxi' then local coords = GetEntityCoords(PlayerPedId()) @@ -588,7 +590,7 @@ Citizen.CreateThread(function() Wait(0) - if PlayerData.job ~= nil and PlayerData.job.name == 'taxi' then + if ESX.PlayerData.job ~= nil and ESX.PlayerData.job.name == 'taxi' then local coords = GetEntityCoords(PlayerPedId()) local isInMarker = false @@ -839,7 +841,7 @@ Citizen.CreateThread(function() ESX.ShowHelpNotification(CurrentActionMsg) - if IsControlJustReleased(0, Keys['E']) and PlayerData.job ~= nil and PlayerData.job.name == 'taxi' then + if IsControlJustReleased(0, Keys['E']) and ESX.PlayerData.job ~= nil and ESX.PlayerData.job.name == 'taxi' then if CurrentAction == 'taxi_actions_menu' then OpenTaxiActionsMenu() @@ -873,7 +875,7 @@ Citizen.CreateThread(function() end end - if IsControlJustReleased(0, Keys['F6']) and GetLastInputMethod(2) and not IsDead and Config.EnablePlayerManagement and PlayerData.job ~= nil and PlayerData.job.name == 'taxi' then + if IsControlJustReleased(0, Keys['F6']) and GetLastInputMethod(2) and not IsDead and Config.EnablePlayerManagement and ESX.PlayerData.job ~= nil and ESX.PlayerData.job.name == 'taxi' then OpenMobileTaxiActionsMenu() end end From 54e5775d1a80d4f980e59469a75b89f548b5be43 Mon Sep 17 00:00:00 2001 From: MajorMarcin Date: Tue, 14 Aug 2018 13:04:51 +0200 Subject: [PATCH 61/93] update and fix pl --- locales/pl.lua | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/locales/pl.lua b/locales/pl.lua index f3430079..0a868dbb 100644 --- a/locales/pl.lua +++ b/locales/pl.lua @@ -1,48 +1,46 @@ Locales['pl'] = { -- cloakroom - ['cloakroom_menu'] = 'cloakroom', - ['cloakroom_prompt'] = 'press ~INPUT_CONTEXT~ to open the ~y~cloakroom~s~.', - ['wear_citizen'] = 'citizen wear', - ['wear_work'] = 'taxi wear', - + ['cloakroom_menu'] = 'szatnia', + ['cloakroom_prompt'] = 'naciśnij ~INPUT_CONTEXT~ aby użyć ~y~szatni~s~.', + ['wear_citizen'] = 'strój cywilny', + ['wear_work'] = 'strój pracownika taxi', -- garage - ['spawner_prompt'] = 'press ~INPUT_CONTEXT~ to open the ~y~garage~s~.', + ['spawner_prompt'] = 'naciśnij ~INPUT_CONTEXT~ aby otworzyć ~y~garaż~s~.', ['store_veh'] = 'naciśnij ~INPUT_CONTEXT~ aby zdać pojazd', ['spawn_veh'] = 'sprowadź pojazd', - ['spawnpoint_blocked'] = 'there is a vehicle blocking the spawnpoint!', + ['spawnpoint_blocked'] = 'jakiś pojazd blokuje wyjazd z garażu!', ['only_taxi'] = 'możesz przechowywać tylko taksówki.', - ['taking_service'] = 'przyjmowanie usługi: ', ['full_service'] = 'pełny serwis: ', ['amount_invalid'] = 'wartość nieprawidłowa', ['press_to_open'] = 'naciśnij ~INPUT_CONTEXT~ aby wejść do menu', ['billing'] = 'rachunek', - ['billing_sent'] = 'the bill has been registered!', + ['billing_sent'] = 'rachunek został wystawiony!', ['invoice_amount'] = 'wartość należności', ['no_players_near'] = 'brak graczy w pobliżu', - ['start_job'] = 'start / stop driving NPC jobs', + ['start_job'] = 'rozpocznij / zakończ wykonywanie zadań NPC', ['drive_search_pass'] = 'jazda w poszukiwaniu ~y~pasażerów', - ['customer_found'] = '~g~Znalazłeś~s~ klienta, jedź do niego', - ['client_unconcious'] = 'twój jest ~r~nieprzytomny xD~s~. Poszukaj innego.', - ['arrive_dest'] = '~g~Dojechałeś~s~ do celu', + ['customer_found'] = '~g~Znajdujesz~s~ klienta, jedź do niego', + ['client_unconcious'] = 'klient jest ~r~nieprzytomny~s~. Poszukaj innego.', + ['arrive_dest'] = '~g~Dojeżdżasz~s~ do celu', ['take_me_to_near'] = '~s~Zabierz mnie do~y~ %s~s~, w pobliżu ~y~ %s', ['take_me_to'] = '~s~Weź mnie do~y~ %s', ['close_to_client'] = 'jesteś blisko klienta, podjedź do niego bliżej', ['return_to_veh'] = 'proszę wróć do swojego pojazdu aby kontynuować misję', ['must_in_taxi'] = 'musisz być w taksówce aby rozpocząć misję', ['must_in_vehicle'] = 'musisz być w pojeździe aby rozpocząć misję', - ['have_earned'] = 'zarobiłeś ~g~$%s~s~', - ['comp_earned'] = '- Twoja firma zarobiła ~g~$%s~s~\n- Zarobiłeś ~g~$%s~s~', + ['have_earned'] = 'zarabiasz ~g~$%s~s~', + ['comp_earned'] = '- Twoja firma zarobiła ~g~$%s~s~\n- Zarabiasz ~g~$%s~s~', ['deposit_stock'] = 'depozyt', ['take_stock'] = 'weź depozyt', ['boss_actions'] = 'akcje szefa', ['mission_complete'] = 'misja zakończona', ['quantity'] = 'ilość', ['quantity_invalid'] = 'nieprawidłowa ilość', - ['inventory'] = 'wkwipunek', + ['inventory'] = 'ekwipunek', ['taxi_client'] = 'klient taksówki', - ['have_withdrawn'] = 'wyciągnąłeś/aś ~y~x%s~s~ ~b~%s~s~', - ['have_deposited'] = 'zdeponowałeś/aś ~y~x%s~s~ ~b~%s~s~', + ['have_withdrawn'] = 'wyciągasz ~y~x%s~s~ ~b~%s~s~', + ['have_deposited'] = 'deponujesz ~y~x%s~s~ ~b~%s~s~', ['player_cannot_hold'] = '~r~Nie~s~ masz wystarczająco ~y~wolnego miejsca~s~ w swoim ekwipunku!', ['blip_taxi'] = 'taxi', } \ No newline at end of file From b316cdca4466019933cc5794d3d8881e165ed06c Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Tue, 14 Aug 2018 17:32:44 +0200 Subject: [PATCH 62/93] Only let drivers start npc job --- client/main.lua | 2 +- locales/sv.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/main.lua b/client/main.lua index 82a33632..dceca4a2 100644 --- a/client/main.lua +++ b/client/main.lua @@ -327,7 +327,7 @@ function OpenMobileTaxiActionsMenu() if ESX.PlayerData.job ~= nil and ESX.PlayerData.job.name == 'taxi' then local playerPed = PlayerPedId() - if IsPedInAnyVehicle(playerPed, false) then + if IsPedInAnyVehicle(playerPed, false) and GetPedInVehicleSeat(vehicle, -1) == playerPed then local vehicle = GetVehiclePedIsIn(playerPed, false) if ESX.PlayerData.job.grade >= 3 then diff --git a/locales/sv.lua b/locales/sv.lua index 79eff121..8f643f20 100644 --- a/locales/sv.lua +++ b/locales/sv.lua @@ -21,7 +21,7 @@ Locales['sv'] = { ['invoice_amount'] = 'faktureringsbelopp', ['no_players_near'] = 'det finns ingen spelare i närheten!', ['start_job'] = 'starta / sluta köra NPC', - ['drive_search_pass'] = 'Åtk runt för att hitta ~y~kunder~s~', + ['drive_search_pass'] = 'Åk runt för att hitta ~y~kunder~s~', ['customer_found'] = 'du har ~g~hittat~s~ en kund!', ['client_unconcious'] = 'din kund är ~r~medvetslös~s~. Hitta en ny.', ['arrive_dest'] = 'du har ~g~anlänt~s~ till din destination', From 5ef9e2c0ddb2ab757f59641ae90c080ac9dc3f64 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sat, 25 Aug 2018 18:16:09 +0200 Subject: [PATCH 63/93] Fixes #21, closes #22 --- client/main.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/main.lua b/client/main.lua index dceca4a2..ea2f2e6e 100644 --- a/client/main.lua +++ b/client/main.lua @@ -327,9 +327,10 @@ function OpenMobileTaxiActionsMenu() if ESX.PlayerData.job ~= nil and ESX.PlayerData.job.name == 'taxi' then local playerPed = PlayerPedId() + local vehicle = GetVehiclePedIsIn(playerPed, false) + if IsPedInAnyVehicle(playerPed, false) and GetPedInVehicleSeat(vehicle, -1) == playerPed then - local vehicle = GetVehiclePedIsIn(playerPed, false) if ESX.PlayerData.job.grade >= 3 then StartTaxiJob() else From 4a9852e9827c3cd795ca38dae1f405fb846ba27d Mon Sep 17 00:00:00 2001 From: TanguyOrtegat Date: Sun, 2 Sep 2018 22:53:01 +0200 Subject: [PATCH 64/93] fix compare string with number --- client/main.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/main.lua b/client/main.lua index ea2f2e6e..47df0b24 100644 --- a/client/main.lua +++ b/client/main.lua @@ -331,7 +331,7 @@ function OpenMobileTaxiActionsMenu() if IsPedInAnyVehicle(playerPed, false) and GetPedInVehicleSeat(vehicle, -1) == playerPed then - if ESX.PlayerData.job.grade >= 3 then + if tonumber(ESX.PlayerData.job.grade) >= 3 then StartTaxiJob() else if IsInAuthorizedVehicle() then @@ -343,7 +343,7 @@ function OpenMobileTaxiActionsMenu() else - if ESX.PlayerData.job.grade >= 3 then + if tonumber(ESX.PlayerData.job.grade) >= 3 then ESX.ShowNotification(_U('must_in_vehicle')) else ESX.ShowNotification(_U('must_in_taxi')) @@ -888,4 +888,4 @@ end) AddEventHandler('playerSpawned', function(spawn) IsDead = false -end) \ No newline at end of file +end) From 07a0403a890eb235a505f37b612729ccfc930834 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Thu, 11 Oct 2018 21:15:37 +0200 Subject: [PATCH 65/93] Proper tab indent --- client/main.lua | 722 +++++++++++++++++++++--------------------------- locales/br.lua | 2 +- locales/de.lua | 2 +- locales/en.lua | 2 +- locales/fi.lua | 2 +- locales/fr.lua | 2 +- locales/pl.lua | 4 +- locales/sv.lua | 2 +- 8 files changed, 319 insertions(+), 419 deletions(-) diff --git a/client/main.lua b/client/main.lua index 47df0b24..16b2f37b 100644 --- a/client/main.lua +++ b/client/main.lua @@ -41,52 +41,49 @@ Citizen.CreateThread(function() end) function DrawSub(msg, time) - ClearPrints() - SetTextEntry_2("STRING") - AddTextComponentString(msg) - DrawSubtitleTimed(time, 1) + ClearPrints() + SetTextEntry_2("STRING") + AddTextComponentString(msg) + DrawSubtitleTimed(time, 1) end function ShowLoadingPromt(msg, time, type) - Citizen.CreateThread(function() - Citizen.Wait(0) - BeginTextCommandBusyString("STRING") - AddTextComponentString(msg) - EndTextCommandBusyString(type) - Citizen.Wait(time) - RemoveLoadingPrompt() - end) + Citizen.CreateThread(function() + Citizen.Wait(0) + BeginTextCommandBusyString("STRING") + AddTextComponentString(msg) + EndTextCommandBusyString(type) + Citizen.Wait(time) + + RemoveLoadingPrompt() + end) end function GetRandomWalkingNPC() + local search = {} + local peds = ESX.Game.GetPeds() - local search = {} - local peds = ESX.Game.GetPeds() + for i=1, #peds, 1 do + if IsPedHuman(peds[i]) and IsPedWalking(peds[i]) and not IsPedAPlayer(peds[i]) then + table.insert(search, peds[i]) + end + end - for i=1, #peds, 1 do - if IsPedHuman(peds[i]) and IsPedWalking(peds[i]) and not IsPedAPlayer(peds[i]) then - table.insert(search, peds[i]) - end - end + if #search > 0 then + return search[GetRandomIntInRange(1, #search)] + end - if #search > 0 then - return search[GetRandomIntInRange(1, #search)] - end + for i=1, 250, 1 do + local ped = GetRandomPedAtCoord(0.0, 0.0, 0.0, math.huge + 0.0, math.huge + 0.0, math.huge + 0.0, 26) - for i=1, 250, 1 do - - local ped = GetRandomPedAtCoord(0.0, 0.0, 0.0, math.huge + 0.0, math.huge + 0.0, math.huge + 0.0, 26) - - if DoesEntityExist(ped) and IsPedHuman(ped) and IsPedWalking(ped) and not IsPedAPlayer(ped) then - table.insert(search, ped) - end - - end - - if #search > 0 then - return search[GetRandomIntInRange(1, #search)] - end + if DoesEntityExist(ped) and IsPedHuman(ped) and IsPedWalking(ped) and not IsPedAPlayer(ped) then + table.insert(search, ped) + end + end + if #search > 0 then + return search[GetRandomIntInRange(1, #search)] + end end function ClearCurrentMission() @@ -108,7 +105,7 @@ function ClearCurrentMission() end function StartTaxiJob() - ShowLoadingPromt(_U('taking_service') .. 'Taxi/Uber', 5000, 3) + ShowLoadingPromt(_U('taking_service'), 5000, 3) ClearCurrentMission() OnJob = true @@ -163,7 +160,6 @@ function OpenCloakroom() CurrentActionMsg = _U('cloakroom_prompt') CurrentActionData = {} end) - end function OpenVehicleSpawnerMenu() @@ -241,6 +237,26 @@ function OpenVehicleSpawnerMenu() end end +function DeleteJobVehicle() + local playerPed = PlayerPedId() + + if Config.EnableSocietyOwnedVehicles then + local vehicleProps = ESX.Game.GetVehicleProperties(CurrentActionData.vehicle) + TriggerServerEvent('esx_society:putVehicleInGarage', 'taxi', vehicleProps) + ESX.Game.DeleteVehicle(CurrentActionData.vehicle) + else + if IsInAuthorizedVehicle() then + ESX.Game.DeleteVehicle(CurrentActionData.vehicle) + + if Config.MaxInService ~= -1 then + TriggerServerEvent('esx_service:disableService', 'taxi') + end + else + ESX.ShowNotification(_U('only_taxi')) + end + end +end + function OpenTaxiActionsMenu() local elements = { {label = _U('deposit_stock'), value = 'put_stock'}, @@ -280,7 +296,6 @@ function OpenTaxiActionsMenu() end function OpenMobileTaxiActionsMenu() - ESX.UI.Menu.CloseAll() ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'mobile_taxi_actions', @@ -292,7 +307,6 @@ function OpenMobileTaxiActionsMenu() { label = _U('start_job'), value = 'start_job' } } }, function(data, menu) - if data.current.value == 'billing' then ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'billing', { @@ -319,18 +333,14 @@ function OpenMobileTaxiActionsMenu() end) elseif data.current.value == 'start_job' then - if OnJob then StopTaxiJob() else - if ESX.PlayerData.job ~= nil and ESX.PlayerData.job.name == 'taxi' then - local playerPed = PlayerPedId() local vehicle = GetVehiclePedIsIn(playerPed, false) if IsPedInAnyVehicle(playerPed, false) and GetPedInVehicleSeat(vehicle, -1) == playerPed then - if tonumber(ESX.PlayerData.job.grade) >= 3 then StartTaxiJob() else @@ -340,27 +350,19 @@ function OpenMobileTaxiActionsMenu() ESX.ShowNotification(_U('must_in_taxi')) end end - else - if tonumber(ESX.PlayerData.job.grade) >= 3 then ESX.ShowNotification(_U('must_in_vehicle')) else ESX.ShowNotification(_U('must_in_taxi')) end - end - end - end - end - end, function(data, menu) menu.close() end) - end function IsInAuthorizedVehicle() @@ -377,122 +379,100 @@ function IsInAuthorizedVehicle() end function OpenGetStocksMenu() + ESX.TriggerServerCallback('esx_taxijob:getStockItems', function(items) + local elements = {} - ESX.TriggerServerCallback('esx_taxijob:getStockItems', function(items) - 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 = 'Taxi Stock', + align = 'top-left', + elements = elements + }, function(data, menu) + local itemName = data.current.value - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'stocks_menu', - { - title = 'Taxi Stock', - align = 'top-left', - elements = elements - }, - function(data, menu) + ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'stocks_menu_get_item_count', { + title = _U('quantity') + }, function(data2, menu2) - local itemName = data.current.value + local count = tonumber(data2.value) - ESX.UI.Menu.Open( - 'dialog', GetCurrentResourceName(), 'stocks_menu_get_item_count', - { - title = _U('quantity') - }, - function(data2, menu2) + if count == nil then + ESX.ShowNotification(_U('quantity_invalid')) + else + menu2.close() + menu.close() - local count = tonumber(data2.value) - - if count == nil then - ESX.ShowNotification(_U('quantity_invalid')) - else - menu2.close() - menu.close() - TriggerServerEvent('esx_taxijob:getStockItem', itemName, count) - - Citizen.Wait(1000) - OpenGetStocksMenu() - end - - end, - function(data2, menu2) - menu2.close() - end - ) - - end, - function(data, menu) - menu.close() - end - ) - - end) + -- todo: refresh on callback + TriggerServerEvent('esx_taxijob:getStockItem', itemName, count) + Citizen.Wait(1000) + OpenGetStocksMenu() + end + end, function(data2, menu2) + menu2.close() + end) + end, function(data, menu) + menu.close() + end) + end) end function OpenPutStocksMenu() + ESX.TriggerServerCallback('esx_taxijob:getPlayerInventory', function(inventory) - ESX.TriggerServerCallback('esx_taxijob:getPlayerInventory', function(inventory) + local elements = {} - local elements = {} + for i=1, #inventory.items, 1 do + local item = inventory.items[i] - for i=1, #inventory.items, 1 do + if item.count > 0 then + table.insert(elements, { + label = item.label .. ' x' .. item.count, + type = 'item_standard', -- not used + value = item.name + }) + end + end - local item = inventory.items[i] + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'stocks_menu', + { + title = _U('inventory'), + align = 'top-left', + elements = elements + }, function(data, menu) + local itemName = data.current.value - if item.count > 0 then - table.insert(elements, {label = item.label .. ' x' .. item.count, type = 'item_standard', value = item.name}) - end + ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'stocks_menu_put_item_count', { + title = _U('quantity') + }, function(data2, menu2) - end + local count = tonumber(data2.value) - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'stocks_menu', - { - title = _U('inventory'), - align = 'top-left', - elements = elements - }, - function(data, menu) - - local itemName = data.current.value - - ESX.UI.Menu.Open( - 'dialog', GetCurrentResourceName(), 'stocks_menu_put_item_count', - { - title = _U('quantity') - }, - function(data2, menu2) - - local count = tonumber(data2.value) - - if count == nil then - ESX.ShowNotification(_U('quantity_invalid')) - else - menu2.close() - menu.close() - TriggerServerEvent('esx_taxijob:putStockItems', itemName, count) - - Citizen.Wait(1000) - OpenPutStocksMenu() - end - - end, - function(data2, menu2) - menu2.close() - end - ) - - end, - function(data, menu) - menu.close() - end - ) - - end) + if count == nil then + ESX.ShowNotification(_U('quantity_invalid')) + else + menu2.close() + menu.close() + -- todo: refresh on callback + TriggerServerEvent('esx_taxijob:putStockItems', itemName, count) + Citizen.Wait(1000) + OpenPutStocksMenu() + end + end, function(data2, menu2) + menu2.close() + end) + end, function(data, menu) + menu.close() + end) + end) end RegisterNetEvent('esx:playerLoaded') @@ -506,7 +486,6 @@ AddEventHandler('esx:setJob', function(job) end) AddEventHandler('esx_taxijob:hasEnteredMarker', function(zone) - if zone == 'VehicleSpawner' then CurrentAction = 'vehicle_spawner' CurrentActionMsg = _U('spawner_prompt') @@ -530,7 +509,6 @@ AddEventHandler('esx_taxijob:hasEnteredMarker', function(zone) CurrentActionMsg = _U('cloakroom_prompt') CurrentActionData = {} end - end) AddEventHandler('esx_taxijob:hasExitedMarker', function(zone) @@ -566,284 +544,222 @@ end) -- Display markers Citizen.CreateThread(function() - while true do + while true do + Citizen.Wait(0) - Wait(0) + if ESX.PlayerData.job ~= nil and ESX.PlayerData.job.name == 'taxi' then + local coords = GetEntityCoords(PlayerPedId()) - if ESX.PlayerData.job ~= nil and ESX.PlayerData.job.name == 'taxi' then - - local coords = GetEntityCoords(PlayerPedId()) - - 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 + else + Citizen.Wait(500) + end + end end) -- Enter / Exit marker events Citizen.CreateThread(function() - while true do + while true do + Citizen.Wait(0) - Wait(0) + if ESX.PlayerData.job ~= nil and ESX.PlayerData.job.name == 'taxi' then + local coords = GetEntityCoords(PlayerPedId()) + local isInMarker = false + local currentZone = nil - if ESX.PlayerData.job ~= nil and ESX.PlayerData.job.name == 'taxi' then + 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 - local coords = GetEntityCoords(PlayerPedId()) - local isInMarker = false - local currentZone = nil + if (isInMarker and not HasAlreadyEnteredMarker) or (isInMarker and LastZone ~= currentZone) then + HasAlreadyEnteredMarker = true + LastZone = currentZone + TriggerEvent('esx_taxijob:hasEnteredMarker', currentZone) + end - 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_taxijob:hasEnteredMarker', currentZone) - end - - if not isInMarker and HasAlreadyEnteredMarker then - HasAlreadyEnteredMarker = false - TriggerEvent('esx_taxijob:hasExitedMarker', LastZone) - end - - end - - end + if not isInMarker and HasAlreadyEnteredMarker then + HasAlreadyEnteredMarker = false + TriggerEvent('esx_taxijob:hasExitedMarker', LastZone) + end + else + Citizen.Wait(500) + end + end end) -- Taxi Job Citizen.CreateThread(function() + while true do - while true do + Citizen.Wait(0) + local playerPed = PlayerPedId() - Citizen.Wait(0) + if OnJob then + if CurrentCustomer == nil then + DrawSub(_U('drive_search_pass'), 5000) - local playerPed = PlayerPedId() + if IsPedInAnyVehicle(playerPed, false) and GetEntitySpeed(playerPed) > 0 then + local waitUntil = GetGameTimer() + GetRandomIntInRange(30000, 45000) - if OnJob then + while OnJob and waitUntil > GetGameTimer() do + Citizen.Wait(0) + end - if CurrentCustomer == nil then + if OnJob and IsPedInAnyVehicle(playerPed, false) and GetEntitySpeed(playerPed) > 0 then + CurrentCustomer = GetRandomWalkingNPC() - DrawSub(_U('drive_search_pass'), 5000) + if CurrentCustomer ~= nil then + CurrentCustomerBlip = AddBlipForEntity(CurrentCustomer) - if IsPedInAnyVehicle(playerPed, false) and GetEntitySpeed(playerPed) > 0 then + SetBlipAsFriendly(CurrentCustomerBlip, 1) + SetBlipColour(CurrentCustomerBlip, 2) + SetBlipCategory(CurrentCustomerBlip, 3) + SetBlipRoute(CurrentCustomerBlip, true) - local waitUntil = GetGameTimer() + GetRandomIntInRange(30000, 45000) + SetEntityAsMissionEntity(CurrentCustomer, true, false) + ClearPedTasksImmediately(CurrentCustomer) + SetBlockingOfNonTemporaryEvents(CurrentCustomer, 1) - while OnJob and waitUntil > GetGameTimer() do - Citizen.Wait(0) - end + local standTime = GetRandomIntInRange(60000, 180000) + TaskStandStill(CurrentCustomer, standTime) - if OnJob and IsPedInAnyVehicle(playerPed, false) and GetEntitySpeed(playerPed) > 0 then + ESX.ShowNotification(_U('customer_found')) + end + end + end + else + if IsPedFatallyInjured(CurrentCustomer) then + ESX.ShowNotification(_U('client_unconcious')) - CurrentCustomer = GetRandomWalkingNPC() - - if CurrentCustomer ~= nil then - - CurrentCustomerBlip = AddBlipForEntity(CurrentCustomer) - - SetBlipAsFriendly(CurrentCustomerBlip, 1) - SetBlipColour(CurrentCustomerBlip, 2) - SetBlipCategory(CurrentCustomerBlip, 3) - SetBlipRoute(CurrentCustomerBlip, true) - - SetEntityAsMissionEntity(CurrentCustomer, true, false) - ClearPedTasksImmediately(CurrentCustomer) - SetBlockingOfNonTemporaryEvents(CurrentCustomer, 1) - - local standTime = GetRandomIntInRange(60000, 180000) - - TaskStandStill(CurrentCustomer, standTime) - - ESX.ShowNotification(_U('customer_found')) - - end - - end - - end - - else - - if IsPedFatallyInjured(CurrentCustomer) then - - ESX.ShowNotification(_U('client_unconcious')) - - if DoesBlipExist(CurrentCustomerBlip) then - RemoveBlip(CurrentCustomerBlip) - end - - if DoesBlipExist(DestinationBlip) then - RemoveBlip(DestinationBlip) - end - - SetEntityAsMissionEntity(CurrentCustomer, false, true) - - CurrentCustomer = nil - CurrentCustomerBlip = nil - DestinationBlip = nil - IsNearCustomer = false - CustomerIsEnteringVehicle = false - CustomerEnteredVehicle = false - TargetCoords = nil - - end - - if IsPedInAnyVehicle(playerPed, false) then - - local vehicle = GetVehiclePedIsIn(playerPed, false) - local playerCoords = GetEntityCoords(playerPed) - local customerCoords = GetEntityCoords(CurrentCustomer) - local customerDistance = GetDistanceBetweenCoords(playerCoords.x, playerCoords.y, playerCoords.z, customerCoords.x, customerCoords.y, customerCoords.z) - - if IsPedSittingInVehicle(CurrentCustomer, vehicle) then - - if CustomerEnteredVehicle then - - local targetDistance = GetDistanceBetweenCoords(playerCoords.x, playerCoords.y, playerCoords.z, TargetCoords.x, TargetCoords.y, TargetCoords.z) - - if targetDistance <= 10.0 then - - TaskLeaveVehicle(CurrentCustomer, vehicle, 0) - - ESX.ShowNotification(_U('arrive_dest')) - - TaskGoStraightToCoord(CurrentCustomer, TargetCoords.x, TargetCoords.y, TargetCoords.z, 1.0, -1, 0.0, 0.0) - SetEntityAsMissionEntity(CurrentCustomer, false, true) - - TriggerServerEvent('esx_taxijob:success') - - RemoveBlip(DestinationBlip) - - local scope = function(customer) - ESX.SetTimeout(60000, function() - DeletePed(customer) - end) - end - - scope(CurrentCustomer) - - CurrentCustomer = nil - CurrentCustomerBlip = nil - DestinationBlip = nil - IsNearCustomer = false - CustomerIsEnteringVehicle = false - CustomerEnteredVehicle = false - TargetCoords = nil - - end - - if TargetCoords ~= nil then - DrawMarker(1, TargetCoords.x, TargetCoords.y, TargetCoords.z - 1.0, 0, 0, 0, 0, 0, 0, 4.0, 4.0, 2.0, 178, 236, 93, 155, 0, 0, 2, 0, 0, 0, 0) - end - - else - - RemoveBlip(CurrentCustomerBlip) - - CurrentCustomerBlip = nil - - TargetCoords = Config.JobLocations[GetRandomIntInRange(1, #Config.JobLocations)] - - local street = table.pack(GetStreetNameAtCoord(TargetCoords.x, TargetCoords.y, TargetCoords.z)) - local msg = nil - - if street[2] ~= 0 and street[2] ~= nil then - msg = string.format(_U('take_me_to_near', GetStreetNameFromHashKey(street[1]),GetStreetNameFromHashKey(street[2]))) - else - msg = string.format(_U('take_me_to', GetStreetNameFromHashKey(street[1]))) - end - - ESX.ShowNotification(msg) - - DestinationBlip = AddBlipForCoord(TargetCoords.x, TargetCoords.y, TargetCoords.z) - - BeginTextCommandSetBlipName("STRING") - AddTextComponentString("Destination") - EndTextCommandSetBlipName(blip) - - SetBlipRoute(DestinationBlip, true) - - CustomerEnteredVehicle = true - - end - - else - - DrawMarker(1, customerCoords.x, customerCoords.y, customerCoords.z - 1.0, 0, 0, 0, 0, 0, 0, 4.0, 4.0, 2.0, 178, 236, 93, 155, 0, 0, 2, 0, 0, 0, 0) - - if not CustomerEnteredVehicle then - - if customerDistance <= 30.0 then - - if not IsNearCustomer then - ESX.ShowNotification(_U('close_to_client')) - IsNearCustomer = true - end - - end - - if customerDistance <= 100.0 then - - if not CustomerIsEnteringVehicle then - - ClearPedTasksImmediately(CurrentCustomer) - - local seat = 0 - - for i=4, 0, 1 do - if IsVehicleSeatFree(vehicle, seat) then - seat = i - break - end - end - - TaskEnterVehicle(CurrentCustomer, vehicle, -1, seat, 2.0, 1) - - CustomerIsEnteringVehicle = true - - end - - end - - end - - end - - else - - DrawSub(_U('return_to_veh'), 5000) - - end - - end - - end - - end + if DoesBlipExist(CurrentCustomerBlip) then + RemoveBlip(CurrentCustomerBlip) + end + + if DoesBlipExist(DestinationBlip) then + RemoveBlip(DestinationBlip) + end + + SetEntityAsMissionEntity(CurrentCustomer, false, true) + + CurrentCustomer, CurrentCustomerBlip, DestinationBlip, IsNearCustomer, CustomerIsEnteringVehicle, CustomerEnteredVehicle, TargetCoords = nil, nil, nil, false, false, false, nil + end + + if IsPedInAnyVehicle(playerPed, false) then + local vehicle = GetVehiclePedIsIn(playerPed, false) + local playerCoords = GetEntityCoords(playerPed) + local customerCoords = GetEntityCoords(CurrentCustomer) + local customerDistance = GetDistanceBetweenCoords(playerCoords.x, playerCoords.y, playerCoords.z, customerCoords.x, customerCoords.y, customerCoords.z) + + if IsPedSittingInVehicle(CurrentCustomer, vehicle) then + if CustomerEnteredVehicle then + local targetDistance = GetDistanceBetweenCoords(playerCoords.x, playerCoords.y, playerCoords.z, TargetCoords.x, TargetCoords.y, TargetCoords.z) + + if targetDistance <= 10.0 then + TaskLeaveVehicle(CurrentCustomer, vehicle, 0) + + ESX.ShowNotification(_U('arrive_dest')) + + TaskGoStraightToCoord(CurrentCustomer, TargetCoords.x, TargetCoords.y, TargetCoords.z, 1.0, -1, 0.0, 0.0) + SetEntityAsMissionEntity(CurrentCustomer, false, true) + TriggerServerEvent('esx_taxijob:success') + RemoveBlip(DestinationBlip) + + local scope = function(customer) + ESX.SetTimeout(60000, function() + DeletePed(customer) + end) + end + + scope(CurrentCustomer) + + CurrentCustomer, CurrentCustomerBlip, DestinationBlip, IsNearCustomer, CustomerIsEnteringVehicle, CustomerEnteredVehicle, TargetCoords = nil, nil, nil, false, false, false, nil + end + + if TargetCoords ~= nil then + DrawMarker(1, TargetCoords.x, TargetCoords.y, TargetCoords.z - 1.0, 0, 0, 0, 0, 0, 0, 4.0, 4.0, 2.0, 178, 236, 93, 155, 0, 0, 2, 0, 0, 0, 0) + end + else + RemoveBlip(CurrentCustomerBlip) + CurrentCustomerBlip = nil + TargetCoords = Config.JobLocations[GetRandomIntInRange(1, #Config.JobLocations)] + + local street = table.pack(GetStreetNameAtCoord(TargetCoords.x, TargetCoords.y, TargetCoords.z)) + local msg = nil + + if street[2] ~= 0 and street[2] ~= nil then + msg = string.format(_U('take_me_to_near', GetStreetNameFromHashKey(street[1]), GetStreetNameFromHashKey(street[2]))) + else + msg = string.format(_U('take_me_to', GetStreetNameFromHashKey(street[1]))) + end + + ESX.ShowNotification(msg) + + DestinationBlip = AddBlipForCoord(TargetCoords.x, TargetCoords.y, TargetCoords.z) + + BeginTextCommandSetBlipName("STRING") + AddTextComponentString("Destination") + EndTextCommandSetBlipName(blip) + SetBlipRoute(DestinationBlip, true) + + CustomerEnteredVehicle = true + end + else + DrawMarker(1, customerCoords.x, customerCoords.y, customerCoords.z - 1.0, 0, 0, 0, 0, 0, 0, 4.0, 4.0, 2.0, 178, 236, 93, 155, 0, 0, 2, 0, 0, 0, 0) + + if not CustomerEnteredVehicle then + if customerDistance <= 30.0 then + + if not IsNearCustomer then + ESX.ShowNotification(_U('close_to_client')) + IsNearCustomer = true + end + + end + + if customerDistance <= 100.0 then + if not CustomerIsEnteringVehicle then + ClearPedTasksImmediately(CurrentCustomer) + + local seat = 0 + for i=4, 0, 1 do + if IsVehicleSeatFree(vehicle, seat) then + seat = i + break + end + end + + TaskEnterVehicle(CurrentCustomer, vehicle, -1, seat, 2.0, 1) + CustomerIsEnteringVehicle = true + end + end + end + end + else + DrawSub(_U('return_to_veh'), 5000) + end + end + else + Citizen.Wait(500) + end + end end) -- Key Controls Citizen.CreateThread(function() while true do - Citizen.Wait(0) if CurrentAction ~= nil then - ESX.ShowHelpNotification(CurrentActionMsg) if IsControlJustReleased(0, Keys['E']) and ESX.PlayerData.job ~= nil and ESX.PlayerData.job.name == 'taxi' then - if CurrentAction == 'taxi_actions_menu' then OpenTaxiActionsMenu() elseif CurrentAction == 'cloakroom' then @@ -851,25 +767,7 @@ Citizen.CreateThread(function() elseif CurrentAction == 'vehicle_spawner' then OpenVehicleSpawnerMenu() elseif CurrentAction == 'delete_vehicle' then - - local playerPed = PlayerPedId() - - if Config.EnableSocietyOwnedVehicles then - local vehicleProps = ESX.Game.GetVehicleProperties(CurrentActionData.vehicle) - TriggerServerEvent('esx_society:putVehicleInGarage', 'taxi', vehicleProps) - ESX.Game.DeleteVehicle(CurrentActionData.vehicle) - else - if IsInAuthorizedVehicle() then - ESX.Game.DeleteVehicle(CurrentActionData.vehicle) - - if Config.MaxInService ~= -1 then - TriggerServerEvent('esx_service:disableService', 'taxi') - end - else - ESX.ShowNotification(_U('only_taxi')) - end - end - + DeleteJobVehicle() end CurrentAction = nil diff --git a/locales/br.lua b/locales/br.lua index ba064905..6e7105e2 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -12,7 +12,7 @@ Locales['br'] = { ['spawnpoint_blocked'] = 'there is a vehicle blocking the spawnpoint!', ['only_taxi'] = 'Você só pode guardar taxis.', - ['taking_service'] = 'Pegando serviço: ', + ['taking_service'] = 'Pegando serviço: Taxi/Uber', ['full_service'] = 'Serviço completo: ', ['amount_invalid'] = 'Valor inválido', ['press_to_open'] = 'Pressione ~INPUT_CONTEXT~ para acessar o menu', diff --git a/locales/de.lua b/locales/de.lua index 2b68db63..6aab82fa 100644 --- a/locales/de.lua +++ b/locales/de.lua @@ -12,7 +12,7 @@ Locales['de'] = { ['spawnpoint_blocked'] = 'there is a vehicle blocking the spawnpoint!', ['only_taxi'] = 'Du kannst nur Taxis parken.', - ['taking_service'] = 'Service annehmen: ', + ['taking_service'] = 'Service annehmen: Taxi/Uber', ['full_service'] = 'Voller Service: ', ['amount_invalid'] = 'Betrag ungültig', ['press_to_open'] = 'Drücke ~INPUT_CONTEXT~ um das Menü zu öffnen', diff --git a/locales/en.lua b/locales/en.lua index c0d6ac20..7ef79be7 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -12,7 +12,7 @@ Locales['en'] = { ['spawnpoint_blocked'] = 'there is a vehicle blocking the spawnpoint!', ['only_taxi'] = 'you can only store taxis.', - ['taking_service'] = 'taking service: ', + ['taking_service'] = 'taking service: Taxi/Uber', ['full_service'] = 'full service: ', ['amount_invalid'] = 'amount invalid', ['press_to_open'] = 'press ~INPUT_CONTEXT~ to access the menu', diff --git a/locales/fi.lua b/locales/fi.lua index f11f442b..3f08b333 100644 --- a/locales/fi.lua +++ b/locales/fi.lua @@ -12,7 +12,7 @@ Locales['fi'] = { ['spawnpoint_blocked'] = 'there is a vehicle blocking the spawnpoint!', ['only_taxi'] = 'Voit vain tallettaa taxeja', - ['taking_service'] = 'Aloitetaan työ: ', + ['taking_service'] = 'Aloitetaan työ: Taxi/Uber', ['full_service'] = 'täysi palvelu: ', ['amount_invalid'] = 'virheellinen summa', ['press_to_open'] = 'paina ~INPUT_CONTEXT~ avataksesi valikko', diff --git a/locales/fr.lua b/locales/fr.lua index d6b4d58f..d677a4a7 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -12,7 +12,7 @@ Locales['fr'] = { ['spawnpoint_blocked'] = 'there is a vehicle blocking the spawnpoint!', ['only_taxi'] = 'vous ne pouvez ranger que les taxi', - ['taking_service'] = 'prise de service : ', + ['taking_service'] = 'prise de service : Taxi/Uber', ['full_service'] = 'service complet : ', ['amount_invalid'] = 'montant invalide', ['press_to_open'] = 'appuyez sur ~INPUT_CONTEXT~ pour accéder au menu', diff --git a/locales/pl.lua b/locales/pl.lua index 0a868dbb..4d342bc2 100644 --- a/locales/pl.lua +++ b/locales/pl.lua @@ -4,13 +4,15 @@ Locales['pl'] = { ['cloakroom_prompt'] = 'naciśnij ~INPUT_CONTEXT~ aby użyć ~y~szatni~s~.', ['wear_citizen'] = 'strój cywilny', ['wear_work'] = 'strój pracownika taxi', + -- garage ['spawner_prompt'] = 'naciśnij ~INPUT_CONTEXT~ aby otworzyć ~y~garaż~s~.', ['store_veh'] = 'naciśnij ~INPUT_CONTEXT~ aby zdać pojazd', ['spawn_veh'] = 'sprowadź pojazd', ['spawnpoint_blocked'] = 'jakiś pojazd blokuje wyjazd z garażu!', ['only_taxi'] = 'możesz przechowywać tylko taksówki.', - ['taking_service'] = 'przyjmowanie usługi: ', + + ['taking_service'] = 'przyjmowanie usługi: Taxi/Uber', ['full_service'] = 'pełny serwis: ', ['amount_invalid'] = 'wartość nieprawidłowa', ['press_to_open'] = 'naciśnij ~INPUT_CONTEXT~ aby wejść do menu', diff --git a/locales/sv.lua b/locales/sv.lua index 8f643f20..8942f7d6 100644 --- a/locales/sv.lua +++ b/locales/sv.lua @@ -12,7 +12,7 @@ Locales['sv'] = { ['spawnpoint_blocked'] = 'det är ett fordon som blockerar spawnpointen!', ['only_taxi'] = 'du kan endast lagra ~y~taxi fordon~s~ här..', - ['taking_service'] = 'du deltog tjänst: ', + ['taking_service'] = 'du deltog tjänst: Taxi/Uber', ['full_service'] = 'du kan inte delta tjänst: ', ['amount_invalid'] = 'ogiltig mängd!', ['press_to_open'] = 'tryck ~INPUT_CONTEXT~ för att öppna menyn.', From 194d100c5a89fa5979dac8fcf984d3e47f718a94 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Wed, 28 Nov 2018 21:41:17 +0100 Subject: [PATCH 66/93] Replaced hardcoded phone label with i18n string --- client/main.lua | 4 ++-- locales/br.lua | 1 + locales/de.lua | 1 + locales/en.lua | 1 + locales/fi.lua | 1 + locales/fr.lua | 1 + locales/pl.lua | 1 + locales/sv.lua | 1 + 8 files changed, 9 insertions(+), 2 deletions(-) diff --git a/client/main.lua b/client/main.lua index 16b2f37b..080d88b2 100644 --- a/client/main.lua +++ b/client/main.lua @@ -519,7 +519,7 @@ end) RegisterNetEvent('esx_phone:loaded') AddEventHandler('esx_phone:loaded', function(phoneNumber, contacts) local specialContact = { - name = 'Taxi', + name = _U('phone_taxi'), number = 'taxi', base64Icon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAGGElEQVR4XsWWW2gd1xWGv7Vn5pyRj47ut8iOYlmyWxw1KSZN4riOW6eFuCYldaBtIL1Ag4NNmt5ICORCaNKXlF6oCy0hpSoJKW4bp7Sk6YNb01RuLq4d0pQ0kWQrshVJ1uX46HJ0zpy5rCKfQYgjCUs4kA+GtTd786+ftW8jqsqHibB6TLZn2zeq09ZTWAIWCxACoTI1E+6v+eSpXwHRqkVZPcmqlBzCApLQ8dk3IWVKMQlYcHG81OODNmD6D7d9VQrTSbwsH73lFKePtvOxXSfn48U+Xpb58fl5gPmgl6DiR19PZN4+G7iODY4liIAACqiCHyp+AFvb7ML3uot1QP5yDUim292RtIqfU6Lr8wFVDVV8AsPKRDAxzYkKm2kj5sSFuUT3+v2FXkDXakD6f+7c1NGS7Ml0Pkah6jq8mhvwUy7Cyijg5Aoks6/hTp+k7vRjDJ73dmw8WHxlJRM2y5Nsb3GPDuzsZURbGMsUmRkoUPByCMrKCG7SobJiO01X7OKq6utoe3XX34BaoLDaCljj3faTcu3j3z3T+iADwzNYEmKIWcGAIAtqqkKAxZa2Sja/tY+59/7y48aveQ8A4Woq4Fa3bj7Q1/EgwWRAZ52NMTYCWAZEwIhBUEQgUiVQ8IpKvqj4kVJCyGRCRrb+hvap+gPAo0DuUhWQfx2q29u+t/vPmarbCLwII7qQTEQRLbUtBJ2PAkZARBADqkLBV/I+BGrhpoSN577FWz3P3XbTvRMvAlpuwC4crv5jwtK9RAFSu46+G8cRwESxQ+K2gESAgCiIASHuA8YCBdSUohdCKGCF0H6iGc3MgrEphvKi+6Wp24HABioSjuxFARGobyJ5OMXEiGHW6iLR0EmifhPJDddj3CoqtuwEZSkCc73/RAvTeEOvU5w8gz/Zj2TfoLFFibZvQrI5EOFiPqgAZmzApTINKKgPiW20ffkXtPXfA9Ysmf5/kHn/T0z8e5rpCS5JVQNUN1ayfn2a+qvT2JWboOOXMPg0ms6C2IAAWTc2ACPeupdbm5yb8XNQczOM90DOB0uoa01Ttz5FZ6IL3Ctg9DUIg7Lto2DZ0HIDFEbAz4AaiBRyxZJe9U7kQg84KYbH/JeJESANXPXwXdWffvzu1p+x5VE4/ST4EyAOoEAI6WsAhdx/AYulhJDqAgRm/hPPEVAfnAboeAB6v88jTw/f98SzU8eAwbgC5IGRg3vsW3E7YewYzJwF4wAhikJURGqvBO8ouAFIxBI0gqgPEp9B86+ASSAIEEHhbEnX7eTgnrFbn3iW5+K82EAA+M2V+d2EeRj9K/izIBYgJZGwCO4Gzm/uRQOwDEsI41PSfPZ+xJsBKwFo6dOwpJvezMU84Md5sSmRCM51uacGbUKvHWEjAKIelXaGJqePyopjzFTdx6Ef/gDbjo3FKEoQKN+8/yEqRt8jf67IaNDBnF9FZFwERRGspMM20+XC64nym9AMhSE1G7fjbb0bCQsISi6vFCdPMPzuUwR9AcmOKQ7cew+WZcq3IGEYMZeb4p13sjjmU4TX7Cfdtp0oDAFBbZfk/37N0MALAKbcAKaY4yPeuwy3t2J8MAKDIxDVd1Lz8Ts599vb8Wameen532GspRWIQmXPHV8k0BquvPP3TOSgsRmiCFRAHWh9420Gi7nl34JaBen7O7UWRMD740AQ7yEf8nW78TIeN+7+PCIsOYaqMJHxqKtpJ++D+DA5ARsawEmASqzv1Cz7FjRpbt951tUAOcAHdNEUC7C5NAJo7Dws03CAFMxlkdSRZmCMxaq8ejKuVwSqIJfzA61LmyIgBoxZfgmYmQazKLGumHitRso0ZVkD0aE/FI7UrYv2WUYXjo0ihNhEatA1GBEUIxEWAcKCHhHCVMG8AETlda0ENn3hrm+/6Zh47RBCtXn+mZ/sAXzWjnPHV77zkiXBgl6gFkee+em1wBlgdnEF8sCF5moLI7KwlSIMwABwgbVT21htMNjleheAfPkShEBh/PzQccexdxBT9IPjQAYYZ+3o2OjQ8cQiPb+kVwBCliENXA3sAm6Zj3E/zaq4fD07HmwEmuKYXsUFcDl6Hz7/B1RGfEbPim/bAAAAAElFTkSuQmCC', } @@ -688,7 +688,7 @@ Citizen.CreateThread(function() else RemoveBlip(CurrentCustomerBlip) CurrentCustomerBlip = nil - TargetCoords = Config.JobLocations[GetRandomIntInRange(1, #Config.JobLocations)] + TargetCoords = Config.JobLocations[GetRandomIntInRange(1, #Config.JobLocations)] local street = table.pack(GetStreetNameAtCoord(TargetCoords.x, TargetCoords.y, TargetCoords.z)) local msg = nil diff --git a/locales/br.lua b/locales/br.lua index 6e7105e2..e2ecd080 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -45,4 +45,5 @@ Locales['br'] = { ['have_deposited'] = 'você depositou ~y~x%s~s~ ~b~%s~s~', ['player_cannot_hold'] = 'você não tem espaço suficiente em seu inventário!', ['blip_taxi'] = 'taxi', + ['phone_taxi'] = 'taxi', } \ No newline at end of file diff --git a/locales/de.lua b/locales/de.lua index 6aab82fa..d620cf3d 100644 --- a/locales/de.lua +++ b/locales/de.lua @@ -45,4 +45,5 @@ Locales['de'] = { ['have_deposited'] = 'you have deposited ~y~x%s~s~ ~b~%s~s~', ['player_cannot_hold'] = 'you do ~r~not~s~ have enough ~y~free space~s~ in your inventory!', ['blip_taxi'] = 'taxi', + ['phone_taxi'] = 'taxi', } \ No newline at end of file diff --git a/locales/en.lua b/locales/en.lua index 7ef79be7..ec09d19c 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -45,4 +45,5 @@ Locales['en'] = { ['have_deposited'] = 'you have deposited ~y~x%s~s~ ~b~%s~s~', ['player_cannot_hold'] = 'you do ~r~not~s~ have enough ~y~free space~s~ in your inventory!', ['blip_taxi'] = 'taxi', + ['phone_taxi'] = 'taxi', } \ No newline at end of file diff --git a/locales/fi.lua b/locales/fi.lua index 3f08b333..e68f9b3c 100644 --- a/locales/fi.lua +++ b/locales/fi.lua @@ -45,4 +45,5 @@ Locales['fi'] = { ['have_deposited'] = 'sinä talletit ~y~x%s~s~ ~b~%s~s~', ['player_cannot_hold'] = 'sinulla ~r~ei ole~s~ enempää ~y~vapaata tilaa~s~ repussasi!', ['blip_taxi'] = 'taxi', + ['phone_taxi'] = 'taxi', } \ No newline at end of file diff --git a/locales/fr.lua b/locales/fr.lua index d677a4a7..e4b2ffa3 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -45,4 +45,5 @@ Locales['fr'] = { ['have_deposited'] = 'vous avez déposé ~y~x%s~s~ ~b~%s~s~', ['player_cannot_hold'] = 'vous n\'avez pas assez ~y~de place~s~ dans votre inventaire!', ['blip_taxi'] = 'taxi', + ['phone_taxi'] = 'taxi', } \ No newline at end of file diff --git a/locales/pl.lua b/locales/pl.lua index 4d342bc2..c2453ce9 100644 --- a/locales/pl.lua +++ b/locales/pl.lua @@ -45,4 +45,5 @@ Locales['pl'] = { ['have_deposited'] = 'deponujesz ~y~x%s~s~ ~b~%s~s~', ['player_cannot_hold'] = '~r~Nie~s~ masz wystarczająco ~y~wolnego miejsca~s~ w swoim ekwipunku!', ['blip_taxi'] = 'taxi', + ['phone_taxi'] = 'taxi', } \ No newline at end of file diff --git a/locales/sv.lua b/locales/sv.lua index 8942f7d6..214cb1a5 100644 --- a/locales/sv.lua +++ b/locales/sv.lua @@ -45,4 +45,5 @@ Locales['sv'] = { ['have_deposited'] = 'du har lagrat ~y~x%s~s~ ~b~%s~s~', ['player_cannot_hold'] = 'du har ~r~inte~s~ tillräckligt med ~y~utrymme~s~ för att hålla det!', ['blip_taxi'] = 'taxifirman', + ['phone_taxi'] = 'taxi', } \ No newline at end of file From 3960dd3a78a07b4024a348ac65c575601629cfaa Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Thu, 10 Jan 2019 13:15:51 +0100 Subject: [PATCH 67/93] Security improvements --- locales/br.lua | 6 +++--- locales/en.lua | 6 +++--- locales/fr.lua | 6 +++--- server/main.lua | 30 ++++++++++++++++++++++-------- 4 files changed, 31 insertions(+), 17 deletions(-) diff --git a/locales/br.lua b/locales/br.lua index e2ecd080..2ba4f59c 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -23,10 +23,10 @@ Locales['br'] = { ['start_job'] = 'start / stop driving NPC jobs', ['drive_search_pass'] = 'Dirigindo em busca de ~y~passageiros', ['customer_found'] = 'Você ~g~encontrou~s~ um passageiro, dirija até o destino', - ['client_unconcious'] = 'Seu passageiro está ~r~insconsciente~w~. Procure por outro.', + ['client_unconcious'] = 'Seu passageiro está ~r~insconsciente~s~. Procure por outro.', ['arrive_dest'] = 'Você ~g~chegou~s~ ao seu destino', - ['take_me_to_near'] = '~w~Leve me para~y~ %s~w~, perto~y~ %s', - ['take_me_to'] = '~w~Leve me para~y~ %s', + ['take_me_to_near'] = '~s~Leve me para~y~ %s~s~, perto~y~ %s', + ['take_me_to'] = '~s~Leve me para~y~ %s', ['close_to_client'] = 'Você está perto do passageiro, aproximisse dele', ['return_to_veh'] = 'Volte para o seu veículo para continuar a missão', ['must_in_taxi'] = 'Você deve estar em um táxi para começar a missão', diff --git a/locales/en.lua b/locales/en.lua index ec09d19c..d5ed3ca4 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -22,14 +22,14 @@ Locales['en'] = { ['no_players_near'] = 'no players nearby', ['start_job'] = 'start / stop driving NPC jobs', ['drive_search_pass'] = 'driving in search of ~y~passengers', - ['customer_found'] = 'you have ~g~found~s~ a customer, drive until last', - ['client_unconcious'] = 'your client is ~r~unconscious~s~. Look for another one.', + ['customer_found'] = 'you have ~g~found~s~ a customer, get closer to them', + ['client_unconcious'] = 'your client is ~r~unconscious~s~, look for another one', ['arrive_dest'] = 'you have ~g~arrived~s~ at your destination', ['take_me_to_near'] = '~s~Take me to~y~ %s~s~, near ~y~%s', ['take_me_to'] = '~s~Take me to ~y~%s', ['close_to_client'] = 'you are too far from the client, get close to them', ['return_to_veh'] = 'please return to your vehicle to continue the mission', - ['must_in_taxi'] = 'you must be in a taxi to start the mission', + ['must_in_taxi'] = 'you must be in a ~y~taxi~s~ to start the mission', ['must_in_vehicle'] = 'you must be in a vehicle to begin the mission', ['have_earned'] = 'you have earned ~g~$%s~s~', ['comp_earned'] = '- your company has earned ~g~$%s~s~\n- you have earned ~g~$%s~s~', diff --git a/locales/fr.lua b/locales/fr.lua index e4b2ffa3..4d942293 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -23,10 +23,10 @@ Locales['fr'] = { ['start_job'] = 'start / stop driving NPC jobs', ['drive_search_pass'] = 'conduisez à la recherche de ~y~passagers', ['customer_found'] = 'vous avez ~g~trouvé~s~ un client, conduisez jusqu\'à ce dernier', - ['client_unconcious'] = 'votre client est ~r~inconscient~w~. Cherchez-en un autre.', + ['client_unconcious'] = 'votre client est ~r~inconscient~s~. Cherchez-en un autre.', ['arrive_dest'] = 'vous êtes ~g~arrivé~s~ à destination', - ['take_me_to_near'] = '~w~Emmenez-moi à~y~ %s~w~, près de~y~ %s', - ['take_me_to'] = '~w~Emmenez-moi à~y~ %s', + ['take_me_to_near'] = '~s~Emmenez-moi à~y~ %s~s~, près de~y~ %s', + ['take_me_to'] = '~s~Emmenez-moi à~y~ %s', ['close_to_client'] = 'vous êtes à proximité du client, approchez-vous de lui', ['return_to_veh'] = 'veuillez remonter dans votre véhicule pour continuer la mission', ['must_in_taxi'] = 'vous devez être dans un taxi pour commencer la mission', diff --git a/server/main.lua b/server/main.lua index 704f8043..ff8ec2a6 100644 --- a/server/main.lua +++ b/server/main.lua @@ -11,11 +11,17 @@ TriggerEvent('esx_society:registerSociety', 'taxi', 'Taxi', 'society_taxi', 'soc RegisterServerEvent('esx_taxijob:success') AddEventHandler('esx_taxijob:success', function() + local xPlayer = ESX.GetPlayerFromId(source) + + if xPlayer.job.name ~= 'taxi' then + print(('esx_taxijob: %s attempted to trigger success!'):format(xPlayer.identifier)) + return + end + math.randomseed(os.time()) - local xPlayer = ESX.GetPlayerFromId(source) - local total = math.random(Config.NPCJobEarnings.min, Config.NPCJobEarnings.max) - local societyAccount = nil + local total = math.random(Config.NPCJobEarnings.min, Config.NPCJobEarnings.max) + local societyAccount if xPlayer.job.grade >= 3 then total = total * 2 @@ -25,16 +31,14 @@ AddEventHandler('esx_taxijob:success', function() societyAccount = account end) - if societyAccount ~= nil then - - local playerMoney = math.floor(total / 100 * 30) - local societyMoney = math.floor(total / 100 * 70) + if societyAccount then + local playerMoney = ESX.Math.Round(total / 100 * 30) + local societyMoney = ESX.Math.Round(total / 100 * 70) xPlayer.addMoney(playerMoney) societyAccount.addMoney(societyMoney) TriggerClientEvent('esx:showNotification', xPlayer.source, _U('comp_earned', societyMoney, playerMoney)) - else xPlayer.addMoney(total) TriggerClientEvent('esx:showNotification', xPlayer.source, _U('have_earned', total)) @@ -45,6 +49,11 @@ end) RegisterServerEvent('esx_taxijob:getStockItem') AddEventHandler('esx_taxijob:getStockItem', function(itemName, count) local xPlayer = ESX.GetPlayerFromId(source) + + if xPlayer.job.name ~= 'taxi' then + print(('esx_taxijob: %s attempted to trigger getStockItem!'):format(xPlayer.identifier)) + return + end TriggerEvent('esx_addoninventory:getSharedInventory', 'society_taxi', function(inventory) local item = inventory.getItem(itemName) @@ -77,6 +86,11 @@ RegisterServerEvent('esx_taxijob:putStockItems') AddEventHandler('esx_taxijob:putStockItems', function(itemName, count) local xPlayer = ESX.GetPlayerFromId(source) + if xPlayer.job.name ~= 'taxi' then + print(('esx_taxijob: %s attempted to trigger putStockItems!'):format(xPlayer.identifier)) + return + end + TriggerEvent('esx_addoninventory:getSharedInventory', 'society_taxi', function(inventory) local item = inventory.getItem(itemName) From ecf7ac586e5b035d4e16ad4b00b89a642e5513fc Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Thu, 10 Jan 2019 14:07:11 +0100 Subject: [PATCH 68/93] Added minimum distance, customer in backseat, cleanup and pretty markers --- client/main.lua | 85 +++++++++++++++++++++++-------------------------- config.lua | 33 +++++++++++-------- locales/en.lua | 4 +-- 3 files changed, 61 insertions(+), 61 deletions(-) diff --git a/client/main.lua b/client/main.lua index 080d88b2..e6a04f78 100644 --- a/client/main.lua +++ b/client/main.lua @@ -538,49 +538,33 @@ Citizen.CreateThread(function() SetBlipAsShortRange(blip, true) BeginTextCommandSetBlipName("STRING") - AddTextComponentString(_U('blip_taxi')) + AddTextComponentSubstringPlayerName(_U('blip_taxi')) EndTextCommandSetBlipName(blip) end) --- Display markers +-- Enter / Exit marker events, and draw markers Citizen.CreateThread(function() while true do Citizen.Wait(0) - if ESX.PlayerData.job ~= nil and ESX.PlayerData.job.name == 'taxi' then + if ESX.PlayerData.job and ESX.PlayerData.job.name == 'taxi' then local coords = GetEntityCoords(PlayerPedId()) + local isInMarker, currentZone = false 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) + local distance = GetDistanceBetweenCoords(coords, v.Pos.x, v.Pos.y, v.Pos.z, true) + + if v.Type ~= -1 and distance < 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.0, v.Size.x, v.Size.y, v.Size.z, v.Color.r, v.Color.g, v.Color.b, 100, false, false, 2, v.Rotate, nil, nil, false) end - end - else - Citizen.Wait(500) - end - end -end) --- Enter / Exit marker events -Citizen.CreateThread(function() - while true do - Citizen.Wait(0) - - if ESX.PlayerData.job ~= nil and ESX.PlayerData.job.name == 'taxi' then - local coords = GetEntityCoords(PlayerPedId()) - 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 + if distance < v.Size.x then + isInMarker, currentZone = true, k end end if (isInMarker and not HasAlreadyEnteredMarker) or (isInMarker and LastZone ~= currentZone) then - HasAlreadyEnteredMarker = true - LastZone = currentZone + HasAlreadyEnteredMarker, LastZone = true, currentZone TriggerEvent('esx_taxijob:hasEnteredMarker', currentZone) end @@ -589,7 +573,7 @@ Citizen.CreateThread(function() TriggerEvent('esx_taxijob:hasExitedMarker', LastZone) end else - Citizen.Wait(500) + Citizen.Wait(1000) end end end) @@ -618,14 +602,14 @@ Citizen.CreateThread(function() if CurrentCustomer ~= nil then CurrentCustomerBlip = AddBlipForEntity(CurrentCustomer) - SetBlipAsFriendly(CurrentCustomerBlip, 1) + SetBlipAsFriendly(CurrentCustomerBlip, true) SetBlipColour(CurrentCustomerBlip, 2) SetBlipCategory(CurrentCustomerBlip, 3) SetBlipRoute(CurrentCustomerBlip, true) SetEntityAsMissionEntity(CurrentCustomer, true, false) ClearPedTasksImmediately(CurrentCustomer) - SetBlockingOfNonTemporaryEvents(CurrentCustomer, 1) + SetBlockingOfNonTemporaryEvents(CurrentCustomer, true) local standTime = GetRandomIntInRange(60000, 180000) TaskStandStill(CurrentCustomer, standTime) @@ -682,13 +666,21 @@ Citizen.CreateThread(function() CurrentCustomer, CurrentCustomerBlip, DestinationBlip, IsNearCustomer, CustomerIsEnteringVehicle, CustomerEnteredVehicle, TargetCoords = nil, nil, nil, false, false, false, nil end - if TargetCoords ~= nil then - DrawMarker(1, TargetCoords.x, TargetCoords.y, TargetCoords.z - 1.0, 0, 0, 0, 0, 0, 0, 4.0, 4.0, 2.0, 178, 236, 93, 155, 0, 0, 2, 0, 0, 0, 0) + if TargetCoords then + DrawMarker(36, TargetCoords.x, TargetCoords.y, TargetCoords.z + 1.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 234, 223, 72, 155, false, false, 2, true, nil, nil, false) end else RemoveBlip(CurrentCustomerBlip) CurrentCustomerBlip = nil TargetCoords = Config.JobLocations[GetRandomIntInRange(1, #Config.JobLocations)] + local distance = GetDistanceBetweenCoords(playerCoords, TargetCoords.x, TargetCoords.y, TargetCoords.z, true) + + while distance < Config.MinimumDistance do + Citizen.Wait(5) + + TargetCoords = Config.JobLocations[GetRandomIntInRange(1, #Config.JobLocations)] + distance = GetDistanceBetweenCoords(playerCoords, TargetCoords.x, TargetCoords.y, TargetCoords.z, true) + end local street = table.pack(GetStreetNameAtCoord(TargetCoords.x, TargetCoords.y, TargetCoords.z)) local msg = nil @@ -704,17 +696,17 @@ Citizen.CreateThread(function() DestinationBlip = AddBlipForCoord(TargetCoords.x, TargetCoords.y, TargetCoords.z) BeginTextCommandSetBlipName("STRING") - AddTextComponentString("Destination") + AddTextComponentSubstringPlayerName("Destination") EndTextCommandSetBlipName(blip) SetBlipRoute(DestinationBlip, true) CustomerEnteredVehicle = true end else - DrawMarker(1, customerCoords.x, customerCoords.y, customerCoords.z - 1.0, 0, 0, 0, 0, 0, 0, 4.0, 4.0, 2.0, 178, 236, 93, 155, 0, 0, 2, 0, 0, 0, 0) + DrawMarker(36, customerCoords.x, customerCoords.y, customerCoords.z + 1.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 234, 223, 72, 155, false, false, 2, true, nil, nil, false) if not CustomerEnteredVehicle then - if customerDistance <= 30.0 then + if customerDistance <= 40.0 then if not IsNearCustomer then ESX.ShowNotification(_U('close_to_client')) @@ -723,20 +715,23 @@ Citizen.CreateThread(function() end - if customerDistance <= 100.0 then + if customerDistance <= 20.0 then if not CustomerIsEnteringVehicle then ClearPedTasksImmediately(CurrentCustomer) - local seat = 0 - for i=4, 0, 1 do - if IsVehicleSeatFree(vehicle, seat) then - seat = i + local maxSeats, freeSeat = GetVehicleMaxNumberOfPassengers(vehicle) + + for i=maxSeats - 1, 0, -1 do + if IsVehicleSeatFree(vehicle, i) then + freeSeat = i break end end - TaskEnterVehicle(CurrentCustomer, vehicle, -1, seat, 2.0, 1) - CustomerIsEnteringVehicle = true + if freeSeat then + TaskEnterVehicle(CurrentCustomer, vehicle, -1, freeSeat, 2.0, 0) + CustomerIsEnteringVehicle = true + end end end end @@ -756,10 +751,10 @@ Citizen.CreateThread(function() while true do Citizen.Wait(0) - if CurrentAction ~= nil then + if CurrentAction and not IsDead then ESX.ShowHelpNotification(CurrentActionMsg) - if IsControlJustReleased(0, Keys['E']) and ESX.PlayerData.job ~= nil and ESX.PlayerData.job.name == 'taxi' then + if IsControlJustReleased(0, Keys['E']) and ESX.PlayerData.job and ESX.PlayerData.job.name == 'taxi' then if CurrentAction == 'taxi_actions_menu' then OpenTaxiActionsMenu() elseif CurrentAction == 'cloakroom' then @@ -774,7 +769,7 @@ Citizen.CreateThread(function() end end - if IsControlJustReleased(0, Keys['F6']) and GetLastInputMethod(2) and not IsDead and Config.EnablePlayerManagement and ESX.PlayerData.job ~= nil and ESX.PlayerData.job.name == 'taxi' then + if IsControlJustReleased(0, Keys['F6']) and IsInputDisabled(0) and not IsDead and Config.EnablePlayerManagement and ESX.PlayerData.job and ESX.PlayerData.job.name == 'taxi' then OpenMobileTaxiActionsMenu() end end diff --git a/config.lua b/config.lua index c5e42df9..82820e87 100644 --- a/config.lua +++ b/config.lua @@ -1,10 +1,15 @@ Config = {} + Config.DrawDistance = 100.0 -Config.NPCJobEarnings = {min = 15, max = 40} + +Config.NPCJobEarnings = {min = 300, max = 600} +Config.MinimumDistance = 3000 -- Minimum NPC job destination distance from the pickup in GTA units, a higher number prevents nearby destionations. + Config.MaxInService = -1 Config.EnablePlayerManagement = false Config.EnableSocietyOwnedVehicles = false -Config.Locale = 'en' + +Config.Locale = 'fr' Config.AuthorizedVehicles = { @@ -18,38 +23,38 @@ Config.AuthorizedVehicles = { Config.Zones = { VehicleSpawner = { - Pos = {x = 915.039, y = -162.187, z = 73.684}, - Size = {x = 1.5, y = 1.5, z = 1.0}, + Pos = {x = 915.039, y = -162.187, z = 74.5}, + Size = {x = 1.0, y = 1.0, z = 1.0}, Color = {r = 204, g = 204, b = 0}, - Type = 1 + Type = 36, Rotate = true }, VehicleSpawnPoint = { Pos = {x = 911.108, y = -177.867, z = 74.283}, Size = {x = 1.5, y = 1.5, z = 1.0}, - Type = -1, + Type = -1, Rotate = false, Heading = 225.0 }, VehicleDeleter = { Pos = {x = 908.317, y = -183.070, z = 73.201}, - Size = {x = 3.0, y = 3.0, z = 1.0}, + Size = {x = 3.0, y = 3.0, z = 0.25}, Color = {r = 255, g = 0, b = 0}, - Type = 1 + Type = 1, Rotate = false }, TaxiActions = { - Pos = {x = 903.32, y = -170.55, z = 73.00}, - Size = {x = 1.5, y = 1.5, z = 1.0}, + Pos = {x = 903.32, y = -170.55, z = 74.0}, + Size = {x = 1.0, y = 1.0, z = 1.0}, Color = {r = 204, g = 204, b = 0}, - Type = 1 + Type = 20, Rotate = true }, Cloakroom = { - Pos = {x = 894.88, y = -180.23, z = 73.50}, - Size = {x = 1.5, y = 1.5, z = 1.0}, + Pos = {x = 894.88, y = -180.23, z = 74.5}, + Size = {x = 1.0, y = 1.0, z = 1.0}, Color = {r = 204, g = 204, b = 0}, - Type = 1 + Type = 21, Rotate = true } } diff --git a/locales/en.lua b/locales/en.lua index d5ed3ca4..2dc27583 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -1,12 +1,12 @@ Locales['en'] = { -- cloakroom ['cloakroom_menu'] = 'cloakroom', - ['cloakroom_prompt'] = 'press ~INPUT_CONTEXT~ to open the ~y~cloakroom~s~.', + ['cloakroom_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Cloakroom~s~.', ['wear_citizen'] = 'citizen wear', ['wear_work'] = 'taxi wear', -- garage - ['spawner_prompt'] = 'press ~INPUT_CONTEXT~ to open the ~y~garage~s~.', + ['spawner_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Garage~s~.', ['store_veh'] = 'press ~INPUT_CONTEXT~ to store the vehicle', ['spawn_veh'] = 'spawn vehicle', ['spawnpoint_blocked'] = 'there is a vehicle blocking the spawnpoint!', From c2687f2bdd7d652a91cdba087fe5072eac308d9f Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Thu, 10 Jan 2019 14:09:11 +0100 Subject: [PATCH 69/93] Use downtown cab co as blip and phone label --- locales/en.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locales/en.lua b/locales/en.lua index 2dc27583..6b1f0681 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -44,6 +44,6 @@ Locales['en'] = { ['have_withdrawn'] = 'you have withdrawn ~y~x%s~s~ ~b~%s~s~', ['have_deposited'] = 'you have deposited ~y~x%s~s~ ~b~%s~s~', ['player_cannot_hold'] = 'you do ~r~not~s~ have enough ~y~free space~s~ in your inventory!', - ['blip_taxi'] = 'taxi', - ['phone_taxi'] = 'taxi', + ['blip_taxi'] = 'downtown Cab Co.', + ['phone_taxi'] = 'downtown Cab Co.', } \ No newline at end of file From 1d2d7fbaa9d800159f57262064a062f763152cc6 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Fri, 31 May 2019 12:58:07 +0200 Subject: [PATCH 70/93] Config cleanup --- config.lua | 185 ++++++++++++++++++++++++++--------------------------- 1 file changed, 92 insertions(+), 93 deletions(-) diff --git a/config.lua b/config.lua index 82820e87..cebf1139 100644 --- a/config.lua +++ b/config.lua @@ -56,100 +56,99 @@ Config.Zones = { Color = {r = 204, g = 204, b = 0}, Type = 21, Rotate = true } - } Config.JobLocations = { - {x = 293.476, y = -590.163, z = 42.7371}, - {x = 253.404, y = -375.86, z = 44.0819}, - {x = 120.808, y = -300.416, z = 45.1399}, - {x = -38.4132, y = -381.576, z = 38.3456}, - {x = -107.442, y = -614.377, z = 35.6703}, - {x = -252.292, y = -856.474, z = 30.5626}, - {x = -236.138, y = -988.382, z = 28.7749}, - {x = -276.989, y = -1061.18, z = 25.6853}, - {x = -576.451, y = -998.989, z = 21.785}, - {x = -602.798, y = -952.63, z = 21.6353}, - {x = -790.653, y = -961.855, z = 14.8932}, - {x = -912.588, y = -864.756, z = 15.0057}, - {x = -1069.77, y = -792.513, z = 18.8075}, - {x = -1306.94, y = -854.085, z = 15.0959}, - {x = -1468.51, y = -681.363, z = 26.178}, - {x = -1380.89, y = -452.7, z = 34.0843}, - {x = -1326.35, y = -394.81, z = 36.0632}, - {x = -1383.68, y = -269.985, z = 42.4878}, - {x = -1679.61, y = -457.339, z = 39.4048}, - {x = -1812.45, y = -416.917, z = 43.6734}, - {x = -2043.64, y = -268.291, z = 22.9927}, - {x = -2186.45, y = -421.595, z = 12.6776}, - {x = -1862.08, y = -586.528, z = 11.1747}, - {x = -1859.5, y = -617.563, z = 10.8788}, - {x = -1634.95, y = -988.302, z = 12.6241}, - {x = -1283.99, y = -1154.16, z = 5.30998}, - {x = -1126.47, y = -1338.08, z = 4.63434}, - {x = -867.907, y = -1159.67, z = 5.00795}, - {x = -847.55, y = -1141.38, z = 6.27591}, - {x = -722.625, y = -1144.6, z = 10.2176}, - {x = -575.503, y = -318.446, z = 34.5273}, - {x = -592.309, y = -224.853, z = 36.1209}, - {x = -559.594, y = -162.873, z = 37.7547}, - {x = -534.992, y = -65.6695, z = 40.634}, - {x = -758.234, y = -36.6906, z = 37.2911}, - {x = -1375.88, y = 20.9516, z = 53.2255}, - {x = -1320.25, y = -128.018, z = 48.097}, - {x = -1285.71, y = 294.287, z = 64.4619}, - {x = -1245.67, y = 386.533, z = 75.0908}, - {x = -760.355, y = 285.015, z = 85.0667}, - {x = -626.786, y = 254.146, z = 81.0964}, - {x = -563.609, y = 267.962, z = 82.5116}, - {x = -486.806, y = 271.977, z = 82.8187}, - {x = 88.295, y = 250.867, z = 108.188}, - {x = 234.087, y = 344.678, z = 105.018}, - {x = 434.963, y = 96.707, z = 99.1713}, - {x = 482.617, y = -142.533, z = 58.1936}, - {x = 762.651, y = -786.55, z = 25.8915}, - {x = 809.06, y = -1290.8, z = 25.7946}, - {x = 490.819, y = -1751.37, z = 28.0987}, - {x = 432.351, y = -1856.11, z = 27.0352}, - {x = 164.348, y = -1734.54, z = 28.8982}, - {x = -57.6909, y = -1501.4, z = 31.1084}, - {x = 52.2241, y = -1566.65, z = 29.006}, - {x = 310.222, y = -1376.76, z = 31.4442}, - {x = 181.967, y = -1332.79, z = 28.8773}, - {x = -74.6091, y = -1100.64, z = 25.738}, - {x = -887.045, y = -2187.46, z = 8.13248}, - {x = -749.584, y = -2296.59, z = 12.4627}, - {x = -1064.83, y = -2560.66, z = 19.6811}, - {x = -1033.44, y = -2730.24, z = 19.6868}, - {x = -1018.67, y = -2732, z = 13.2687}, - {x = 797.354, y = -174.423, z = 72.708}, - {x = 508.156, y = -117.908, z = 60.78}, - {x = 159.458, y = -27.555, z = 67.38}, - {x = -36.382, y = -106.912, z = 56.982}, - {x = -355.801, y = -270.404, z = 33.011}, - {x = -831.196, y = -76.871, z = 37.323}, - {x = -1038.707, y = -214.593, z = 37}, - {x = 1918.448, y = 3691.41, z = 32.261}, - {x = 1820.217, y = 3697.115, z = 33.493}, - {x = 1619.323, y = 3827.162, z = 34.482}, - {x = 1418.628, y = 3602.243, z = 34.511}, - {x = 1944.858, y = 3856.252, z = 31.741}, - {x = 2285.278, y = 3839.444, z = 34.023}, - {x = 2760.945, y = 3387.813, z = 55.659}, - {x = 1952.819, y = 2627.731, z = 45.368}, - {x = 1051.414, y = 474.833, z = 93.653}, - {x = 866.393, y = 17.635, z = 78.654}, - {x = 318.985, y = 167.41, z = 103.335}, - {x = 88.836, y = 254.054, z = 108.236}, - {x = -44.852, y = 70.414, z = 72.437}, - {x = -115.496, y = 84.333, z = 70.792}, - {x = -384.806, y = 226.868, z = 83.548}, - {x = -578.669, y = 139.085, z = 61.337}, - {x = -651.334, y = -584.879, z = 34.116}, - {x = -571.847, y = -1195.648, z = 17.869}, - {x = -1513.271, y = -670.039, z = 28.362}, - {x = -1297.484, y = -654.913, z = 26.123}, - {x = -1645.546, y = 144.571, z = 61.664}, - {x = -1160.618, y = 744.418, z = 154.571}, - {x = -798.09, y = 831.699, z = 204.351}, + vector3(293.5, -590.2, 42.7), + vector3(253.4, -375.9, 44.1), + vector3(120.8, -300.4, 45.1), + vector3(-38.4, -381.6, 38.3), + vector3(-107.4, -614.4, 35.7), + vector3(-252.3, -856.5, 30.6), + vector3(-236.1, -988.4, 28.8), + vector3(-277.0, -1061.2, 25.7), + vector3(-576.5, -999.0, 21.8), + vector3(-602.8, -952.6, 21.6), + vector3(-790.7, -961.9, 14.9), + vector3(-912.6, -864.8, 15.0), + vector3(-1069.8, -792.5, 18.8), + vector3(-1306.9, -854.1, 15.1), + vector3(-1468.5, -681.4, 26.2), + vector3(-1380.9, -452.7, 34.1), + vector3(-1326.3, -394.8, 36.1), + vector3(-1383.7, -270.0, 42.5), + vector3(-1679.6, -457.3, 39.4), + vector3(-1812.5, -416.9, 43.7), + vector3(-2043.6, -268.3, 23.0), + vector3(-2186.4, -421.6, 12.7), + vector3(-1862.1, -586.5, 11.2), + vector3(-1859.5, -617.6, 10.9), + vector3(-1635.0, -988.3, 12.6), + vector3(-1284.0, -1154.2, 5.3), + vector3(-1126.5, -1338.1, 4.6), + vector3(-867.9, -1159.7, 5.0), + vector3(-847.5, -1141.4, 6.3), + vector3(-722.6, -1144.6, 10.2), + vector3(-575.5, -318.4, 34.5), + vector3(-592.3, -224.9, 36.1), + vector3(-559.6, -162.9, 37.8), + vector3(-535.0, -65.7, 40.6), + vector3(-758.2, -36.7, 37.3), + vector3(-1375.9, 21.0, 53.2), + vector3(-1320.3, -128.0, 48.1), + vector3(-1285.7, 294.3, 64.5), + vector3(-1245.7, 386.5, 75.1), + vector3(-760.4, 285.0, 85.1), + vector3(-626.8, 254.1, 81.1), + vector3(-563.6, 268.0, 82.5), + vector3(-486.8, 272.0, 82.8), + vector3(88.3, 250.9, 108.2), + vector3(234.1, 344.7, 105.0), + vector3(435.0, 96.7, 99.2), + vector3(482.6, -142.5, 58.2), + vector3(762.7, -786.5, 25.9), + vector3(809.1, -1290.8, 25.8), + vector3(490.8, -1751.4, 28.1), + vector3(432.4, -1856.1, 27.0), + vector3(164.3, -1734.5, 28.9), + vector3(-57.7, -1501.4, 31.1), + vector3(52.2, -1566.7, 29.0), + vector3(310.2, -1376.8, 31.4), + vector3(182.0, -1332.8, 28.9), + vector3(-74.6, -1100.6, 25.7), + vector3(-887.0, -2187.5, 8.1), + vector3(-749.6, -2296.6, 12.5), + vector3(-1064.8, -2560.7, 19.7), + vector3(-1033.4, -2730.2, 19.7), + vector3(-1018.7, -2732.0, 13.3), + vector3(797.4, -174.4, 72.7), + vector3(508.2, -117.9, 60.8), + vector3(159.5, -27.6, 67.4), + vector3(-36.4, -106.9, 57.0), + vector3(-355.8, -270.4, 33.0), + vector3(-831.2, -76.9, 37.3), + vector3(-1038.7, -214.6, 37.0), + vector3(1918.4, 3691.4, 32.3), + vector3(1820.2, 3697.1, 33.5), + vector3(1619.3, 3827.2, 34.5), + vector3(1418.6, 3602.2, 34.5), + vector3(1944.9, 3856.3, 31.7), + vector3(2285.3, 3839.4, 34.0), + vector3(2760.9, 3387.8, 55.7), + vector3(1952.8, 2627.7, 45.4), + vector3(1051.4, 474.8, 93.7), + vector3(866.4, 17.6, 78.7), + vector3(319.0, 167.4, 103.3), + vector3(88.8, 254.1, 108.2), + vector3(-44.9, 70.4, 72.4), + vector3(-115.5, 84.3, 70.8), + vector3(-384.8, 226.9, 83.5), + vector3(-578.7, 139.1, 61.3), + vector3(-651.3, -584.9, 34.1), + vector3(-571.8, -1195.6, 17.9), + vector3(-1513.3, -670.0, 28.4), + vector3(-1297.5, -654.9, 26.1), + vector3(-1645.5, 144.6, 61.7), + vector3(-1160.6, 744.4, 154.6), + vector3(-798.1, 831.7, 204.4) } From 2b354112846da7e0d2d7c693825e291d76506b10 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Fri, 31 May 2019 13:04:59 +0200 Subject: [PATCH 71/93] Minor cleanup --- client/main.lua | 111 ++++++++++++++++++------------------------------ 1 file changed, 42 insertions(+), 69 deletions(-) diff --git a/client/main.lua b/client/main.lua index e6a04f78..debf7487 100644 --- a/client/main.lua +++ b/client/main.lua @@ -1,31 +1,7 @@ -local Keys = { - ["ESC"] = 322, ["F1"] = 288, ["F2"] = 289, ["F3"] = 170, ["F5"] = 166, ["F6"] = 167, ["F7"] = 168, ["F8"] = 169, ["F9"] = 56, ["F10"] = 57, - ["~"] = 243, ["1"] = 157, ["2"] = 158, ["3"] = 160, ["4"] = 164, ["5"] = 165, ["6"] = 159, ["7"] = 161, ["8"] = 162, ["9"] = 163, ["-"] = 84, ["="] = 83, ["BACKSPACE"] = 177, - ["TAB"] = 37, ["Q"] = 44, ["W"] = 32, ["E"] = 38, ["R"] = 45, ["T"] = 245, ["Y"] = 246, ["U"] = 303, ["P"] = 199, ["["] = 39, ["]"] = 40, ["ENTER"] = 18, - ["CAPS"] = 137, ["A"] = 34, ["S"] = 8, ["D"] = 9, ["F"] = 23, ["G"] = 47, ["H"] = 74, ["K"] = 311, ["L"] = 182, - ["LEFTSHIFT"] = 21, ["Z"] = 20, ["X"] = 73, ["C"] = 26, ["V"] = 0, ["B"] = 29, ["N"] = 249, ["M"] = 244, [","] = 82, ["."] = 81, - ["LEFTCTRL"] = 36, ["LEFTALT"] = 19, ["SPACE"] = 22, ["RIGHTCTRL"] = 70, - ["HOME"] = 213, ["PAGEUP"] = 10, ["PAGEDOWN"] = 11, ["DELETE"] = 178, - ["LEFT"] = 174, ["RIGHT"] = 175, ["TOP"] = 27, ["DOWN"] = 173, - ["NENTER"] = 201, ["N4"] = 108, ["N5"] = 60, ["N6"] = 107, ["N+"] = 96, ["N-"] = 97, ["N7"] = 117, ["N8"] = 61, ["N9"] = 118 -} +local HasAlreadyEnteredMarker, OnJob, IsNearCustomer, CustomerIsEnteringVehicle, CustomerEnteredVehicle, IsDead, CurrentActionData = false, false, false, false, false, false, {} +local CurrentCustomer, CurrentCustomerBlip, DestinationBlip, targetCoords, LastZone, CurrentAction, CurrentActionMsg -local HasAlreadyEnteredMarker = false -local LastZone = nil -local CurrentAction = nil -local CurrentActionMsg = '' -local CurrentActionData = {} -local OnJob = false -local CurrentCustomer = nil -local CurrentCustomerBlip = nil -local DestinationBlip = nil -local IsNearCustomer = false -local CustomerIsEnteringVehicle = false -local CustomerEnteredVehicle = false -local TargetCoords = nil -local IsDead = false - -ESX = nil +ESX = nil Citizen.CreateThread(function() while ESX == nil do @@ -42,16 +18,17 @@ end) function DrawSub(msg, time) ClearPrints() - SetTextEntry_2("STRING") - AddTextComponentString(msg) - DrawSubtitleTimed(time, 1) + BeginTextCommandPrint('STRING') + AddTextComponentSubstringPlayerName(msg) + EndTextCommandPrint(time, 1) end function ShowLoadingPromt(msg, time, type) Citizen.CreateThread(function() Citizen.Wait(0) - BeginTextCommandBusyString("STRING") - AddTextComponentString(msg) + + BeginTextCommandBusyString('STRING') + AddTextComponentSubstringPlayerName(msg) EndTextCommandBusyString(type) Citizen.Wait(time) @@ -101,7 +78,7 @@ function ClearCurrentMission() IsNearCustomer = false CustomerIsEnteringVehicle = false CustomerEnteredVehicle = false - TargetCoords = nil + targetCoords = nil end function StartTaxiJob() @@ -119,7 +96,7 @@ function StopTaxiJob() TaskLeaveVehicle(CurrentCustomer, vehicle, 0) if CustomerEnteredVehicle then - TaskGoStraightToCoord(CurrentCustomer, TargetCoords.x, TargetCoords.y, TargetCoords.z, 1.0, -1, 0.0, 0.0) + TaskGoStraightToCoord(CurrentCustomer, targetCoords.x, targetCoords.y, targetCoords.z, 1.0, -1, 0.0, 0.0) end end @@ -269,8 +246,7 @@ function OpenTaxiActionsMenu() ESX.UI.Menu.CloseAll() - ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'taxi_actions', - { + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'taxi_actions', { title = 'Taxi', align = 'top-left', elements = elements @@ -298,15 +274,13 @@ end function OpenMobileTaxiActionsMenu() ESX.UI.Menu.CloseAll() - ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'mobile_taxi_actions', - { + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'mobile_taxi_actions', { title = 'Taxi', align = 'top-left', elements = { - { label = _U('billing'), value = 'billing' }, - { label = _U('start_job'), value = 'start_job' } - } - }, function(data, menu) + {label = _U('billing'), value = 'billing'}, + {label = _U('start_job'), value = 'start_job'} + }}, function(data, menu) if data.current.value == 'billing' then ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'billing', { @@ -389,8 +363,7 @@ function OpenGetStocksMenu() }) end - ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'stocks_menu', - { + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'stocks_menu', { title = 'Taxi Stock', align = 'top-left', elements = elements @@ -400,7 +373,6 @@ function OpenGetStocksMenu() ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'stocks_menu_get_item_count', { title = _U('quantity') }, function(data2, menu2) - local count = tonumber(data2.value) if count == nil then @@ -414,7 +386,6 @@ function OpenGetStocksMenu() Citizen.Wait(1000) OpenGetStocksMenu() end - end, function(data2, menu2) menu2.close() end) @@ -441,8 +412,7 @@ function OpenPutStocksMenu() end end - ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'stocks_menu', - { + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'stocks_menu', { title = _U('inventory'), align = 'top-left', elements = elements @@ -452,7 +422,6 @@ function OpenPutStocksMenu() ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'stocks_menu_put_item_count', { title = _U('quantity') }, function(data2, menu2) - local count = tonumber(data2.value) if count == nil then @@ -537,7 +506,7 @@ Citizen.CreateThread(function() SetBlipColour (blip, 5) SetBlipAsShortRange(blip, true) - BeginTextCommandSetBlipName("STRING") + BeginTextCommandSetBlipName('STRING') AddTextComponentSubstringPlayerName(_U('blip_taxi')) EndTextCommandSetBlipName(blip) end) @@ -549,12 +518,13 @@ Citizen.CreateThread(function() if ESX.PlayerData.job and ESX.PlayerData.job.name == 'taxi' then local coords = GetEntityCoords(PlayerPedId()) - local isInMarker, currentZone = false + local isInMarker, letSleep, currentZone = false, true for k,v in pairs(Config.Zones) do local distance = GetDistanceBetweenCoords(coords, v.Pos.x, v.Pos.y, v.Pos.z, true) if v.Type ~= -1 and distance < Config.DrawDistance then + letSleep = false DrawMarker(v.Type, v.Pos.x, v.Pos.y, v.Pos.z, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, v.Size.x, v.Size.y, v.Size.z, v.Color.r, v.Color.g, v.Color.b, 100, false, false, 2, v.Rotate, nil, nil, false) end @@ -572,6 +542,10 @@ Citizen.CreateThread(function() HasAlreadyEnteredMarker = false TriggerEvent('esx_taxijob:hasExitedMarker', LastZone) end + + if letSleep then + Citizen.Wait(500) + end else Citizen.Wait(1000) end @@ -632,25 +606,25 @@ Citizen.CreateThread(function() SetEntityAsMissionEntity(CurrentCustomer, false, true) - CurrentCustomer, CurrentCustomerBlip, DestinationBlip, IsNearCustomer, CustomerIsEnteringVehicle, CustomerEnteredVehicle, TargetCoords = nil, nil, nil, false, false, false, nil + CurrentCustomer, CurrentCustomerBlip, DestinationBlip, IsNearCustomer, CustomerIsEnteringVehicle, CustomerEnteredVehicle, targetCoords = nil, nil, nil, false, false, false, nil end if IsPedInAnyVehicle(playerPed, false) then local vehicle = GetVehiclePedIsIn(playerPed, false) local playerCoords = GetEntityCoords(playerPed) local customerCoords = GetEntityCoords(CurrentCustomer) - local customerDistance = GetDistanceBetweenCoords(playerCoords.x, playerCoords.y, playerCoords.z, customerCoords.x, customerCoords.y, customerCoords.z) + local customerDistance = #(playerCoords - customerCoords) if IsPedSittingInVehicle(CurrentCustomer, vehicle) then if CustomerEnteredVehicle then - local targetDistance = GetDistanceBetweenCoords(playerCoords.x, playerCoords.y, playerCoords.z, TargetCoords.x, TargetCoords.y, TargetCoords.z) + local targetDistance = #(playerCoords - targetCoords) if targetDistance <= 10.0 then TaskLeaveVehicle(CurrentCustomer, vehicle, 0) ESX.ShowNotification(_U('arrive_dest')) - TaskGoStraightToCoord(CurrentCustomer, TargetCoords.x, TargetCoords.y, TargetCoords.z, 1.0, -1, 0.0, 0.0) + TaskGoStraightToCoord(CurrentCustomer, targetCoords.x, targetCoords.y, targetCoords.z, 1.0, -1, 0.0, 0.0) SetEntityAsMissionEntity(CurrentCustomer, false, true) TriggerServerEvent('esx_taxijob:success') RemoveBlip(DestinationBlip) @@ -663,26 +637,25 @@ Citizen.CreateThread(function() scope(CurrentCustomer) - CurrentCustomer, CurrentCustomerBlip, DestinationBlip, IsNearCustomer, CustomerIsEnteringVehicle, CustomerEnteredVehicle, TargetCoords = nil, nil, nil, false, false, false, nil + CurrentCustomer, CurrentCustomerBlip, DestinationBlip, IsNearCustomer, CustomerIsEnteringVehicle, CustomerEnteredVehicle, targetCoords = nil, nil, nil, false, false, false, nil end - if TargetCoords then - DrawMarker(36, TargetCoords.x, TargetCoords.y, TargetCoords.z + 1.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 234, 223, 72, 155, false, false, 2, true, nil, nil, false) + if targetCoords then + DrawMarker(36, targetCoords.x, targetCoords.y, targetCoords.z + 1.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 234, 223, 72, 155, false, false, 2, true, nil, nil, false) end else RemoveBlip(CurrentCustomerBlip) CurrentCustomerBlip = nil - TargetCoords = Config.JobLocations[GetRandomIntInRange(1, #Config.JobLocations)] - local distance = GetDistanceBetweenCoords(playerCoords, TargetCoords.x, TargetCoords.y, TargetCoords.z, true) - + targetCoords = Config.JobLocations[GetRandomIntInRange(1, #Config.JobLocations)] + local distance = #(playerCoords - targetCoords) while distance < Config.MinimumDistance do Citizen.Wait(5) - TargetCoords = Config.JobLocations[GetRandomIntInRange(1, #Config.JobLocations)] - distance = GetDistanceBetweenCoords(playerCoords, TargetCoords.x, TargetCoords.y, TargetCoords.z, true) + targetCoords = Config.JobLocations[GetRandomIntInRange(1, #Config.JobLocations)] + distance = #(playerCoords - targetCoords) end - local street = table.pack(GetStreetNameAtCoord(TargetCoords.x, TargetCoords.y, TargetCoords.z)) + local street = table.pack(GetStreetNameAtCoord(targetCoords.x, targetCoords.y, targetCoords.z)) local msg = nil if street[2] ~= 0 and street[2] ~= nil then @@ -693,10 +666,10 @@ Citizen.CreateThread(function() ESX.ShowNotification(msg) - DestinationBlip = AddBlipForCoord(TargetCoords.x, TargetCoords.y, TargetCoords.z) + DestinationBlip = AddBlipForCoord(targetCoords.x, targetCoords.y, targetCoords.z) - BeginTextCommandSetBlipName("STRING") - AddTextComponentSubstringPlayerName("Destination") + BeginTextCommandSetBlipName('STRING') + AddTextComponentSubstringPlayerName('Destination') EndTextCommandSetBlipName(blip) SetBlipRoute(DestinationBlip, true) @@ -754,7 +727,7 @@ Citizen.CreateThread(function() if CurrentAction and not IsDead then ESX.ShowHelpNotification(CurrentActionMsg) - if IsControlJustReleased(0, Keys['E']) and ESX.PlayerData.job and ESX.PlayerData.job.name == 'taxi' then + if IsControlJustReleased(0, 38) and ESX.PlayerData.job and ESX.PlayerData.job.name == 'taxi' then if CurrentAction == 'taxi_actions_menu' then OpenTaxiActionsMenu() elseif CurrentAction == 'cloakroom' then @@ -769,7 +742,7 @@ Citizen.CreateThread(function() end end - if IsControlJustReleased(0, Keys['F6']) and IsInputDisabled(0) and not IsDead and Config.EnablePlayerManagement and ESX.PlayerData.job and ESX.PlayerData.job.name == 'taxi' then + if IsControlJustReleased(0, 167) and IsInputDisabled(0) and not IsDead and Config.EnablePlayerManagement and ESX.PlayerData.job and ESX.PlayerData.job.name == 'taxi' then OpenMobileTaxiActionsMenu() end end From 701b438433d6031e2fc19687f20fd432619570ef Mon Sep 17 00:00:00 2001 From: KandaSoranyan <32266067+KandaSoranyan@users.noreply.github.com> Date: Fri, 31 May 2019 13:12:53 +0200 Subject: [PATCH 72/93] missing translations --- locales/fr.lua | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/locales/fr.lua b/locales/fr.lua index 4d942293..bcceafae 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -1,15 +1,15 @@ Locales['fr'] = { -- cloakroom - ['cloakroom_menu'] = 'cloakroom', - ['cloakroom_prompt'] = 'press ~INPUT_CONTEXT~ to open the ~y~cloakroom~s~.', - ['wear_citizen'] = 'citizen wear', - ['wear_work'] = 'taxi wear', + ['cloakroom_menu'] = 'vestiaire', + ['cloakroom_prompt'] = 'appuyez sur ~INPUT_CONTEXT~ pour ouvrir le ~y~cloakroom~s~.', + ['wear_citizen'] = 'tenue civile', + ['wear_work'] = 'tenue de travail', -- garage - ['spawner_prompt'] = 'press ~INPUT_CONTEXT~ to open the ~y~garage~s~.', + ['spawner_prompt'] = 'appuyez sur ~INPUT_CONTEXT~ pour ouvrir le ~y~garage~s~.', ['store_veh'] = 'appuyez sur ~INPUT_CONTEXT~ pour ranger le véhicule', ['spawn_veh'] = 'sortir véhicule', - ['spawnpoint_blocked'] = 'there is a vehicle blocking the spawnpoint!', + ['spawnpoint_blocked'] = 'un véhicule bloque la sortie!!', ['only_taxi'] = 'vous ne pouvez ranger que les taxi', ['taking_service'] = 'prise de service : Taxi/Uber', @@ -46,4 +46,4 @@ Locales['fr'] = { ['player_cannot_hold'] = 'vous n\'avez pas assez ~y~de place~s~ dans votre inventaire!', ['blip_taxi'] = 'taxi', ['phone_taxi'] = 'taxi', -} \ No newline at end of file +} From 2f8df295b48a541d6042b95d43ddca8c570f3582 Mon Sep 17 00:00:00 2001 From: rex2630 Date: Wed, 13 Nov 2019 16:39:28 +0100 Subject: [PATCH 73/93] Add support for new ESX weight system --- server/main.lua | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/server/main.lua b/server/main.lua index ff8ec2a6..ab64c9f0 100644 --- a/server/main.lua +++ b/server/main.lua @@ -38,10 +38,10 @@ AddEventHandler('esx_taxijob:success', function() xPlayer.addMoney(playerMoney) societyAccount.addMoney(societyMoney) - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('comp_earned', societyMoney, playerMoney)) + xPlayer.showNotification(_U('comp_earned', societyMoney, playerMoney)) else xPlayer.addMoney(total) - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('have_earned', total)) + xPlayer.showNotification(_U('have_earned', total)) end end) @@ -57,21 +57,20 @@ AddEventHandler('esx_taxijob:getStockItem', function(itemName, count) TriggerEvent('esx_addoninventory:getSharedInventory', 'society_taxi', function(inventory) local item = inventory.getItem(itemName) - local sourceItem = xPlayer.getInventoryItem(itemName) -- is there enough in the society? if count > 0 and item.count >= count then -- can the player carry the said amount of x item? - if sourceItem.limit ~= -1 and (sourceItem.count + count) > sourceItem.limit then - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('player_cannot_hold')) - else + if xPlayer.canCarryItem(itemName, count) then inventory.removeItem(itemName, count) xPlayer.addInventoryItem(itemName, count) - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('have_withdrawn', count, item.label)) + xPlayer.showNotification(_U('have_withdrawn', count, item.label)) + else + xPlayer.showNotification(_U('player_cannot_hold')) end else - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('quantity_invalid')) + xPlayer.showNotification(_U('quantity_invalid')) end end) end) @@ -97,9 +96,9 @@ AddEventHandler('esx_taxijob:putStockItems', function(itemName, count) if item.count >= 0 then xPlayer.removeInventoryItem(itemName, count) inventory.addItem(itemName, count) - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('have_deposited', count, item.label)) + xPlayer.showNotification(_U('have_deposited', count, item.label)) else - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('quantity_invalid')) + xPlayer.showNotification(_U('quantity_invalid')) end end) From 308889ac32ef478171687bc1f1f03b35db6062e5 Mon Sep 17 00:00:00 2001 From: Michael Douglas Date: Sat, 18 Jan 2020 11:01:00 -0300 Subject: [PATCH 74/93] Correcting and improving Portuguese locale (#45) * Correcting and improving translation * Update br.lua --- locales/br.lua | 72 ++++++++++++++++----------------- localization/br_esx_taxijob.sql | 25 ++++++++++++ 2 files changed, 61 insertions(+), 36 deletions(-) create mode 100644 localization/br_esx_taxijob.sql diff --git a/locales/br.lua b/locales/br.lua index 2ba4f59c..68e39f43 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -1,49 +1,49 @@ Locales['br'] = { -- cloakroom - ['cloakroom_menu'] = 'cloakroom', - ['cloakroom_prompt'] = 'press ~INPUT_CONTEXT~ to open the ~y~cloakroom~s~.', - ['wear_citizen'] = 'citizen wear', - ['wear_work'] = 'taxi wear', + ['cloakroom_menu'] = 'guarda-roupa', + ['cloakroom_prompt'] = 'pressione ~INPUT_CONTEXT~ para abrir o ~y~cloakroom~s~.', + ['wear_citizen'] = 'roupa de cidadão', + ['wear_work'] = 'roupa de taxista', -- garage - ['spawner_prompt'] = 'press ~INPUT_CONTEXT~ to open the ~y~garage~s~.', - ['store_veh'] = 'Pressione ~INPUT_CONTEXT~ para guardar o veículo', + ['spawner_prompt'] = 'pressione ~INPUT_CONTEXT~ para abrir a ~y~garage~s~.', + ['store_veh'] = 'pressione ~INPUT_CONTEXT~ para guardar o veículo', ['spawn_veh'] = 'pegar veículo', - ['spawnpoint_blocked'] = 'there is a vehicle blocking the spawnpoint!', - ['only_taxi'] = 'Você só pode guardar taxis.', + ['spawnpoint_blocked'] = 'existe um veículo bloqueando o ponto de spawn!', + ['only_taxi'] = 'você só pode guardar taxis.', - ['taking_service'] = 'Pegando serviço: Taxi/Uber', - ['full_service'] = 'Serviço completo: ', - ['amount_invalid'] = 'Valor inválido', - ['press_to_open'] = 'Pressione ~INPUT_CONTEXT~ para acessar o menu', - ['billing'] = 'Faturamento', - ['billing_sent'] = 'the bill has been registered!', - ['invoice_amount'] = 'Valor da fatura', - ['no_players_near'] = 'Nenhum jogador nas proximidades', - ['start_job'] = 'start / stop driving NPC jobs', - ['drive_search_pass'] = 'Dirigindo em busca de ~y~passageiros', - ['customer_found'] = 'Você ~g~encontrou~s~ um passageiro, dirija até o destino', - ['client_unconcious'] = 'Seu passageiro está ~r~insconsciente~s~. Procure por outro.', - ['arrive_dest'] = 'Você ~g~chegou~s~ ao seu destino', + ['taking_service'] = 'pegando serviço: Taxi/Uber', + ['full_service'] = 'serviço completo: ', + ['amount_invalid'] = 'valor inválido', + ['press_to_open'] = 'pressione ~INPUT_CONTEXT~ para acessar o menu', + ['billing'] = 'faturamento', + ['billing_sent'] = 'a fatura foi enviada!', + ['invoice_amount'] = 'valor da fatura', + ['no_players_near'] = 'nenhum jogador nas proximidades', + ['start_job'] = 'iniciar / parar missão', + ['drive_search_pass'] = 'dirigindo em busca de ~y~passageiros', + ['customer_found'] = 'você ~g~encontrou~s~ um passageiro, dirija até o destino', + ['client_unconcious'] = 'seu passageiro está ~r~insconsciente~s~. Procure por outro.', + ['arrive_dest'] = 'você ~g~chegou~s~ ao seu destino', ['take_me_to_near'] = '~s~Leve me para~y~ %s~s~, perto~y~ %s', ['take_me_to'] = '~s~Leve me para~y~ %s', - ['close_to_client'] = 'Você está perto do passageiro, aproximisse dele', - ['return_to_veh'] = 'Volte para o seu veículo para continuar a missão', - ['must_in_taxi'] = 'Você deve estar em um táxi para começar a missão', - ['must_in_vehicle'] = 'Você deve estar em um veículo para começar a missão', - ['have_earned'] = 'Você ganhou ~g~$%s~s~', - ['comp_earned'] = '- Sua empresa ganhou ~g~$%s~s~\n- Você ganhou ~g~$%s~s~', - ['deposit_stock'] = 'deposit Stock', - ['take_stock'] = 'take Stock', - ['boss_actions'] = 'boss Actions', - ['mission_complete'] = 'mission Completed', - ['quantity'] = 'quantity', - ['quantity_invalid'] = 'that is an invalid quantity!', - ['inventory'] = 'inventory', - ['taxi_client'] = 'taxi Client', + ['close_to_client'] = 'você está perto do passageiro, aproximisse dele', + ['return_to_veh'] = 'volte para o seu veículo para continuar a missão', + ['must_in_taxi'] = 'você deve estar em um táxi para começar a missão', + ['must_in_vehicle'] = 'você deve estar em um veículo para começar a missão', + ['have_earned'] = 'você ganhou ~g~$%s~s~', + ['comp_earned'] = '- sua empresa ganhou ~g~$%s~s~\n- Você ganhou ~g~$%s~s~', + ['deposit_stock'] = 'depositar estoque', + ['take_stock'] = 'retirar estoque', + ['boss_actions'] = 'ações de chefe', + ['mission_complete'] = 'missão completa', + ['quantity'] = 'quantidade', + ['quantity_invalid'] = 'é uma quantidade inválida!', + ['inventory'] = 'inventário', + ['taxi_client'] = 'cliente do taxi', ['have_withdrawn'] = 'você retirou ~y~x%s~s~ ~b~%s~s~', ['have_deposited'] = 'você depositou ~y~x%s~s~ ~b~%s~s~', ['player_cannot_hold'] = 'você não tem espaço suficiente em seu inventário!', ['blip_taxi'] = 'taxi', ['phone_taxi'] = 'taxi', -} \ No newline at end of file +} diff --git a/localization/br_esx_taxijob.sql b/localization/br_esx_taxijob.sql new file mode 100644 index 00000000..608db9c4 --- /dev/null +++ b/localization/br_esx_taxijob.sql @@ -0,0 +1,25 @@ +USE `essentialmode`; + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('society_taxi', 'Taxi', 1) +; + +INSERT INTO `datastore` (name, label, shared) VALUES + ('society_taxi', 'Taxi', 1) +; + +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('society_taxi', 'Taxi', 1) +; + +INSERT INTO `jobs` (name, label) VALUES + ('taxi', 'Taxi') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('taxi',0,'recrue','Recrutar',12,'{"hair_2":0,"hair_color_2":0,"torso_1":32,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":0,"age_2":0,"glasses_2":0,"ears_2":0,"arms":27,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',1,'novice','Taxista',24,'{"hair_2":0,"hair_color_2":0,"torso_1":32,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":0,"age_2":0,"glasses_2":0,"ears_2":0,"arms":27,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',2,'experimente','Taxista Experiente',36,'{"hair_2":0,"hair_color_2":0,"torso_1":26,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":57,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":11,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',3,'uber','Uber',48,'{"hair_2":0,"hair_color_2":0,"torso_1":26,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":57,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":11,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',4,'boss','Taxista Chefe',0,'{"hair_2":0,"hair_color_2":0,"torso_1":29,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":1,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":4,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}') +; From fe0d3b617463c1950aa0d9aae3d36c55c591da41 Mon Sep 17 00:00:00 2001 From: rex2630 Date: Sun, 19 Jan 2020 17:01:04 +0100 Subject: [PATCH 75/93] Replace __resource.lua with fxmanifest.lua --- __resource.lua => fxmanifest.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) rename __resource.lua => fxmanifest.lua (84%) diff --git a/__resource.lua b/fxmanifest.lua similarity index 84% rename from __resource.lua rename to fxmanifest.lua index 90167455..ff5ac70c 100644 --- a/__resource.lua +++ b/fxmanifest.lua @@ -1,4 +1,6 @@ -resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' +fx_version 'adamant' + +game 'gta5' description 'ESX Taxi Job' @@ -30,4 +32,4 @@ server_scripts { 'server/main.lua' } -dependency 'es_extended' \ No newline at end of file +dependency 'es_extended' From f147a7be8109e8bd94c1df5be4f32c27bf67ae02 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Tue, 11 Feb 2020 21:25:46 +0100 Subject: [PATCH 76/93] Minor changes --- README.md | 6 ++++-- client/main.lua | 29 ++++++++++++----------------- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index c1882150..cc46a37a 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,12 @@ # esx_taxijob +ESX Taxi Job adds driving cabs as a service, and more including NPC missions. + ## Requirements * Auto mode * [esx_service](https://github.com/ESX-Org/esx_service) - + * Player management (billing and boss actions) * [esx_society](https://github.com/ESX-Org/esx_society) * [esx_billing](https://github.com/ESX-Org/esx_billing) @@ -38,7 +40,7 @@ start esx_taxijob ### License esx_taxijob -Copyright (C) 2015-2018 Jérémie N'gadi +Copyright (C) 2015-2020 Jérémie N'gadi This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version. diff --git a/client/main.lua b/client/main.lua index debf7487..becd6c01 100644 --- a/client/main.lua +++ b/client/main.lua @@ -27,12 +27,12 @@ function ShowLoadingPromt(msg, time, type) Citizen.CreateThread(function() Citizen.Wait(0) - BeginTextCommandBusyString('STRING') + BeginTextCommandBusyspinnerOn('STRING') AddTextComponentSubstringPlayerName(msg) - EndTextCommandBusyString(type) + EndTextCommandBusyspinnerOn(type) Citizen.Wait(time) - RemoveLoadingPrompt() + BusyspinnerOff() end) end @@ -108,15 +108,13 @@ end function OpenCloakroom() ESX.UI.Menu.CloseAll() - ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'taxi_cloakroom', - { + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'taxi_cloakroom', { title = _U('cloakroom_menu'), align = 'top-left', elements = { - { label = _U('wear_citizen'), value = 'wear_citizen' }, - { label = _U('wear_work'), value = 'wear_work'} - } - }, function(data, menu) + {label = _U('wear_citizen'), value = 'wear_citizen'}, + {label = _U('wear_work'), value = 'wear_work'} + }}, function(data, menu) if data.current.value == 'wear_citizen' then ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin) TriggerEvent('skinchanger:loadSkin', skin) @@ -155,8 +153,7 @@ function OpenVehicleSpawnerMenu() }) end - ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_spawner', - { + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_spawner', { title = _U('spawn_veh'), align = 'top-left', elements = elements @@ -176,7 +173,6 @@ function OpenVehicleSpawnerMenu() end) TriggerServerEvent('esx_society:removeVehicleFromGarage', 'taxi', vehicleProps) - end, function(data, menu) CurrentAction = 'vehicle_spawner' CurrentActionMsg = _U('spawner_prompt') @@ -188,11 +184,10 @@ function OpenVehicleSpawnerMenu() else -- not society vehicles - ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_spawner', - { - title = _U('spawn_veh'), - align = 'top-left', - elements = Config.AuthorizedVehicles + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_spawner', { + title = _U('spawn_veh'), + align = 'top-left', + elements = Config.AuthorizedVehicles }, function(data, menu) if not ESX.Game.IsSpawnPointClear(Config.Zones.VehicleSpawnPoint.Pos, 5.0) then ESX.ShowNotification(_U('spawnpoint_blocked')) From 7e9cee19a8791a57202245bd80136081067b0081 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Wed, 4 Mar 2020 11:05:31 +0100 Subject: [PATCH 77/93] Security improvement and minor cleanup --- client/main.lua | 17 +++---- config.lua | 11 ++--- server/main.lua | 127 +++++++++++++++++++++++------------------------- 3 files changed, 69 insertions(+), 86 deletions(-) diff --git a/client/main.lua b/client/main.lua index becd6c01..0d953449 100644 --- a/client/main.lua +++ b/client/main.lua @@ -392,19 +392,14 @@ end function OpenPutStocksMenu() ESX.TriggerServerCallback('esx_taxijob:getPlayerInventory', function(inventory) - local elements = {} - for i=1, #inventory.items, 1 do - local item = inventory.items[i] - - if item.count > 0 then - table.insert(elements, { - label = item.label .. ' x' .. item.count, - type = 'item_standard', -- not used - value = item.name - }) - end + for k,v in ipairs(inventory) do + table.insert(elements, { + label = v.label .. ' x' .. v.count, + type = 'item_standard', -- not used + value = v.name + }) end ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'stocks_menu', { diff --git a/config.lua b/config.lua index cebf1139..8b887be6 100644 --- a/config.lua +++ b/config.lua @@ -1,23 +1,18 @@ Config = {} -Config.DrawDistance = 100.0 +Config.DrawDistance = 100 Config.NPCJobEarnings = {min = 300, max = 600} Config.MinimumDistance = 3000 -- Minimum NPC job destination distance from the pickup in GTA units, a higher number prevents nearby destionations. Config.MaxInService = -1 -Config.EnablePlayerManagement = false +Config.EnablePlayerManagement = true Config.EnableSocietyOwnedVehicles = false Config.Locale = 'fr' Config.AuthorizedVehicles = { - - { - model = 'taxi', - label = 'Taxi' - } - + {model = 'taxi', label = 'Taxi'} } Config.Zones = { diff --git a/server/main.lua b/server/main.lua index ab64c9f0..1667071c 100644 --- a/server/main.lua +++ b/server/main.lua @@ -1,4 +1,5 @@ ESX = nil +local lastPlayerSuccess = {} TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) @@ -9,70 +10,67 @@ end TriggerEvent('esx_phone:registerNumber', 'taxi', _U('taxi_client'), true, true) TriggerEvent('esx_society:registerSociety', 'taxi', 'Taxi', 'society_taxi', 'society_taxi', 'society_taxi', {type = 'public'}) -RegisterServerEvent('esx_taxijob:success') +RegisterNetEvent('esx_taxijob:success') AddEventHandler('esx_taxijob:success', function() local xPlayer = ESX.GetPlayerFromId(source) + local timeNow = os.clock() - if xPlayer.job.name ~= 'taxi' then - print(('esx_taxijob: %s attempted to trigger success!'):format(xPlayer.identifier)) - return - end + if xPlayer.job.name == 'taxi' then + if not lastPlayerSuccess[source] or timeNow - lastPlayerSuccess[source] > 5 then + lastPlayerSuccess[source] = timeNow - math.randomseed(os.time()) + math.randomseed(os.time()) + local total = math.random(Config.NPCJobEarnings.min, Config.NPCJobEarnings.max) - local total = math.random(Config.NPCJobEarnings.min, Config.NPCJobEarnings.max) - local societyAccount + if xPlayer.job.grade >= 3 then + total = total * 2 + end - if xPlayer.job.grade >= 3 then - total = total * 2 - end + TriggerEvent('esx_addonaccount:getSharedAccount', 'society_taxi', function(account) + if account then + local playerMoney = ESX.Math.Round(total / 100 * 30) + local societyMoney = ESX.Math.Round(total / 100 * 70) - TriggerEvent('esx_addonaccount:getSharedAccount', 'society_taxi', function(account) - societyAccount = account - end) + xPlayer.addMoney(playerMoney) + account.addMoney(societyMoney) - if societyAccount then - local playerMoney = ESX.Math.Round(total / 100 * 30) - local societyMoney = ESX.Math.Round(total / 100 * 70) - - xPlayer.addMoney(playerMoney) - societyAccount.addMoney(societyMoney) - - xPlayer.showNotification(_U('comp_earned', societyMoney, playerMoney)) + xPlayer.showNotification(_U('comp_earned', societyMoney, playerMoney)) + else + xPlayer.addMoney(total) + xPlayer.showNotification(_U('have_earned', total)) + end + end) + end else - xPlayer.addMoney(total) - xPlayer.showNotification(_U('have_earned', total)) + print(('[esx_taxijob] [^3WARNING^7] %s attempted to trigger success (cheating)'):format(xPlayer.identifier)) end - end) -RegisterServerEvent('esx_taxijob:getStockItem') +RegisterNetEvent('esx_taxijob:getStockItem') AddEventHandler('esx_taxijob:getStockItem', function(itemName, count) local xPlayer = ESX.GetPlayerFromId(source) - if xPlayer.job.name ~= 'taxi' then - print(('esx_taxijob: %s attempted to trigger getStockItem!'):format(xPlayer.identifier)) - return - end - - TriggerEvent('esx_addoninventory:getSharedInventory', 'society_taxi', function(inventory) - local item = inventory.getItem(itemName) + if xPlayer.job.name == 'taxi' then + TriggerEvent('esx_addoninventory:getSharedInventory', 'society_taxi', function(inventory) + local item = inventory.getItem(itemName) - -- is there enough in the society? - if count > 0 and item.count >= count then - - -- can the player carry the said amount of x item? - if xPlayer.canCarryItem(itemName, count) then - inventory.removeItem(itemName, count) - xPlayer.addInventoryItem(itemName, count) - xPlayer.showNotification(_U('have_withdrawn', count, item.label)) + -- is there enough in the society? + if count > 0 and item.count >= count then + -- can the player carry the said amount of x item? + if xPlayer.canCarryItem(itemName, count) then + inventory.removeItem(itemName, count) + xPlayer.addInventoryItem(itemName, count) + xPlayer.showNotification(_U('have_withdrawn', count, item.label)) + else + xPlayer.showNotification(_U('player_cannot_hold')) + end else - xPlayer.showNotification(_U('player_cannot_hold')) + xPlayer.showNotification(_U('quantity_invalid')) end - else - xPlayer.showNotification(_U('quantity_invalid')) - end - end) + end) + else + print(('[esx_taxijob] [^3WARNING^7] %s attempted to trigger getStockItem'):format(xPlayer.identifier)) + end end) ESX.RegisterServerCallback('esx_taxijob:getStockItems', function(source, cb) @@ -81,33 +79,28 @@ ESX.RegisterServerCallback('esx_taxijob:getStockItems', function(source, cb) end) end) -RegisterServerEvent('esx_taxijob:putStockItems') +RegisterNetEvent('esx_taxijob:putStockItems') AddEventHandler('esx_taxijob:putStockItems', function(itemName, count) local xPlayer = ESX.GetPlayerFromId(source) - if xPlayer.job.name ~= 'taxi' then - print(('esx_taxijob: %s attempted to trigger putStockItems!'):format(xPlayer.identifier)) - return + if xPlayer.job.name == 'taxi' then + TriggerEvent('esx_addoninventory:getSharedInventory', 'society_taxi', function(inventory) + local item = inventory.getItem(itemName) + + if item.count >= 0 then + xPlayer.removeInventoryItem(itemName, count) + inventory.addItem(itemName, count) + xPlayer.showNotification(_U('have_deposited', count, item.label)) + else + xPlayer.showNotification(_U('quantity_invalid')) + end + end) + else + print(('[esx_taxijob] [^3WARNING^7] %s attempted to trigger putStockItems'):format(xPlayer.identifier)) end - - TriggerEvent('esx_addoninventory:getSharedInventory', 'society_taxi', function(inventory) - local item = inventory.getItem(itemName) - - if item.count >= 0 then - xPlayer.removeInventoryItem(itemName, count) - inventory.addItem(itemName, count) - xPlayer.showNotification(_U('have_deposited', count, item.label)) - else - xPlayer.showNotification(_U('quantity_invalid')) - end - - end) - end) ESX.RegisterServerCallback('esx_taxijob:getPlayerInventory', function(source, cb) local xPlayer = ESX.GetPlayerFromId(source) - local items = xPlayer.inventory - - cb( { items = items } ) + cb(xPlayer.getInventory()) end) From 6d81ff44ce2f039df1e911d587f50a251fda370a Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Tue, 14 Apr 2020 16:53:26 +0200 Subject: [PATCH 78/93] Latest ESX code --- client/main.lua | 2 +- esx_taxijob.sql | 2 +- localization/br_esx_taxijob.sql | 2 +- localization/de_esx_taxijob.sql | 2 +- localization/en_esx_taxijob.sql | 2 +- localization/fi_esx_taxijob.sql | 2 +- localization/pl_esx_taxijob.sql | 2 +- localization/sv_esx_taxijob.sql | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/client/main.lua b/client/main.lua index 0d953449..fa751c83 100644 --- a/client/main.lua +++ b/client/main.lua @@ -742,6 +742,6 @@ AddEventHandler('esx:onPlayerDeath', function() IsDead = true end) -AddEventHandler('playerSpawned', function(spawn) +AddEventHandler('esx:onPlayerSpawn', function(spawn) IsDead = false end) diff --git a/esx_taxijob.sql b/esx_taxijob.sql index 37047ac2..03a4ba19 100644 --- a/esx_taxijob.sql +++ b/esx_taxijob.sql @@ -1,4 +1,4 @@ -USE `essentialmode`; +USE `es_extended`; INSERT INTO `addon_account` (name, label, shared) VALUES ('society_taxi', 'Taxi', 1) diff --git a/localization/br_esx_taxijob.sql b/localization/br_esx_taxijob.sql index 608db9c4..556e62e7 100644 --- a/localization/br_esx_taxijob.sql +++ b/localization/br_esx_taxijob.sql @@ -1,4 +1,4 @@ -USE `essentialmode`; +USE `es_extended`; INSERT INTO `addon_account` (name, label, shared) VALUES ('society_taxi', 'Taxi', 1) diff --git a/localization/de_esx_taxijob.sql b/localization/de_esx_taxijob.sql index 5339916f..e674a7f7 100644 --- a/localization/de_esx_taxijob.sql +++ b/localization/de_esx_taxijob.sql @@ -1,4 +1,4 @@ -USE `essentialmode`; +USE `es_extended`; INSERT INTO `addon_account` (name, label, shared) VALUES ('society_taxi', 'Taxi', 1) diff --git a/localization/en_esx_taxijob.sql b/localization/en_esx_taxijob.sql index 30eaf93b..619f492a 100644 --- a/localization/en_esx_taxijob.sql +++ b/localization/en_esx_taxijob.sql @@ -1,4 +1,4 @@ -USE `essentialmode`; +USE `es_extended`; INSERT INTO `addon_account` (name, label, shared) VALUES ('society_taxi', 'Taxi', 1) diff --git a/localization/fi_esx_taxijob.sql b/localization/fi_esx_taxijob.sql index 8c3a5b66..03b506f4 100644 --- a/localization/fi_esx_taxijob.sql +++ b/localization/fi_esx_taxijob.sql @@ -1,4 +1,4 @@ -USE `essentialmode`; +USE `es_extended`; INSERT INTO `addon_account` (name, label, shared) VALUES ('society_taxi', 'Taxi', 1) diff --git a/localization/pl_esx_taxijob.sql b/localization/pl_esx_taxijob.sql index 3abcb442..105d9baa 100644 --- a/localization/pl_esx_taxijob.sql +++ b/localization/pl_esx_taxijob.sql @@ -1,4 +1,4 @@ -USE `essentialmode`; +USE `es_extended`; INSERT INTO `addon_account` (name, label, shared) VALUES ('society_taxi', 'Taxi', 1) diff --git a/localization/sv_esx_taxijob.sql b/localization/sv_esx_taxijob.sql index 4f36a640..44cf8ef9 100644 --- a/localization/sv_esx_taxijob.sql +++ b/localization/sv_esx_taxijob.sql @@ -1,4 +1,4 @@ -USE `essentialmode`; +USE `es_extended`; INSERT INTO `addon_account` (name, label, shared) VALUES ('society_taxi', 'Taxi', 1) From ee484b5b5af776caad6f254ffdfb4800afbea72c Mon Sep 17 00:00:00 2001 From: userMacieG Date: Tue, 14 Apr 2020 18:34:34 +0200 Subject: [PATCH 79/93] Update fr.lua --- locales/fr.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/locales/fr.lua b/locales/fr.lua index bcceafae..ffd33099 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -46,4 +46,6 @@ Locales['fr'] = { ['player_cannot_hold'] = 'vous n\'avez pas assez ~y~de place~s~ dans votre inventaire!', ['blip_taxi'] = 'taxi', ['phone_taxi'] = 'taxi', + ['taxi'] = 'taxi', + ['taxi_stock'] = 'taxi Stock' } From c3e5f476f52d91370be4d601dab043dc567d9593 Mon Sep 17 00:00:00 2001 From: userMacieG Date: Tue, 14 Apr 2020 18:35:01 +0200 Subject: [PATCH 80/93] Update pl.lua --- locales/pl.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/locales/pl.lua b/locales/pl.lua index c2453ce9..5e79fdf1 100644 --- a/locales/pl.lua +++ b/locales/pl.lua @@ -46,4 +46,6 @@ Locales['pl'] = { ['player_cannot_hold'] = '~r~Nie~s~ masz wystarczająco ~y~wolnego miejsca~s~ w swoim ekwipunku!', ['blip_taxi'] = 'taxi', ['phone_taxi'] = 'taxi', -} \ No newline at end of file + ['taxi'] = 'taxi', + ['taxi_stock'] = 'taxi Stock' +} From 2031961da35e4e0b200627b0317019be895c4724 Mon Sep 17 00:00:00 2001 From: userMacieG Date: Tue, 14 Apr 2020 18:35:28 +0200 Subject: [PATCH 81/93] Update sv.lua --- locales/sv.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/locales/sv.lua b/locales/sv.lua index 214cb1a5..c6ea355f 100644 --- a/locales/sv.lua +++ b/locales/sv.lua @@ -46,4 +46,6 @@ Locales['sv'] = { ['player_cannot_hold'] = 'du har ~r~inte~s~ tillräckligt med ~y~utrymme~s~ för att hålla det!', ['blip_taxi'] = 'taxifirman', ['phone_taxi'] = 'taxi', -} \ No newline at end of file + ['taxi'] = 'taxi', + ['taxi_stock'] = 'taxi Stock' +} From 627e6eba7bef5f33488126626163fc1d1d8778eb Mon Sep 17 00:00:00 2001 From: userMacieG Date: Fri, 3 Jul 2020 19:23:17 +0200 Subject: [PATCH 82/93] Update br.lua (#50) --- locales/br.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/locales/br.lua b/locales/br.lua index 68e39f43..e47b6f2f 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -46,4 +46,6 @@ Locales['br'] = { ['player_cannot_hold'] = 'você não tem espaço suficiente em seu inventário!', ['blip_taxi'] = 'taxi', ['phone_taxi'] = 'taxi', + ['taxi'] = 'taxi', + ['taxi_stock'] = 'taxi Stock' } From bae80b48e991405b62fade51895146f1a978dec8 Mon Sep 17 00:00:00 2001 From: userMacieG Date: Sun, 19 Jul 2020 13:40:08 +0200 Subject: [PATCH 83/93] Update de.lua (#52) --- locales/de.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/locales/de.lua b/locales/de.lua index d620cf3d..8b728530 100644 --- a/locales/de.lua +++ b/locales/de.lua @@ -46,4 +46,6 @@ Locales['de'] = { ['player_cannot_hold'] = 'you do ~r~not~s~ have enough ~y~free space~s~ in your inventory!', ['blip_taxi'] = 'taxi', ['phone_taxi'] = 'taxi', -} \ No newline at end of file + ['taxi'] = 'taxi', + ['taxi_stock'] = 'taxi Stock' +} From 52f1a6721b318fa754faac0eab5ae42f7c72c482 Mon Sep 17 00:00:00 2001 From: userMacieG Date: Sun, 19 Jul 2020 13:40:20 +0200 Subject: [PATCH 84/93] Update en.lua (#53) --- locales/en.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/locales/en.lua b/locales/en.lua index 6b1f0681..a060aa8a 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -46,4 +46,7 @@ Locales['en'] = { ['player_cannot_hold'] = 'you do ~r~not~s~ have enough ~y~free space~s~ in your inventory!', ['blip_taxi'] = 'downtown Cab Co.', ['phone_taxi'] = 'downtown Cab Co.', -} \ No newline at end of file + ['taxi'] = 'taxi', + ['taxi_stock'] = 'taxi Stock' +} +} From b3b2b3a2ecfe870b4822c3f295f8fba3ad84c084 Mon Sep 17 00:00:00 2001 From: userMacieG Date: Sun, 19 Jul 2020 13:40:49 +0200 Subject: [PATCH 85/93] Update fi.lua (#54) --- locales/fi.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/locales/fi.lua b/locales/fi.lua index e68f9b3c..8e2a66e9 100644 --- a/locales/fi.lua +++ b/locales/fi.lua @@ -46,4 +46,6 @@ Locales['fi'] = { ['player_cannot_hold'] = 'sinulla ~r~ei ole~s~ enempää ~y~vapaata tilaa~s~ repussasi!', ['blip_taxi'] = 'taxi', ['phone_taxi'] = 'taxi', -} \ No newline at end of file + ['taxi'] = 'taxi', + ['taxi_stock'] = 'taxi Stock' +} From cb085f488df22d0a166132d35104326339d38373 Mon Sep 17 00:00:00 2001 From: BrakingESX247 <67766145+BrakingESX247@users.noreply.github.com> Date: Sun, 19 Jul 2020 18:26:37 +0100 Subject: [PATCH 86/93] Possibly fixing issues with putting stock. --- client/main.lua | 22 +++++++++++++--------- server/main.lua | 8 +++++--- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/client/main.lua b/client/main.lua index fa751c83..395d63eb 100644 --- a/client/main.lua +++ b/client/main.lua @@ -393,15 +393,19 @@ end function OpenPutStocksMenu() ESX.TriggerServerCallback('esx_taxijob:getPlayerInventory', function(inventory) local elements = {} + + for i=1, #inventory.items, 1 do + local item = inventory.items[i] - for k,v in ipairs(inventory) do - table.insert(elements, { - label = v.label .. ' x' .. v.count, - type = 'item_standard', -- not used - value = v.name - }) - end - + if item.count > 0 then + table.insert(elements, { + label = item.label .. ' x' .. item.count, + type = 'item_standard', + value = item.name + }) + end + end + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'stocks_menu', { title = _U('inventory'), align = 'top-left', @@ -744,4 +748,4 @@ end) AddEventHandler('esx:onPlayerSpawn', function(spawn) IsDead = false -end) +end) \ No newline at end of file diff --git a/server/main.lua b/server/main.lua index 1667071c..6e9b49e0 100644 --- a/server/main.lua +++ b/server/main.lua @@ -100,7 +100,9 @@ AddEventHandler('esx_taxijob:putStockItems', function(itemName, count) end end) -ESX.RegisterServerCallback('esx_taxijob:getPlayerInventory', function(source, cb) +ESX.RegisterServerCallback('esx_policejob:getPlayerInventory', function(source, cb) local xPlayer = ESX.GetPlayerFromId(source) - cb(xPlayer.getInventory()) -end) + local items = xPlayer.inventory + + cb({items = items}) +end) \ No newline at end of file From b13ba794461939c4c2b04abdf686da69d27c31f7 Mon Sep 17 00:00:00 2001 From: userMacieG Date: Sun, 19 Jul 2020 23:08:13 +0200 Subject: [PATCH 87/93] Fix for incorrect server call name (#60) --- server/main.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/main.lua b/server/main.lua index 6e9b49e0..932e1b32 100644 --- a/server/main.lua +++ b/server/main.lua @@ -100,9 +100,9 @@ AddEventHandler('esx_taxijob:putStockItems', function(itemName, count) end end) -ESX.RegisterServerCallback('esx_policejob:getPlayerInventory', function(source, cb) +ESX.RegisterServerCallback('esx_taxijob:getPlayerInventory', function(source, cb) local xPlayer = ESX.GetPlayerFromId(source) local items = xPlayer.inventory cb({items = items}) -end) \ No newline at end of file +end) From c927de244f5cef1548e714973fde241cfae0e7d0 Mon Sep 17 00:00:00 2001 From: BrakingESX247 <67766145+BrakingESX247@users.noreply.github.com> Date: Mon, 20 Jul 2020 14:20:22 +0100 Subject: [PATCH 88/93] Update menu locales. Credits go to @usermacieg Co-Authored-By: userMacieG --- client/main.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/main.lua b/client/main.lua index 395d63eb..48b398f6 100644 --- a/client/main.lua +++ b/client/main.lua @@ -242,7 +242,7 @@ function OpenTaxiActionsMenu() ESX.UI.Menu.CloseAll() ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'taxi_actions', { - title = 'Taxi', + title = _U('taxi'), align = 'top-left', elements = elements }, function(data, menu) @@ -270,7 +270,7 @@ function OpenMobileTaxiActionsMenu() ESX.UI.Menu.CloseAll() ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'mobile_taxi_actions', { - title = 'Taxi', + title = _U('taxi'), align = 'top-left', elements = { {label = _U('billing'), value = 'billing'}, @@ -359,7 +359,7 @@ function OpenGetStocksMenu() end ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'stocks_menu', { - title = 'Taxi Stock', + title = _U('taxi_stock'), align = 'top-left', elements = elements }, function(data, menu) From 778bcf82d194caf175d4579941149795b080e1a5 Mon Sep 17 00:00:00 2001 From: BrakingESX247 <67766145+BrakingESX247@users.noreply.github.com> Date: Mon, 20 Jul 2020 14:26:39 +0100 Subject: [PATCH 89/93] Updating config.lua User-frendlier config. --- config.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config.lua b/config.lua index 8b887be6..407366d3 100644 --- a/config.lua +++ b/config.lua @@ -1,15 +1,15 @@ Config = {} -Config.DrawDistance = 100 +Config.DrawDistance = 10.0 -- How close do you need to be for the markers to be drawn (in GTA units). Config.NPCJobEarnings = {min = 300, max = 600} Config.MinimumDistance = 3000 -- Minimum NPC job destination distance from the pickup in GTA units, a higher number prevents nearby destionations. -Config.MaxInService = -1 -Config.EnablePlayerManagement = true +Config.MaxInService = -1 -- How much people can be in service at once? +Config.EnablePlayerManagement = true -- Enable society managing. Config.EnableSocietyOwnedVehicles = false -Config.Locale = 'fr' +Config.Locale = 'en' Config.AuthorizedVehicles = { {model = 'taxi', label = 'Taxi'} From dda412968d43e9d892b5b487ef8574a7a462ce79 Mon Sep 17 00:00:00 2001 From: BrakingESX247 <67766145+BrakingESX247@users.noreply.github.com> Date: Wed, 22 Jul 2020 02:07:34 +0100 Subject: [PATCH 90/93] Adding a check If a player is using an authorized vehicles. Co-Authored-By: William Plunkett Jr --- client/main.lua | 13 +++++++++++++ locales/br.lua | 1 + locales/de.lua | 1 + locales/en.lua | 1 + locales/fi.lua | 1 + locales/fr.lua | 1 + locales/pl.lua | 1 + locales/sv.lua | 1 + 8 files changed, 20 insertions(+) diff --git a/client/main.lua b/client/main.lua index 48b398f6..6dce9572 100644 --- a/client/main.lua +++ b/client/main.lua @@ -713,6 +713,19 @@ Citizen.CreateThread(function() end end) +Citizen.CreateThread(function() + while onJob do + Citizen.Wait(10000) + if ESX.PlayerData.job ~= nil and ESX.PlayerData.job.grade < 3 then + if not IsInAuthorizedVehicle() then + ClearCurrentMission() + OnJob = false + ESX.ShowNotification(_U('not_in_taxi')) + end + end + end +end) + -- Key Controls Citizen.CreateThread(function() while true do diff --git a/locales/br.lua b/locales/br.lua index e47b6f2f..21e1b7a1 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -31,6 +31,7 @@ Locales['br'] = { ['return_to_veh'] = 'volte para o seu veículo para continuar a missão', ['must_in_taxi'] = 'você deve estar em um táxi para começar a missão', ['must_in_vehicle'] = 'você deve estar em um veículo para começar a missão', + ['not_in_taxi'] = 'You left the taxi while on mission!', ['have_earned'] = 'você ganhou ~g~$%s~s~', ['comp_earned'] = '- sua empresa ganhou ~g~$%s~s~\n- Você ganhou ~g~$%s~s~', ['deposit_stock'] = 'depositar estoque', diff --git a/locales/de.lua b/locales/de.lua index 8b728530..06a22aa3 100644 --- a/locales/de.lua +++ b/locales/de.lua @@ -31,6 +31,7 @@ Locales['de'] = { ['return_to_veh'] = 'bitte kehre zu deinem Fahezeug zurück umd die Mission fortzuführen', ['must_in_taxi'] = 'Du musst in einem Taxis sein umd die Mission starten zu können', ['must_in_vehicle'] = 'Du musst in einem Fahrzeug sein um die Mission starten zu können', + ['not_in_taxi'] = 'You left the taxi while on mission!', ['have_earned'] = 'verdient ~g~$%s~s~', ['comp_earned'] = '- Die Firma verdient ~g~$\n- Verdient ~g~$%s~s~', ['deposit_stock'] = 'deposit Stock', diff --git a/locales/en.lua b/locales/en.lua index a060aa8a..8e5d06c4 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -31,6 +31,7 @@ Locales['en'] = { ['return_to_veh'] = 'please return to your vehicle to continue the mission', ['must_in_taxi'] = 'you must be in a ~y~taxi~s~ to start the mission', ['must_in_vehicle'] = 'you must be in a vehicle to begin the mission', + ['not_in_taxi'] = 'You left the taxi while on mission!', ['have_earned'] = 'you have earned ~g~$%s~s~', ['comp_earned'] = '- your company has earned ~g~$%s~s~\n- you have earned ~g~$%s~s~', ['deposit_stock'] = 'deposit Stock', diff --git a/locales/fi.lua b/locales/fi.lua index 8e2a66e9..a1fb5d91 100644 --- a/locales/fi.lua +++ b/locales/fi.lua @@ -31,6 +31,7 @@ Locales['fi'] = { ['return_to_veh'] = 'Mene takaisin ajoneuvoon, jatkaaksesi töitä', ['must_in_taxi'] = 'Sinun pitää olla taxissa että voit alottaa työn', ['must_in_vehicle'] = 'Sinun pitää olla ajoneuvossa että voit alottaa työn', + ['not_in_taxi'] = 'You left the taxi while on mission!', ['have_earned'] = 'Sinä tienasit ~g~€%s~s~', ['comp_earned'] = '- Yrityksesi tienasi ~g~€%s~s~\n- Sinä tienasit ~g~€%s~s~', ['deposit_stock'] = 'Talleta varastoon', diff --git a/locales/fr.lua b/locales/fr.lua index ffd33099..56aae71b 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -31,6 +31,7 @@ Locales['fr'] = { ['return_to_veh'] = 'veuillez remonter dans votre véhicule pour continuer la mission', ['must_in_taxi'] = 'vous devez être dans un taxi pour commencer la mission', ['must_in_vehicle'] = 'vous devez être dans un véhicule pour commencer la mission', + ['not_in_taxi'] = 'You left the taxi while on mission!', ['have_earned'] = 'vous avez gagné ~g~$%s~s~', ['comp_earned'] = '- Votre société a gagné ~g~$%s~s~\n- Vous avez gagné ~g~$%s~s~', ['deposit_stock'] = 'Déposer Stock', diff --git a/locales/pl.lua b/locales/pl.lua index 5e79fdf1..47a8358a 100644 --- a/locales/pl.lua +++ b/locales/pl.lua @@ -31,6 +31,7 @@ Locales['pl'] = { ['return_to_veh'] = 'proszę wróć do swojego pojazdu aby kontynuować misję', ['must_in_taxi'] = 'musisz być w taksówce aby rozpocząć misję', ['must_in_vehicle'] = 'musisz być w pojeździe aby rozpocząć misję', + ['not_in_taxi'] = 'You left the taxi while on mission!', ['have_earned'] = 'zarabiasz ~g~$%s~s~', ['comp_earned'] = '- Twoja firma zarobiła ~g~$%s~s~\n- Zarabiasz ~g~$%s~s~', ['deposit_stock'] = 'depozyt', diff --git a/locales/sv.lua b/locales/sv.lua index c6ea355f..c703a57c 100644 --- a/locales/sv.lua +++ b/locales/sv.lua @@ -31,6 +31,7 @@ Locales['sv'] = { ['return_to_veh'] = 'vänligen återvänd till ditt fordon och återuppta körningen.', ['must_in_taxi'] = 'du måste vara i en ~y~taxi~s~ för att starta uppdraget.', ['must_in_vehicle'] = 'du måste vara i ett ~b~fordon~s~ för att starta uppdraget.', + ['not_in_taxi'] = 'You left the taxi while on mission!', ['have_earned'] = 'du har tjärnat ~g~%s SEK~s~', ['comp_earned'] = '- ditt företag har tjärnat ~g~%s SEK~s~\n- du har tjärnat ~g~%s SEK~s~', ['deposit_stock'] = 'lagra objekt', From d23a2b9b8b483c5b584bee90b924af2998ba2054 Mon Sep 17 00:00:00 2001 From: JeesusKrisostoomus <42423446+JeesusKrisostoomus@users.noreply.github.com> Date: Wed, 22 Jul 2020 23:15:57 +0300 Subject: [PATCH 91/93] fix locale Removed one extra } from the end that was causing the script to fail loading --- locales/en.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/locales/en.lua b/locales/en.lua index 8e5d06c4..4fb29760 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -50,4 +50,3 @@ Locales['en'] = { ['taxi'] = 'taxi', ['taxi_stock'] = 'taxi Stock' } -} From 5923a9d17278ec93d0f6d3aacd98b5851dc669e9 Mon Sep 17 00:00:00 2001 From: ItsManueh <47420352+ItsManueh@users.noreply.github.com> Date: Mon, 2 Nov 2020 20:37:40 +0100 Subject: [PATCH 92/93] Add es.lua traduction --- locales/es.lua | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 locales/es.lua diff --git a/locales/es.lua b/locales/es.lua new file mode 100644 index 00000000..36707678 --- /dev/null +++ b/locales/es.lua @@ -0,0 +1,54 @@ +-- Traducción by: https://github.com/ItsManueh + +Locales['es'] = { + -- cloakroom + ['cloakroom_menu'] = 'Guardarropa', + ['cloakroom_prompt'] = 'Presiona ~INPUT_CONTEXT~ para acceder al ~y~Guardarropa~s~.', + ['wear_citizen'] = 'Ropa ciudadana', + ['wear_work'] = 'Ropa de taxista', + + -- garage + ['spawner_prompt'] = 'Presiona ~INPUT_CONTEXT~ para acceder al ~y~Garaje~s~.', + ['store_veh'] = 'Presiona ~INPUT_CONTEXT~ para almacenar el vehículo', + ['spawn_veh'] = 'Vehículo de generación', + ['spawnpoint_blocked'] = '¡Hay un vehículo bloqueando el punto de generación!', + ['only_taxi'] = 'Solo puede almacenar taxis.', + + ['taking_service'] = 'Tomando servicio: Taxi / Uber', + ['full_service'] = 'Servicio completo: ', + ['amount_invalid'] = 'Cantidad inválida', + ['press_to_open'] = 'Presiona ~INPUT_CONTEXT~ para acceder al menú', + ['billing'] = 'Facturación', + ['billing_sent'] = '¡La factura ha sido registrada!', + ['invoice_amount'] = 'Factura inválida', + ['no_players_near'] = 'No hay jugadores cerca', + ['start_job'] = 'Iniciar / Detener la conducción de trabajos NPC', + ['drive_search_pass'] = 'Conduciendo en busca de ~y~pasajeros', + ['customer_found'] = 'Has ~g~encontrado~s~ un cliente, acércate a ellos', + ['client_unconcious'] = 'Tu cliente es ~r~inconsciente~s~, busca otro', + ['arrive_dest'] = 'Has ~g~llegado~s~ al destino correctamente', + ['take_me_to_near'] = '~s~Llévame a~y~ %s~s~, cerca ~y~%s', + ['take_me_to'] = '~s~Llévame a ~y~%s', + ['close_to_client'] = 'Estás demasiado lejos del cliente, acércate a él', + ['return_to_veh'] = 'Por favor regrese a su vehículo para continuar la misión', + ['must_in_taxi'] = 'Debes estar en un ~y~taxi~s~ para comenzar la misión', + ['must_in_vehicle'] = 'Debes estar en un vehículo para comenzar la misión', + ['not_in_taxi'] = '¡Dejaste el taxi mientras estabas en misión!', + ['have_earned'] = 'Usted ha ganado ~g~$%s~s~', + ['comp_earned'] = '- Tu empresa se ha ganado ~g~$%s~s~\n- usted ha ganado ~g~$%s~s~', + ['deposit_stock'] = 'Depositar stock', + ['take_stock'] = 'Coger Stock', + ['boss_actions'] = 'Acciones del jefe', + ['mission_complete'] = 'Misión completada', + ['quantity'] = 'Cantidad', + ['quantity_invalid'] = '¡Esa es una cantidad inválida!', + ['inventory'] = 'Inventario', + ['taxi_client'] = 'Cliente taxi', + ['have_withdrawn'] = 'Has retirado ~y~x%s~s~ ~b~%s~s~', + ['have_deposited'] = 'Has depositado ~y~x%s~s~ ~b~%s~s~', + ['player_cannot_hold'] = '!Tu ~r~no~s~ tienes suficiente ~y~espacio libre~s~ en tu inventario!', + ['blip_taxi'] = 'Downtown Cab Co.', + ['phone_taxi'] = 'Downtown Cab Co.', + ['taxi'] = 'Taxi', + ['taxi_stock'] = 'Taxi Stock' +} From 7d1ba61586f97ac52b51ce9b4738f6a2c09e748d Mon Sep 17 00:00:00 2001 From: ItsManueh <47420352+ItsManueh@users.noreply.github.com> Date: Mon, 2 Nov 2020 20:38:24 +0100 Subject: [PATCH 93/93] Update fxmanifest.lua add locale/es.lua --- fxmanifest.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fxmanifest.lua b/fxmanifest.lua index ff5ac70c..4ca75e7c 100644 --- a/fxmanifest.lua +++ b/fxmanifest.lua @@ -11,6 +11,7 @@ client_scripts { 'locales/de.lua', 'locales/br.lua', 'locales/en.lua', + 'locales/es.lua', 'locales/fi.lua', 'locales/fr.lua', 'locales/pl.lua', @@ -24,6 +25,7 @@ server_scripts { 'locales/de.lua', 'locales/br.lua', 'locales/en.lua', + 'locales/es.lua', 'locales/fi.lua', 'locales/fr.lua', 'locales/pl.lua',