From 1f3ea2dc810f7e6453378ad9fdcc396eb6226b15 Mon Sep 17 00:00:00 2001 From: Matthew <22198949+MafewTM@users.noreply.github.com> Date: Tue, 20 Aug 2024 02:14:08 -0400 Subject: [PATCH 1/4] fix(server/player): AddItem and RemoveItem --- server/player.lua | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/server/player.lua b/server/player.lua index 6ef4eab32..5f56db6e0 100644 --- a/server/player.lua +++ b/server/player.lua @@ -835,20 +835,21 @@ function CreatePlayer(playerData, Offline) ---@deprecated use ox_inventory exports directly ---@param item string ---@param amount number - ---@param slot? number ---@param metadata? table + ---@param slot? number ---@return boolean success - function self.Functions.AddItem(item, amount, slot, metadata) - return exports.ox_inventory:AddItem(self.PlayerData.source, item, amount, slot, metadata) + function self.Functions.AddItem(item, amount, metadata, slot) + return exports.ox_inventory:AddItem(self.PlayerData.source, item, amount, metadata, slot) end ---@deprecated use ox_inventory exports directly ---@param item string ---@param amount number + ---@param metadata? table ---@param slot? number ---@return boolean success - function self.Functions.RemoveItem(item, amount, slot) - return exports.ox_inventory:RemoveItem(self.PlayerData.source, item, amount, nil, slot) + function self.Functions.RemoveItem(item, amount, metadata, slot) + return exports.ox_inventory:RemoveItem(self.PlayerData.source, item, amount, metadata, slot) end ---@deprecated use ox_inventory exports directly From 9444d67ba89c61a51f56b6fb955a097352d2478d Mon Sep 17 00:00:00 2001 From: Matthew <22198949+MafewTM@users.noreply.github.com> Date: Tue, 20 Aug 2024 02:28:32 -0400 Subject: [PATCH 2/4] fix: remove extended implementation --- server/player.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server/player.lua b/server/player.lua index 5f56db6e0..38811bd28 100644 --- a/server/player.lua +++ b/server/player.lua @@ -845,11 +845,10 @@ function CreatePlayer(playerData, Offline) ---@deprecated use ox_inventory exports directly ---@param item string ---@param amount number - ---@param metadata? table ---@param slot? number ---@return boolean success function self.Functions.RemoveItem(item, amount, metadata, slot) - return exports.ox_inventory:RemoveItem(self.PlayerData.source, item, amount, metadata, slot) + return exports.ox_inventory:RemoveItem(self.PlayerData.source, item, amount, nil, slot) end ---@deprecated use ox_inventory exports directly From 99184755f5b3acd3348d07b4f5e86a6b52ed39ca Mon Sep 17 00:00:00 2001 From: Matthew <22198949+MafewTM@users.noreply.github.com> Date: Tue, 20 Aug 2024 02:29:58 -0400 Subject: [PATCH 3/4] Update player.lua --- server/player.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/player.lua b/server/player.lua index 38811bd28..6dcba8078 100644 --- a/server/player.lua +++ b/server/player.lua @@ -847,7 +847,7 @@ function CreatePlayer(playerData, Offline) ---@param amount number ---@param slot? number ---@return boolean success - function self.Functions.RemoveItem(item, amount, metadata, slot) + function self.Functions.RemoveItem(item, amount, slot) return exports.ox_inventory:RemoveItem(self.PlayerData.source, item, amount, nil, slot) end From da230187e4ea3115cbe215dd8bd1037964d4bf83 Mon Sep 17 00:00:00 2001 From: Matthew <22198949+mafewtm@users.noreply.github.com> Date: Tue, 20 Aug 2024 02:39:47 -0400 Subject: [PATCH 4/4] Update server/player.lua Co-authored-by: Solareon <769465+solareon@users.noreply.github.com> --- server/player.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/player.lua b/server/player.lua index 6dcba8078..4d2b28784 100644 --- a/server/player.lua +++ b/server/player.lua @@ -838,7 +838,7 @@ function CreatePlayer(playerData, Offline) ---@param metadata? table ---@param slot? number ---@return boolean success - function self.Functions.AddItem(item, amount, metadata, slot) + function self.Functions.AddItem(item, amount, slot, metadata) return exports.ox_inventory:AddItem(self.PlayerData.source, item, amount, metadata, slot) end