- Documentation
- Server functions
- getVehicleColorId
Function
getVehicleColorId
Returns the two palette numbers set with setVehicleColorId. When the vehicle has RGB colours from setVehicleColor (or none yet), it returns false; use getVehicleColor then.
Syntax
int, int getVehicleColorId(vehicle vehicle)Arguments
vehiclevehicle- The vehicle.
Returns
Colour numbers 1 and 2, or false.
Example
local vehicle = createVehicle(411, 2000, -1690, 13.5)
setVehicleColorId(vehicle, 3, 1)
local c1, c2 = getVehicleColorId(vehicle)
outputDebugString(c1 .. ", " .. c2)
See also
setVehicleColorIdSets 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… (getVehiclePaletteColorgives names and colours). Passing one number sets both main colours to it.getVehicleColorReturns a vehicle's colours. Without the second argument it gives four game palette numbers (when the car has RGB colours, the numbers are the nearest palette colours). Withrgb = trueit returns twelve numbers: r, g, b for colours 1-4 in turn, exactly as seen in the game.