From 55edd9ad663d6e20c62f847a66acfc9aca68b9b2 Mon Sep 17 00:00:00 2001 From: Linden <65407488+thelindat@users.noreply.github.com> Date: Fri, 4 Jun 2021 20:55:05 +1000 Subject: [PATCH] refactor(client/functions): Don't send events for inventory and loadout - While most resources for ESX will utilise PlayerData in some way, few will require up-to-date inventory and loadout data. - Those that do use the getter or a server callback, anyway. --- client/functions.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/functions.lua b/client/functions.lua index 80b6a34b..7bc1d3b7 100644 --- a/client/functions.lua +++ b/client/functions.lua @@ -42,7 +42,9 @@ end ESX.SetPlayerData = function(key, val) ESX.PlayerData[key] = val - TriggerEvent('esx:setPlayerData', key, val) + if key ~= 'inventory' and key ~= 'loadout' then + TriggerEvent('esx:setPlayerData', key, val) + end end ESX.ShowNotification = function(msg)