Merge pull request #1824 from seltonmt012/fix/give-weapon-order

fix(es_extended/server/main): add the weapon before restoring its tint and components
This commit is contained in:
_Not_
2026-08-14 20:15:31 -05:00
committed by GitHub
+3 -3
View File
@@ -475,6 +475,9 @@ if not Config.CustomInventory then
local weaponComponents = ESX.Table.Clone(weapon.components) local weaponComponents = ESX.Table.Clone(weapon.components)
local weaponTint = weapon.tintIndex local weaponTint = weapon.tintIndex
sourceXPlayer.removeWeapon(itemName)
targetXPlayer.addWeapon(itemName, itemCount)
if weaponTint then if weaponTint then
targetXPlayer.setWeaponTint(itemName, weaponTint) targetXPlayer.setWeaponTint(itemName, weaponTint)
end end
@@ -485,9 +488,6 @@ if not Config.CustomInventory then
end end
end end
sourceXPlayer.removeWeapon(itemName)
targetXPlayer.addWeapon(itemName, itemCount)
if weaponObject.ammo and itemCount > 0 then if weaponObject.ammo and itemCount > 0 then
local ammoLabel = weaponObject.ammo.label local ammoLabel = weaponObject.ammo.label
sourceXPlayer.showNotification(TranslateCap("gave_weapon_withammo", weaponLabel, itemCount, ammoLabel, targetXPlayer.name)) sourceXPlayer.showNotification(TranslateCap("gave_weapon_withammo", weaponLabel, itemCount, ammoLabel, targetXPlayer.name))