Buying weapon attachments bug fix

Weapon name as a string was supposed to be used, instead it was receiving weapon information as a table.
This commit is contained in:
MacHunt
2022-09-18 06:38:58 +02:00
committed by GitHub
parent b8f1f6b7cc
commit e464bf1b2d
+2 -2
View File
@@ -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