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] 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