mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-04 16:23:21 +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)
|
local id = NetworkGetNetworkIdFromEntity(vehicle)
|
||||||
|
|
||||||
SetNetworkIdCanMigrate(id, true)
|
SetNetworkIdCanMigrate(id, true)
|
||||||
--SetEntityAsMissionEntity(vehicle, true, false)
|
|
||||||
SetVehicleHasBeenOwnedByPlayer(vehicle, true)
|
SetVehicleHasBeenOwnedByPlayer(vehicle, true)
|
||||||
SetModelAsNoLongerNeeded(model)
|
SetModelAsNoLongerNeeded(model)
|
||||||
|
|
||||||
@@ -401,6 +400,8 @@ ESX.Game.SpawnVehicle = function(modelName, coords, heading, cb)
|
|||||||
Citizen.Wait(0)
|
Citizen.Wait(0)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
SetVehRadioStation(vehicle, 'OFF')
|
||||||
|
|
||||||
if cb ~= nil then
|
if cb ~= nil then
|
||||||
cb(vehicle)
|
cb(vehicle)
|
||||||
end
|
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)
|
local vehicle = CreateVehicle(model, coords.x, coords.y, coords.z, heading, false, false)
|
||||||
|
|
||||||
--SetEntityAsMissionEntity(vehicle, true, false)
|
|
||||||
SetVehicleHasBeenOwnedByPlayer(vehicle, true)
|
SetVehicleHasBeenOwnedByPlayer(vehicle, true)
|
||||||
SetModelAsNoLongerNeeded(model)
|
SetModelAsNoLongerNeeded(model)
|
||||||
|
|
||||||
@@ -434,6 +434,8 @@ ESX.Game.SpawnLocalVehicle = function(modelName, coords, heading, cb)
|
|||||||
Citizen.Wait(0)
|
Citizen.Wait(0)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
SetVehRadioStation(vehicle, 'OFF')
|
||||||
|
|
||||||
if cb ~= nil then
|
if cb ~= nil then
|
||||||
cb(vehicle)
|
cb(vehicle)
|
||||||
end
|
end
|
||||||
@@ -642,6 +644,16 @@ ESX.Game.GetVehiclesInArea = function(coords, area)
|
|||||||
return vehiclesInArea
|
return vehiclesInArea
|
||||||
end
|
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)
|
ESX.Game.GetPeds = function(ignoreList)
|
||||||
|
|
||||||
local ignoreList = ignoreList or {}
|
local ignoreList = ignoreList or {}
|
||||||
|
|||||||
Reference in New Issue
Block a user