Scripting/Squirrel/Functions/Vehicles/Colour2
From VC-MP Wiki
This instance variable returns the secondary colour of the vehicle.
Syntax
int vehicle.Colour2
Example
This example will give the vehicle colours when someone types '/c carcol'.
function onPlayerCommand( player, cmd, text ) { if ( cmd == "carcol" ) { local veh = player.Vehicle; if ( !veh ) MessagePlayer( "You are currently on foot." ); else MessagePlayer( "Vehicle colours - Main: " + veh.Colour1 + ", secondary: " + veh.Colour2, player ); } }
Notes
The functions MessagePlayer, player.Vehicle, vehicle.Colour1 and call onPlayerEnterVehicle were used in in this example. More info about them in corresponding pages.
Related Functions
- CreateVehicle
- FindVehicle
- GetVehicleCount
- GetVehicleModelFromName
- GetVehicleNameFromModel
- Vehicle.Alarm
- Vehicle.Angle
- Vehicle.Colour1
- Vehicle.Colour2
- Vehicle.Driver
- Vehicle.Fix
- Vehicle.Health
- Vehicle.ID
- Vehicle.IsLocked
- Vehicle.KillEngine
- Vehicle.Lights
- Vehicle.Model
- Vehicle.Pos
- Vehicle.Respawn
- Vehicle.RespawnAs
- Vehicle.RespawnAt
- Vehicle.SetFlatTyres
- Vehicle.SpawnPos
- Vehicle.SpawnAngle
- Vehicle.Velocity
- Vehicle.Remove
