getVehicleColor | Multi Theft Auto: Wiki Skip to content

getVehicleColor

Client-side
Server-side
Shared

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


This function returns the color of the specified vehicle. A vehicle can have up to four colors.

OOP Syntax Help! I don't understand this!

Syntax

int,​ int,​ int,​ int,​ int,​ int,​ int,​ int,​ int,​ int,​ int,​ int getVehicleColor ( vehicle theVehicle, bool bRGB )
Required Arguments
  • theVehicle: The vehicle that you wish to get the color of.
  • bRGB: MISSING_PARAM_DESC

Returns

  • int: value1
  • int: value2
  • int: value3
  • int: value4
  • int: value5
  • int: value6
  • int: value7
  • int: value8
  • int: value9
  • int: value10
  • int: value11
  • int: value12

Valid color ids if bRGB is set to false:

Code Examples

shared

This will output the 4 colors of any car that the player enters.

function playerEnterVehicle ( theVehicle, seat, jacked )
-- Get the colors of the car and store them to 4 seperate variables
local color1, color2, color3, color4 = getVehicleColor ( theVehicle )
-- Output the four retrieved car colors into the chatbox
outputChatBox ( "Car color 1: " .. color1 )
outputChatBox ( "Car color 2: " .. color2 )
outputChatBox ( "Car color 3: " .. color3 )
outputChatBox ( "Car color 4: " .. color4 )
end
addEventHandler ( "onPlayerVehicleEnter", root, playerEnterVehicle )

See Also

Vehicle Functions