Selt eb58d4674b fix(esx_lib/game): keep the secondary colour when the primary is custom
setVehicleProperties passes props.color1 straight into SetVehicleColours when the
secondary colour comes from the palette. If the primary is a custom RGB colour,
the getter stored it as a table, so a table reaches a native that wants a paint
index and the call does nothing. The secondary colour is silently lost.

Any car sprayed with a custom primary and a palette secondary comes back from
storage with the wrong secondary colour.

Fall back to the vehicle's current primary when props.color1 is not a paint index.
The custom primary was already applied by the block above, so nothing is lost.

Measured in game on artifact 25770, reading properties off a car with a custom red
primary and palette secondary 12, then applying them to a second car:
  before: color2 came back 0
  after:  color2 came back 12
The custom primary survives either way, mods and wheels are untouched.
2026-07-27 23:04:19 +02:00
2025-07-28 11:38:03 +02:00
2025-10-01 22:16:13 -05:00
2026-05-25 12:12:51 +02:00

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

S
Description
Official Repo For core resources for esx-legacy
Readme 49 MiB
Languages
JavaScript 62.3%
Lua 34.8%
TypeScript 1.2%
HTML 0.8%
CSS 0.7%
Other 0.2%