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 )endaddEventHandler ( "onPlayerVehicleEnter", root, playerEnterVehicle )See Also
Vehicle Functions
- addVehicleSirens
- addVehicleUpgrade
- areVehicleLightsOn
- attachTrailerToVehicle
- blowVehicle
- createVehicle
- detachTrailerFromVehicle
- fixVehicle
- getHeliBladeCollisionsEnabled
- getModelHandling
- getOriginalHandling
- getTrainDirection
- getTrainPosition
- getTrainSpeed
- getVehicleAdjustableProperty
- getVehicleColor
- getVehicleCompatibleUpgrades
- getVehicleComponentPosition
- getVehicleComponentRotation
- getVehicleComponents
- getVehicleComponentScale
- getVehicleComponentVisible
- getVehicleController
- getVehicleCurrentGear
- getVehicleDoorOpenRatio
- getVehicleDoorState
- getVehicleDummyPosition
- getVehicleEngineState
- getVehicleEntryPoints
- getVehicleGravity
- getVehicleHandling
- getVehicleHeadLightColor
- getVehicleIdleRespawnDelay
- getVehicleLandingGearDown
- getVehicleLightState
- getVehicleMaxPassengers
- getVehicleModelDummyDefaultPosition
- getVehicleModelDummyPosition
- getVehicleModelExhaustFumesPosition
- getVehicleModelFromName
- getVehicleModelWheelSize
- getVehicleName
- getVehicleNameFromModel
- getVehicleNitroCount
- getVehicleNitroLevel
- getVehicleOccupant
- getVehicleOccupants
- getVehicleOverrideLights
- getVehiclePaintjob
- getVehiclePanelState
- getVehiclePlateText
- getVehicleRespawnDelay
- getVehicleRespawnPosition
- getVehicleRespawnRotation
- getVehicleRotorSpeed
- getVehicleRotorState
- getVehicleSirenParams
- getVehicleSirens
- getVehicleSirensOn
- getVehiclesOfType
- getVehicleTowedByVehicle
- getVehicleTowingVehicle
- getVehicleTurretPosition
- getVehicleType
- getVehicleUpgradeOnSlot
- getVehicleUpgrades
- getVehicleUpgradeSlotName
- getVehicleVariant
- getVehicleWheelFrictionState
- getVehicleWheelScale
- getVehicleWheelStates
- isTrainChainEngine
- isTrainDerailable
- isTrainDerailed
- isVehicleBlown
- isVehicleDamageProof
- isVehicleFuelTankExplodable
- isVehicleLocked
- isVehicleNitroActivated
- isVehicleNitroRecharging
- isVehicleOnGround
- isVehicleRespawnable
- isVehicleSmokeTrailEnabled
- isVehicleTaxiLightOn
- isVehicleWheelOnGround
- isVehicleWindowOpen
- removeVehicleSirens
- removeVehicleUpgrade
- resetVehicleComponentPosition
- resetVehicleComponentRotation
- resetVehicleComponentScale
- resetVehicleDummyPositions
- resetVehicleExplosionTime
- resetVehicleIdleTime
- respawnVehicle
- setHeliBladeCollisionsEnabled
- setModelHandling
- setTrainDerailable
- setTrainDerailed
- setTrainDirection
- setTrainPosition
- setTrainSpeed
- setVehicleAdjustableProperty
- setVehicleColor
- setVehicleComponentPosition
- setVehicleComponentRotation
- setVehicleComponentScale
- setVehicleComponentVisible
- setVehicleDamageProof
- setVehicleDoorOpenRatio
- setVehicleDoorState
- setVehicleDoorsUndamageable
- setVehicleDummyPosition
- setVehicleEngineState
- setVehicleFuelTankExplodable
- setVehicleGravity
- setVehicleHandling
- setVehicleHeadLightColor
- setVehicleIdleRespawnDelay
- setVehicleLandingGearDown
- setVehicleLightState
- setVehicleLocked
- setVehicleModelDummyPosition
- setVehicleModelExhaustFumesPosition
- setVehicleModelWheelSize
- setVehicleNitroActivated
- setVehicleNitroCount
- setVehicleNitroLevel
- setVehicleOverrideLights
- setVehiclePaintjob
- setVehiclePanelState
- setVehiclePlateText
- setVehicleRespawnDelay
- setVehicleRespawnPosition
- setVehicleRespawnRotation
- setVehicleRotorSpeed
- setVehicleRotorState
- setVehicleSirens
- setVehicleSirensOn
- setVehicleSmokeTrailEnabled
- setVehicleTaxiLightOn
- setVehicleTurretPosition
- setVehicleVariant
- setVehicleWheelScale
- setVehicleWheelsRotation
- setVehicleWheelStates
- setVehicleWindowOpen
- spawnVehicle
- spawnVehicleFlyingComponent
- toggleVehicleRespawn
Vehicle Events
- onClientTrailerAttach
- onClientTrailerDetach
- onClientVehicleCollision
- onClientVehicleDamage
- onClientVehicleEnter
- onClientVehicleExit
- onClientVehicleExplode
- onClientVehicleNitroStateChange
- onClientVehicleRespawn
- onClientVehicleStartEnter
- onClientVehicleStartExit
- onClientVehicleWeaponHit
- onTrailerAttach
- onTrailerDetach
- onVehicleDamage
- onVehicleEnter
- onVehicleExit
- onVehicleExplode
- onVehicleRespawn
- onVehicleStartEnter
- onVehicleStartExit