mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 09:18:53 +00:00
fix(client/main): Respect the networked value if sent for SpawnObject/SpawnVehicle
This commit is contained in:
@@ -335,11 +335,10 @@ ESX.Game.Teleport = function(entity, coords, cb)
|
||||
end
|
||||
end
|
||||
|
||||
ESX.Game.SpawnObject = function(object, coords, cb, networked, dynamic)
|
||||
ESX.Game.SpawnObject = function(object, coords, cb, networked)
|
||||
local model = (type(object) == 'number' and model or GetHashKey(object))
|
||||
local vector = type(coords) == "vector3" and coords or vec(coords.x, coords.y, coords.z)
|
||||
networked = networked == nil and true or false
|
||||
dynamic = dynamic ~= nil and true or false
|
||||
networked = networked == nil and true or networked
|
||||
|
||||
Citizen.CreateThread(function()
|
||||
ESX.Streaming.RequestModel(model)
|
||||
@@ -347,7 +346,7 @@ ESX.Game.SpawnObject = function(object, coords, cb, networked, dynamic)
|
||||
-- The below has to be done just for CreateObject since for some reason CreateObjects model argument is set
|
||||
-- as an Object instead of a hash so it doesn't automatically hash the item
|
||||
model = type(model) == 'number' and model or GetHashKey(model)
|
||||
local obj = CreateObject(model, vector.xyz, networked, false, dynamic)
|
||||
local obj = CreateObject(model, vector.xyz, networked, false, true)
|
||||
if cb then
|
||||
cb(obj)
|
||||
end
|
||||
@@ -372,7 +371,7 @@ end
|
||||
ESX.Game.SpawnVehicle = function(vehicle, coords, heading, cb, networked)
|
||||
local model = (type(vehicle) == 'number' and vehicle or GetHashKey(vehicle))
|
||||
local vector = type(coords) == "vector3" and coords or vec(coords.x, coords.y, coords.z)
|
||||
networked = networked == nil and true or false
|
||||
networked = networked == nil and true or networked
|
||||
Citizen.CreateThread(function()
|
||||
ESX.Streaming.RequestModel(model)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user