From 83a031ff881fc4502c557ee92d2e7f07db2b9830 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Mon, 1 Oct 2018 20:08:15 +0200 Subject: [PATCH] Removed freezing in zones --- client/main.lua | 55 ++++++++++++------------------------------------- locales/br.lua | 1 - locales/de.lua | 1 - locales/en.lua | 1 - locales/es.lua | 1 - locales/fr.lua | 1 - locales/pl.lua | 1 - locales/sv.lua | 1 - 8 files changed, 13 insertions(+), 49 deletions(-) diff --git a/client/main.lua b/client/main.lua index 38b566c0..6614489e 100644 --- a/client/main.lua +++ b/client/main.lua @@ -22,7 +22,6 @@ local opium_poochQTE = 0 local myJob = nil local HasAlreadyEnteredMarker = false local LastZone = nil -local isInZone = false local CurrentAction = nil local CurrentActionMsg = '' local CurrentActionData = {} @@ -41,12 +40,6 @@ AddEventHandler('esx_drugs:hasEnteredMarker', function(zone) ESX.UI.Menu.CloseAll() - if zone == 'exitMarker' then - CurrentAction = zone - CurrentActionMsg = _U('exit_marker') - CurrentActionData = {} - end - if zone == 'CokeField' then CurrentAction = zone CurrentActionMsg = _U('press_collect_coke') @@ -191,7 +184,7 @@ Citizen.CreateThread(function() local coords = GetEntityCoords(GetPlayerPed(-1)) for k,v in pairs(Config.Zones) do - if(GetDistanceBetweenCoords(coords, v.x, v.y, v.z, true) < Config.DrawDistance) then + if GetDistanceBetweenCoords(coords, v.x, v.y, v.z, true) < Config.DrawDistance then DrawMarker(Config.MarkerType, v.x, v.y, v.z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.ZoneSize.x, Config.ZoneSize.y, Config.ZoneSize.z, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, false, false, false, false) end end @@ -222,15 +215,15 @@ end -- RETURN NUMBER OF ITEMS FROM SERVER RegisterNetEvent('esx_drugs:ReturnInventory') AddEventHandler('esx_drugs:ReturnInventory', function(cokeNbr, cokepNbr, methNbr, methpNbr, weedNbr, weedpNbr, opiumNbr, opiumpNbr, jobName, currentZone) - cokeQTE = cokeNbr - coke_poochQTE = cokepNbr - methQTE = methNbr - meth_poochQTE = methpNbr - weedQTE = weedNbr - weed_poochQTE = weedpNbr - opiumQTE = opiumNbr - opium_poochQTE = opiumpNbr - myJob = jobName + cokeQTE = cokeNbr + coke_poochQTE = cokepNbr + methQTE = methNbr + meth_poochQTE = methpNbr + weedQTE = weedNbr + weed_poochQTE = weedpNbr + opiumQTE = opiumNbr + opium_poochQTE = opiumpNbr + myJob = jobName TriggerEvent('esx_drugs:hasEnteredMarker', currentZone) end) @@ -261,10 +254,6 @@ Citizen.CreateThread(function() hasAlreadyEnteredMarker = false TriggerEvent('esx_drugs:hasExitedMarker', lastZone) end - - if isInMarker and isInZone then - TriggerEvent('esx_drugs:hasEnteredMarker', 'exitMarker') - end end end) @@ -273,17 +262,10 @@ Citizen.CreateThread(function() while true do Citizen.Wait(10) if CurrentAction ~= nil then - SetTextComponentFormat('STRING') - AddTextComponentString(CurrentActionMsg) - DisplayHelpTextFromStringLabel(0, 0, 1, -1) + ESX.ShowHelpNotification(CurrentActionMsg) + if IsControlJustReleased(0, Keys['E']) then - isInZone = true -- unless we set this boolean to false, we will always freeze the user - if CurrentAction == 'exitMarker' then - isInZone = false -- do not freeze user - TriggerEvent('esx_drugs:freezePlayer', false) - TriggerEvent('esx_drugs:hasExitedMarker', lastZone) - Citizen.Wait(15000) - elseif CurrentAction == 'CokeField' then + if CurrentAction == 'CokeField' then TriggerServerEvent('esx_drugs:startHarvestCoke') elseif CurrentAction == 'CokeProcessing' then TriggerServerEvent('esx_drugs:startTransformCoke') @@ -307,12 +289,6 @@ Citizen.CreateThread(function() TriggerServerEvent('esx_drugs:startTransformOpium') elseif CurrentAction == 'OpiumDealer' then TriggerServerEvent('esx_drugs:startSellOpium') - else - isInZone = false -- not a esx_drugs zone - end - - if isInZone then - TriggerEvent('esx_drugs:freezePlayer', true) end CurrentAction = nil @@ -320,8 +296,3 @@ Citizen.CreateThread(function() end end end) - -RegisterNetEvent('esx_drugs:freezePlayer') -AddEventHandler('esx_drugs:freezePlayer', function(freeze) - FreezeEntityPosition(GetPlayerPed(-1), freeze) -end) diff --git a/locales/br.lua b/locales/br.lua index baf400b8..a7cd6f2a 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -31,7 +31,6 @@ Locales['br'] = { ['not_enough_opium'] = 'Você não tem ópio suficiente para ~r~embalar~s~', ['sold_one_opium'] = 'Você vendeu ~g~x1 Trouxinha de ópio~s~', ['used_one_opium'] = 'Você usou 1 trouxinha de ~b~ópio', - ['exit_marker'] = 'press ~INPUT_CONTEXT~ to cancel the ~y~process~s~', -- Blips ['coke_field'] = 'cocaine Field', ['coke_processing'] = 'cocaine Processing', diff --git a/locales/de.lua b/locales/de.lua index 208e35bc..ffc54e19 100644 --- a/locales/de.lua +++ b/locales/de.lua @@ -31,7 +31,6 @@ Locales['de'] = { ['not_enough_opium'] = 'du hast nicht genug Opium zum ~r~verarbeiten~s~', ['sold_one_opium'] = 'du verkaufst ~g~x1 Portion Opium~s~', ['used_one_opium'] = 'du benutzt 1x ~b~Opium', - ['exit_marker'] = 'press ~INPUT_CONTEXT~ to cancel the ~y~process~s~', -- Blips ['coke_field'] = 'cocaine Field', ['coke_processing'] = 'cocaine Processing', diff --git a/locales/en.lua b/locales/en.lua index 49618649..4bccf402 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -31,7 +31,6 @@ Locales['en'] = { ['not_enough_opium'] = 'you do not have enough opium to ~r~pack~s~', ['sold_one_opium'] = 'you\'ve sold ~g~x1 opium Pouch~s~', ['used_one_opium'] = 'you used 1 pouch of ~b~opium', - ['exit_marker'] = 'press ~INPUT_CONTEXT~ to cancel the ~y~process~s~', -- Blips ['coke_field'] = 'cocaine Field', ['coke_processing'] = 'cocaine Processing', diff --git a/locales/es.lua b/locales/es.lua index 60625a26..f123db65 100644 --- a/locales/es.lua +++ b/locales/es.lua @@ -31,7 +31,6 @@ Locales['es'] = { ['not_enough_opium'] = 'No tienes sufiente Opio para ~r~fabricar~s~', ['sold_one_opium'] = 'Has vendido ~g~1 Bolsa de Opio~s~', ['used_one_opium'] = 'Has gastado una bolsa de ~b~Opio', - ['exit_marker'] = 'press ~INPUT_CONTEXT~ to cancel the ~y~process~s~', -- Blips ['coke_field'] = 'cocaine Field', ['coke_processing'] = 'cocaine Processing', diff --git a/locales/fr.lua b/locales/fr.lua index e7cdcf5a..68a197d4 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -31,7 +31,6 @@ Locales['fr'] = { ['not_enough_opium'] = 'vous n\'avez pas assez de opium à ~r~conditionner~s~', ['sold_one_opium'] = 'vous avez vendu ~g~x1 Pochon de opium~s~', ['used_one_opium'] = 'Vous avez utilisé 1 Pochon de ~b~opium', - ['exit_marker'] = 'press ~INPUT_CONTEXT~ to cancel the ~y~process~s~', -- Blips ['coke_field'] = 'cocaine Field', ['coke_processing'] = 'cocaine Processing', diff --git a/locales/pl.lua b/locales/pl.lua index b645c88d..7c1375d1 100644 --- a/locales/pl.lua +++ b/locales/pl.lua @@ -31,7 +31,6 @@ Locales['pl'] = { ['not_enough_opium'] = 'nie masz wystarczająco opium aby je ~r~spakować~s~', ['sold_one_opium'] = 'sprzedajesz ~g~x1 torebeczka opium~s~', ['used_one_opium'] = 'wciągasz 1x torebeczka ~b~opium', - ['exit_marker'] = 'naciśnij ~INPUT_CONTEXT~ aby ~y~przerwać~s~ akcje', -- Blips ['coke_field'] = 'plantacja kokainy', ['coke_processing'] = 'przeróbka liści kokainy', diff --git a/locales/sv.lua b/locales/sv.lua index 813f3433..280c9e7a 100644 --- a/locales/sv.lua +++ b/locales/sv.lua @@ -31,7 +31,6 @@ Locales['sv'] = { ['not_enough_opium'] = 'Du har inte tillräckligt med opium för att ~r~bearbeta~s~', ['sold_one_opium'] = 'du har sålt ~y~1x~s~ ~b~väska med opium~s~', ['used_one_opium'] = 'Du använde 1 väska ~b~opium', - ['exit_marker'] = 'tryck ~INPUT_CONTEXT~ för att avbryta pågående process', -- Blips ['coke_field'] = 'coke field', ['coke_processing'] = 'coke processing',