mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 17:28:53 +00:00
ESX.Game.GetVehicleInDirection, no more car spawn with radio
This commit is contained in:
+14
-2
@@ -390,7 +390,6 @@ ESX.Game.SpawnVehicle = function(modelName, coords, heading, cb)
|
||||
local id = NetworkGetNetworkIdFromEntity(vehicle)
|
||||
|
||||
SetNetworkIdCanMigrate(id, true)
|
||||
--SetEntityAsMissionEntity(vehicle, true, false)
|
||||
SetVehicleHasBeenOwnedByPlayer(vehicle, true)
|
||||
SetModelAsNoLongerNeeded(model)
|
||||
|
||||
@@ -401,6 +400,8 @@ ESX.Game.SpawnVehicle = function(modelName, coords, heading, cb)
|
||||
Citizen.Wait(0)
|
||||
end
|
||||
|
||||
SetVehRadioStation(vehicle, 'OFF')
|
||||
|
||||
if cb ~= nil then
|
||||
cb(vehicle)
|
||||
end
|
||||
@@ -423,7 +424,6 @@ ESX.Game.SpawnLocalVehicle = function(modelName, coords, heading, cb)
|
||||
|
||||
local vehicle = CreateVehicle(model, coords.x, coords.y, coords.z, heading, false, false)
|
||||
|
||||
--SetEntityAsMissionEntity(vehicle, true, false)
|
||||
SetVehicleHasBeenOwnedByPlayer(vehicle, true)
|
||||
SetModelAsNoLongerNeeded(model)
|
||||
|
||||
@@ -434,6 +434,8 @@ ESX.Game.SpawnLocalVehicle = function(modelName, coords, heading, cb)
|
||||
Citizen.Wait(0)
|
||||
end
|
||||
|
||||
SetVehRadioStation(vehicle, 'OFF')
|
||||
|
||||
if cb ~= nil then
|
||||
cb(vehicle)
|
||||
end
|
||||
@@ -642,6 +644,16 @@ ESX.Game.GetVehiclesInArea = function(coords, area)
|
||||
return vehiclesInArea
|
||||
end
|
||||
|
||||
ESX.Game.GetVehicleInDirection = function()
|
||||
local playerPed = GetPlayerPed(-1)
|
||||
local playerCoords = GetEntityCoords(playerPed, 1)
|
||||
local inDirection = GetOffsetFromEntityInWorldCoords(playerPed, 0.0, 5.0, 0.0)
|
||||
local rayHandle = CastRayPointToPoint(playerCoords.x, playerCoords.y, playerCoords.z, inDirection.x, inDirection.y, inDirection.z, 10, playerPed, 0)
|
||||
local a, b, c, d, vehicle = GetRaycastResult(rayHandle)
|
||||
|
||||
return vehicle
|
||||
end
|
||||
|
||||
ESX.Game.GetPeds = function(ignoreList)
|
||||
|
||||
local ignoreList = ignoreList or {}
|
||||
|
||||
Reference in New Issue
Block a user