mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-28 23:01:26 +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 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))
|
||||||
|
|||||||
Reference in New Issue
Block a user