mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-04 08:13:21 +00:00
Fix delete vehicle issue + spawn a little upper
This commit is contained in:
+9
-6
@@ -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
|
||||
|
||||
|
||||
@@ -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 = {}
|
||||
|
||||
Reference in New Issue
Block a user