Fix delete vehicle issue + spawn a little upper

This commit is contained in:
Jérémie N'gadi
2017-08-16 20:59:32 +02:00
parent 61c5f6f409
commit 08086be4f7
2 changed files with 11 additions and 6 deletions
+9 -6
View File
@@ -29,7 +29,7 @@ AddEventHandler('esx_property:hasEnteredMarker', function(name, part, parking)
local spawnCoords = {
x = garage.InteriorSpawnPoint.Pos.x,
y = garage.InteriorSpawnPoint.Pos.y,
z = garage.InteriorSpawnPoint.Pos.z
z = garage.InteriorSpawnPoint.Pos.z + Config.ZDiff
}
ESX.Game.DeleteVehicle(vehicle)
@@ -217,10 +217,11 @@ AddEventHandler('esx_property:hasEnteredMarker', function(name, part, parking)
if part == 'Parking' then
local playerPed = GetPlayerPed(-1)
local garage = Config.Garages[name]
local playerPed = GetPlayerPed(-1)
local garage = Config.Garages[name]
local parkingPos = garage.Parkings[parking].Pos
if IsPedInAnyVehicle(playerPed, false) then
if IsPedInAnyVehicle(playerPed, false) and not IsAnyVehicleNearPoint(parkingPos.x, parkingPos.y, parkingPos.z, 1.0) then
local vehicle = GetVehiclePedIsIn(playerPed, false)
local vehicleProps = ESX.Game.GetVehicleProperties(vehicle)
@@ -237,9 +238,11 @@ AddEventHandler('esx_property:hasExitedMarker', function(name, part, parking)
if part == 'Parking' then
local playerPed = GetPlayerPed(-1)
local playerPed = GetPlayerPed(-1)
local garage = Config.Garages[name]
local parkingPos = garage.Parkings[parking].Pos
if IsPedInAnyVehicle(playerPed, false) then
if IsPedInAnyVehicle(playerPed, false) and not IsAnyVehicleNearPoint(parkingPos.x, parkingPos.y, parkingPos.z, 1.0) then
TriggerServerEvent('esx_garage:setParking', name, parking, false)
end
+2
View File
@@ -5,6 +5,8 @@ Config.MarkerSize = {x = 2.0, y = 2.0, z = 1.0}
Config.MarkerColor = {r = 204, g = 204, b = 0}
Config.ParkingMarkerSize = {x = 3.0, y = 3.0, z = 2.0}
Config.ParkingMarkerColor = {r = 102, g = 102, b = 204}
Config.ZDiff = 0.5
Config.Locale = 'fr'
Config.Zones = {}