Add distance check

This commit is contained in:
Jérémie N'gadi
2017-08-03 13:17:17 +02:00
parent 1174b6f095
commit 5855010643
+20 -12
View File
@@ -141,13 +141,15 @@ function OpenShopMenu()
if IsAnyVehicleNearPoint(Config.Zones.ShopInside.Pos.x, Config.Zones.ShopInside.Pos.y, Config.Zones.ShopInside.Pos.z, 3.0) then
local vehicle = ESX.Game.GetClosestVehicle({
local vehicle, distance = ESX.Game.GetClosestVehicle({
x = Config.Zones.ShopInside.Pos.x,
y = Config.Zones.ShopInside.Pos.y,
z = Config.Zones.ShopInside.Pos.z
})
DeleteVehicle(vehicle)
if distance <= 3.0 then
DeleteVehicle(vehicle)
end
end
@@ -201,13 +203,15 @@ function OpenShopMenu()
if IsAnyVehicleNearPoint(Config.Zones.ShopInside.Pos.x, Config.Zones.ShopInside.Pos.y, Config.Zones.ShopInside.Pos.z, 3.0) then
local vehicle = ESX.Game.GetClosestVehicle({
local vehicle, distance = ESX.Game.GetClosestVehicle({
x = Config.Zones.ShopInside.Pos.x,
y = Config.Zones.ShopInside.Pos.y,
z = Config.Zones.ShopInside.Pos.z
})
DeleteVehicle(vehicle)
if distance <= 3.0 then
DeleteVehicle(vehicle)
end
end
@@ -228,13 +232,15 @@ function OpenShopMenu()
if IsAnyVehicleNearPoint(Config.Zones.ShopInside.Pos.x, Config.Zones.ShopInside.Pos.y, Config.Zones.ShopInside.Pos.z, 3.0) then
local vehicle = ESX.Game.GetClosestVehicle({
local vehicle, distance = ESX.Game.GetClosestVehicle({
x = Config.Zones.ShopInside.Pos.x,
y = Config.Zones.ShopInside.Pos.y,
z = Config.Zones.ShopInside.Pos.z
})
DeleteVehicle(vehicle)
if distance <= 3.0 then
DeleteVehicle(vehicle)
end
end
@@ -253,13 +259,15 @@ function OpenShopMenu()
if IsAnyVehicleNearPoint(Config.Zones.ShopInside.Pos.x, Config.Zones.ShopInside.Pos.y, Config.Zones.ShopInside.Pos.z, 3.0) then
local vehicle = ESX.Game.GetClosestVehicle({
local vehicle, distance = ESX.Game.GetClosestVehicle({
x = Config.Zones.ShopInside.Pos.x,
y = Config.Zones.ShopInside.Pos.y,
z = Config.Zones.ShopInside.Pos.z
})
DeleteVehicle(vehicle)
if distance <= 3.0 then
DeleteVehicle(vehicle)
end
end