mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-04 16:23:21 +00:00
fix(es_extended): overriding entity function
This commit is contained in:
@@ -70,12 +70,12 @@ function ESX.OneSync.SpawnVehicle(model, coords, heading, autoMobile, Properties
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
CreateThread(function()
|
CreateThread(function()
|
||||||
local Entity = autoMobile and Citizen.InvokeNative(`CREATE_AUTOMOBILE`, model, coords.x, coords.y, coords.z, heading) or CreateVehicle(model, coords, heading, true, true)
|
local SpawnedEntity = autoMobile and Citizen.InvokeNative(`CREATE_AUTOMOBILE`, model, coords.x, coords.y, coords.z, heading) or CreateVehicle(model, coords, heading, true, true)
|
||||||
while not DoesEntityExist(Entity) do
|
while not DoesEntityExist(SpawnedEntity) do
|
||||||
Wait(0)
|
Wait(0)
|
||||||
end
|
end
|
||||||
Entity(Entity).state:set('VehicleProperties', Properties, true)
|
Entity(SpawnedEntity).state:set('VehicleProperties', Properties, true)
|
||||||
local netID = NetworkGetNetworkIdFromEntity(Entity)
|
local netID = NetworkGetNetworkIdFromEntity(SpawnedEntity)
|
||||||
cb(netID)
|
cb(netID)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user