mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 09:18:53 +00:00
fix(rpc): .removeWeapon function use rpc natives
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user