getVehicleColor | Multi Theft Auto: Wiki Skip to content

getVehicleColor

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

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.

Syntax

getVehicleColor ( )

Code Examples

server

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