fix(rpc): .removeWeapon function use rpc natives

This commit is contained in:
btwlouis
2023-07-10 19:07:52 +02:00
committed by GitHub
parent a63e75cd98
commit a2ca81d6ff
+5 -1
View File
@@ -470,13 +470,17 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory,
self.removeWeaponComponent(weaponName, v2)
end
local weaponHash = joaat(weaponName)
RemoveWeaponFromPed(GetPlayerPed(self.source), weaponHash)
SetPedAmmo(GetPlayerPed(self.source), weaponHash, 0)
table.remove(self.loadout, k)
break
end
end
if weaponLabel then
self.triggerEvent('esx:removeWeapon', weaponName)
self.triggerEvent('esx:removeInventoryItem', weaponLabel, false, true)
end
end