From c4530d89ac1bb3434c067583a7cc95a9508f667c Mon Sep 17 00:00:00 2001 From: TheFantomas <117121911+TheFantomas@users.noreply.github.com> Date: Fri, 17 Mar 2023 23:03:00 +0100 Subject: [PATCH] revert "a80f5f952a87969237117957d5c38e62d4294f24" It does not work as it should, it is impossible to set the value to false. https://ctrlv.cz/shots/2023/03/17/WWLS.png --- [core]/es_extended/client/functions.lua | 6 ++++-- [core]/esx_context/main.lua | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/[core]/es_extended/client/functions.lua b/[core]/es_extended/client/functions.lua index b07c7610..90191138 100644 --- a/[core]/es_extended/client/functions.lua +++ b/[core]/es_extended/client/functions.lua @@ -357,7 +357,7 @@ function ESX.Game.Teleport(entity, coords, cb) end function ESX.Game.SpawnObject(object, coords, cb, networked) - networked = networked or true + networked = networked == nil and true or networked if networked then ESX.TriggerServerCallback('esx:Onesync:SpawnObject', function(NetworkID) if cb then @@ -405,7 +405,8 @@ end function ESX.Game.SpawnVehicle(vehicle, coords, heading, cb, networked) local model = type(vehicle) == 'number' and vehicle or joaat(vehicle) local vector = type(coords) == "vector3" and coords or vec(coords.x, coords.y, coords.z) - networked = networked or true + networked = networked == nil and true or networked + local playerCoords = GetEntityCoords(ESX.PlayerData.ped) if not vector or not playerCoords then return @@ -415,6 +416,7 @@ function ESX.Game.SpawnVehicle(vehicle, coords, heading, cb, networked) local executingResource = GetInvokingResource() or "Unknown" return print(("[^1ERROR^7] Resource ^5%s^7 Tried to spawn vehicle on the client but the position is too far away (Out of onesync range)."):format(executing_resource)) end + CreateThread(function() ESX.Streaming.RequestModel(model) diff --git a/[core]/esx_context/main.lua b/[core]/esx_context/main.lua index b497de6d..55bfad9c 100644 --- a/[core]/esx_context/main.lua +++ b/[core]/esx_context/main.lua @@ -13,7 +13,7 @@ function Post(fn,...) end function Open(position,eles,onSelect,onClose,canClose) - local canClose = canClose or true + local canClose = canClose == nil and true or canClose activeMenu = { position = position, eles = eles,