From e464bf1b2dce3d6fc350c59a6ebf88ce63f1023e Mon Sep 17 00:00:00 2001 From: MacHunt <52330966+MacHunt@users.noreply.github.com> Date: Sun, 18 Sep 2022 06:38:58 +0200 Subject: [PATCH] Buying weapon attachments bug fix Weapon name as a string was supposed to be used, instead it was receiving weapon information as a table. --- [esx]/es_extended/server/classes/player.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/[esx]/es_extended/server/classes/player.lua b/[esx]/es_extended/server/classes/player.lua index 29b0f601..7c9cd11e 100644 --- a/[esx]/es_extended/server/classes/player.lua +++ b/[esx]/es_extended/server/classes/player.lua @@ -386,8 +386,8 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory, if component then if not self.hasWeaponComponent(weaponName, weaponComponent) then self.loadout[loadoutNum].components[#self.loadout[loadoutNum].components + 1] = weaponComponent - local componentHash = ESX.GetWeaponComponent(weapon, weaponComponent).hash - GiveWeaponComponentToPed(GetPlayerPed(self.source), joaat(weapon), componentHash) + local componentHash = ESX.GetWeaponComponent(weaponName, weaponComponent).hash + GiveWeaponComponentToPed(GetPlayerPed(self.source), joaat(weaponName), componentHash) self.triggerEvent('esx:addInventoryItem', component.label, false, true) end end