mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-28 17:01:14 +00:00
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:
@@ -475,6 +475,9 @@ if not Config.CustomInventory then
|
||||
local weaponComponents = ESX.Table.Clone(weapon.components)
|
||||
local weaponTint = weapon.tintIndex
|
||||
|
||||
sourceXPlayer.removeWeapon(itemName)
|
||||
targetXPlayer.addWeapon(itemName, itemCount)
|
||||
|
||||
if weaponTint then
|
||||
targetXPlayer.setWeaponTint(itemName, weaponTint)
|
||||
end
|
||||
@@ -485,9 +488,6 @@ if not Config.CustomInventory then
|
||||
end
|
||||
end
|
||||
|
||||
sourceXPlayer.removeWeapon(itemName)
|
||||
targetXPlayer.addWeapon(itemName, itemCount)
|
||||
|
||||
if weaponObject.ammo and itemCount > 0 then
|
||||
local ammoLabel = weaponObject.ammo.label
|
||||
sourceXPlayer.showNotification(TranslateCap("gave_weapon_withammo", weaponLabel, itemCount, ammoLabel, targetXPlayer.name))
|
||||
|
||||
Reference in New Issue
Block a user