Only add weapon component once, check if player has weapon

This commit is contained in:
ElPumpo
2018-12-29 13:47:01 +01:00
parent caec057954
commit e0f9358b22
3 changed files with 34 additions and 7 deletions
+2 -2
View File
@@ -33,7 +33,7 @@ ESX.GetWeaponLabel = function(weaponName)
end
end
ESX.GetWeaponComponentHash = function(weaponName, weaponComponent)
ESX.GetWeaponComponent = function(weaponName, weaponComponent)
weaponName = string.upper(weaponName)
local weapons = ESX.GetWeaponList()
@@ -41,7 +41,7 @@ ESX.GetWeaponComponentHash = function(weaponName, weaponComponent)
if weapons[i].name == weaponName then
for j=1, #weapons[i].components, 1 do
if weapons[i].components[j].name == weaponComponent then
return weapons[i].components[j].hash
return weapons[i].components[j]
end
end
end