From 29dc11b91a37d392bd08b8ed93f6cfefdf766ead Mon Sep 17 00:00:00 2001 From: Linden Date: Thu, 24 Jun 2021 10:51:42 +1000 Subject: [PATCH] fix(client/main): Respect the networked value if sent for SpawnObject/SpawnVehicle --- client/functions.lua | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/client/functions.lua b/client/functions.lua index 7bc1d3b7..8326b588 100644 --- a/client/functions.lua +++ b/client/functions.lua @@ -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)