mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 05:02:15 +00:00
7538debb6ffcb8dc13ce518fc3bba53ccc886632
esx:giveInventoryItem applies the tint and the components to the receiving
player before calling addWeapon. Both setWeaponTint and addWeaponComponent
start with getWeapon and only proceed when the player already owns the weapon,
and the handler returns early a few lines above if the target does own it - so
at that point the target provably does not, and both calls do nothing.
The result is that handing a weapon to another player silently strips its
attachments and its paint. The pickup path in the same file already adds the
weapon first and then restores tint and components.
The values are snapshotted from the source weapon before any of this, and
removeWeapon already ran before addWeapon, so only the position of the two
restore blocks changes.
Verified on artifact 25770 by running both orders against a loadout:
tint and component first -> both return false, weapon ends up tint 0 with no
components
addWeapon first -> both return true, weapon ends up tint 1 with the
component attached
ESX Legacy
Discord - Website - Documentation
Want more resources? You can browse the Cfx.re Releases board for more!
ESX is the leading framework, trusted by over 12,000 communities to provide the highest quality roleplay servers on FiveM
💗 Supporters
Interested in helping us? Take a look at our patreon
| We would like to sincerely thank the following donors who helped fund the development of ESX. |
|---|
| Mohamad Buhamad - Michael Hein - RoadToSix - Montree Narathong |
| Saydoon - Muhannad alyamani - iSentrie - Wecity - Samuel Nicol |
| Kyle McShea - Artin - Mathias Christoffersen - Jaylan Yilmaz - Callum |
| CONGRESS KW - Michael Hein - Smery sitbon - daZepelin - CMF Community |
Description
Languages
JavaScript
62.3%
Lua
34.8%
TypeScript
1.2%
HTML
0.8%
CSS
0.7%
Other
0.2%