ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. setVehicleColorId

Function

setVehicleColorId

ServerVehiclesTrilogy Hub only

Sets a vehicle's colours using numbers from the San Andreas vehicle palette (0-127), as in the classic game and the carcols files. Number 0 is black, 1 white, 3 red, 6 yellow… (getVehiclePaletteColor gives names and colours). Passing one number sets both main colours to it.

Syntax

bool setVehicleColorId(vehicle vehicle, int id1 [, int id2 = id1, int id3 = nil, int id4 = id3])

Arguments

vehiclevehicle
The vehicle.
id1int
Main colour number 0-127 (out-of-range values are clamped).
id2int, optional = id1
Second colour number 0-127.
id3int, optional = nil
Colour 3 number; without it colours 3 and 4 return to the model's own.
id4int, optional = id3
Colour 4 number.

Returns

true on success.

Example

local taxi = createVehicle(420, 1780, -1890, 13.4)
setVehicleColorId(taxi, 6, 1)

See also