mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-04 16:23:21 +00:00
esx:spawnVehicle using Player Heading (#486)
* esx:spawnVehicle using Player Heading Updated esx:spawnVehicle to use the players heading as opposed to the default 90.0 degree angle * Update main.lua
This commit is contained in:
+4
-3
@@ -243,10 +243,11 @@ AddEventHandler('esx:spawnVehicle', function(vehicle)
|
||||
local model = (type(vehicle) == 'number' and vehicle or GetHashKey(vehicle))
|
||||
|
||||
if IsModelInCdimage(model) then
|
||||
local playerPed = PlayerPedId()
|
||||
local coords = GetEntityCoords(playerPed)
|
||||
local playerPed = PlayerPedId()
|
||||
local coords = GetEntityCoords(playerPed)
|
||||
local playerHeading = GetEntityHeading(playerPed)
|
||||
|
||||
ESX.Game.SpawnVehicle(model, coords, 90.0, function(vehicle)
|
||||
ESX.Game.SpawnVehicle(model, coords, playerHeading, function(vehicle)
|
||||
TaskWarpPedIntoVehicle(playerPed, vehicle, -1)
|
||||
end)
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user