VehicleClient

setVehicleColours

SET_VEHICLE_COLOURS0x4F1D4BE3A7F24601

The GTA V native SET_VEHICLE_COLOURS of the VEHICLE namespace, as LS:MP client scripts call it: the global function setVehicleColours, in JavaScript and in Lua.

SignatureJavaScript
setVehicleColours(
  vehicle: Vehicle,
  colorPrimary: number,
  colorSecondary: number
): void
SignatureLua
setVehicleColours(
  vehicle: Vehicle,
  colorPrimary: integer,
  colorSecondary: integer
)

Usage

JavaScript
setVehicleColours(vehicle, colorPrimary, colorSecondary);
Lua
setVehicleColours(vehicle, colorPrimary, colorSecondary)

Parameters

ParameterTypeJavaScriptLua
vehicleVehiclenumberinteger
colorPrimaryintnumberinteger
colorSecondaryintnumberinteger

Returns

Nothing. In JavaScript the call evaluates to undefined.

Notes

From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.

colorPrimary & colorSecondary are the paint index for the vehicle.
For a list of valid paint indexes, view: https://pastebin.com/pwHci0xK


Note: minimum color index is 0, maximum color index is (numColorIndices - 1)

Full list of vehicle colors by DurtyFree: https://github.com/DurtyFree/gta-v-data-dumps/blob/master/vehicleColors.json

Reference

Namespace
Vehicle VEHICLE
In the game
void SET_VEHICLE_COLOURS(Vehicle vehicle, int colorPrimary, int colorSecondary)
Hash
0x4F1D4BE3A7F24601

Open in the interactive natives reference